I have an enum in Typescript let's say
export const enum CarType {
SED = "Sedan"
}
The JavaScript code after build :
"use strict";
Object.defineProperty(exports,"_esModule, { value: true })
:
So basically the js code doesn't have the logic, instead only the .d.ts file has the same.
When I build it using tsc command and export the JavaScript code to a react app, while accessing this enum like: CarType.SED, it is giving an error like - Cannot read property SED of undefined
What could be the reason for the same. I understood that the typescript has a declaration file(of extension .ts). How can I use this in a purely JS project?