Initially I declared everything in ambient module. Later I had to extract enums to non-ambient module, because I needed enum member lookup, with declare and const its not possible. Now my sample files look as following
//enums.ts
export enum Enum1{
Value1, Value2
}
//ambient.d.ts
import * as enums from "./enums";
declare interface TypeA
{
enumField: enums.Enum1;
strField: string;
}
//consumer.ts
/// <reference path="ambient.d.ts"/>
class Consumer{
memberField: TypeA; // <= Here compiler cannot find TypeA
}
What am I doing wrong and how should I proceed?