Installed product versions
- Visual Studio: 2019 Professional
- This extension: v2.2.4
Description
In a Typescript Definition file, if you specify an "enum" the typescript compiler treats it as a type, and does not substitute values. If you specify "const enum" the compiler will substitute the values for the enum where it is used in the typescript when generating the javascript file. For a definition generated from the C# it needs to substitute values where used, as the reference to the type is lost on compilation to javascript and you end up with a runtime object not found errors in the browser.
If it is "const enum" the typescript compiler substitutes the values for the enum references in the code and it all works.
Looking at the example for this extension, "public enum" should become "const enum" but the output I'm getting in the d.ts is just "enum".
Steps to recreate
Add an public enum inside a namespace within a .cs file, generate the d.ts file. The generated enum is not prefixed with "const".