Reputation: 830
I have an enum type with many items and therefore I want to put the definition in an individual file. The type is defined as
const enum Band {
B2190m = '2190m',
B631m = '631m',
// ... etc. many more
};
However, trying to export this by export
or export default
fails with "Expression expected" TS1109.
What is the correct way to do this?
Thank you.
Upvotes: 1
Views: 3752
Reputation: 111
const enum
is inlined while transpilation to js, so can't be exported.
You should emit "const" and use just enum:
export enum Band {
...
Upvotes: 1