I use maxGraph v0.2.1 in a TypeScript application that activates the isolatedModules option.
Accessing to enum declared in constants generates the TS2748 error. For instance, constants.ALIGN.LEFT or constants.SHAPE.ELLIPSE.
My Proposal
maxGraph should probably not export "const enum" for interoperability reasons.
See
We could also ban const enums with typescript-eslint.io/linting/troubleshooting#how-can-i-ban-specific-language-feature or if we absolutely must keep const enum, we should enable preserveConstEnums typescriptlang.org/tsconfig#preserveConstEnums
Notes
Be also aware of #378.
Usage of const enum in maxGraph-core prevents to use them in the Storybook TypeScript stories (in the html package) as this project uses the isolatedModules option.
I use maxGraph v0.2.1 in a TypeScript application that activates the
isolatedModulesoption.Accessing to enum declared in
constantsgenerates the TS2748 error. For instance,constants.ALIGN.LEFTorconstants.SHAPE.ELLIPSE.My Proposal
maxGraphshould probably not export "const enum" for interoperability reasons.See
We could also ban const enums with typescript-eslint.io/linting/troubleshooting#how-can-i-ban-specific-language-feature or if we absolutely must keep const enum, we should enable preserveConstEnums typescriptlang.org/tsconfig#preserveConstEnums
Notes
Be also aware of #378.
Usage of const enum in maxGraph-core prevents to use them in the Storybook TypeScript stories (in the html package) as this project uses the
isolatedModulesoption.