I want to provide an interface that guarantees that an enum definition will be passed.
// msg.ts, here's an example enum
export enum Messages {
A,
B
}
// interfaces.d.ts
export interface IThingy {
Messages: Messages
// ^ how do I specify that Messages should be the actual, full enum, not a member of the enum?
}
I want consumers to be able to access that enum as though it were injected. For example:
function (param: IThingy) {
param.Messages.A // ok!
}
If that's not possible, how could I feasibly achieve the same effect? Ultimately I just want to pass around a constant, strongly typed K:V (string:string) map.
I did see similar: Enum as Parameter in typescript, although my intent is sufficiently different.