I faced a common dilemma.
interface ICodeDescription {
code: string;
description: string;
}
export interface IIvaOptions extends ICodeDescription { }
export interface IIIBBCodes extends ICodeDescription { }
export interface IPersonType extends ICodeDescription { }
Is it advantageous to use these additional typings, considering the potential memory usage in larger scenarios? Or would it be more practical to simply utilize ICodeDescription
for all type definitions?
Thank you in advance.
UPDATE: It is important to note that interfaces do not exist in JavaScript; they only apply at compile time. Thus, after further consideration, it seems that this approach of using multiple types is beneficial for clearer code organization and any performance lag will only be evident during compilation.