Having recently started working with Typescript in a create-react-project, I've set up a /typings folder that my tsconfig.json file is pointing to. All of my type declarations are currently stored in an index.d.ts file within that folder.
Everything seems fine so far. The "type" and "interface" declarations are accessible throughout the project without needing to be explicitly exported from the index.d.ts file or imported into other files.
The issue arises when I declare an enum like this...
enum Gender {male, female}
Upon trying to use the enum in a different file, I encounter the following error message...
Ambient const enums are not allowed when the '--isolatedModules' flag is provided
I've explored solutions on Stack Overflow suggesting to declare the enum as a const and even adding "export defualt undefined" at the end of the file, but these approaches have not proven successful. Additionally, changing the compiler options by setting "isolatedModules": false doesn't seem to stick, as it reverts back to true during compilation due to create-react-app behavior.
How can I ensure that enums declared in my index.d.ts file can be seamlessly used across the entirety of my project?