String consts/enums in typescript: const, namespace, or class? -
we have enum or set of consts in our project, , pr comment led discussion on idiomatic way of structuring is:
export class thingtypes { public static readonly thing = "thing"; public static readonly otherthing = "otherthing"; }
or
export namespace thingtypes { public static readonly thing = "thing"; public static readonly otherthing = "otherthing"; }
or
export const thingtypes { thing: "thing", otherthing: "otherthing" }
we not on >=2.4 cannot use enum
(as prior 2.4, strings), sake of argument: enum
idiomatic way? la:
export enum thingtypes { public static readonly thing = "thing"; public static readonly otherthing = "otherthing"; }
the internet not yielding clear answer. idiomatic way , conventional way of making sets of consts in typescript?
Comments
Post a Comment