I am working with a module defined in TypeScript that looks like this:
declare module MyTypes {
export enum MyEnum {
GOOD = 'Good',
BAD = 'Bad',
UNKNOWN = '-'
}
export interface MyType1 {
myType1:string
}
}
export default MyTypes;
In another file, I import it using the following code:
import MyTypes from '/my-types'
import MyType1 = MyTypes.MyType1
import MyEnum = MyTypes.MyEnum
However, when referencing MyEnum.GOOD
in the code, Chrome throws an exception saying that MyTypes
is not defined. What would be the correct way to import enums from modules in TypeScript?