declare const enum {
UP,
DOWN,
}`
isn't allowed when the --isolatedModules compilerOption is used.
error TS1209: Ambient const enums are not allowed when the '--isolatedModules' flag is provided.
My understanding of --isolatedModules is that it tells the compiler to do extra checking to ensure that separate compilation (such as by using transpileModule) is safe.
So why is const enum (without declare) allowed? Isn't it unsafe for separate compilation? That is, if foo.ts imports and uses a const enum from bar.ts, how could ts.transpileModule know how to correctly transpile the enum usage?