How do I place a constant in an Interface in typescript. Like in java it is:
interface OlympicMedal {
static final String GOLD = \"Gold\";
static final S
There is a workaround for having constants in a interface: define both the module and the interface with the same name.
In the following, the interface declaration will merge with the module, so that OlympicMedal becomes a value, namespace, and type. This might be what you want.
module OlympicMedal {
export const GOLD = "Gold";
export const SILVER = "Silver";
}
interface OlympicMedal /* extends What_you_need */ {
myMethod(input: any): any;
}
This works with Typescript 2.x