Currently working on a project and I've noticed developers using TypeScript in the following way:
export class Ledger implements ILedger {
LedgerID: number;
CashAmmount: number;
Units: number;
public static someFunction {
// an ajax call, for example, to a controller
}
}
export interface ILedger {
LedgerID: number;
CashAmmount: number;
Units: number;
}
I'm questioning whether this is the correct approach. It seems redundant to have no implementation in the class. Additionally, in our React components, there are references to either the interface or the class. I'd like to establish some guidelines but first need guidance on what the best practice is in this scenario.