You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: move ambient const enums into real modules
TypeScript inlines `const enum` values at compile time and erases the
import, so declaring them in .d.ts files worked only because tsc has
whole-program type information. Any file-local transpiler (esbuild, swc,
tsx, vite, bun) cannot inline them and fails to resolve the import, which
blocks running the sources without a full tsc pass.
The 12 ambient const enums now live in real modules:
- 5 from lib/common/declarations.d.ts -> lib/common/enums.ts
- BuildNames -> lib/constants.ts, next to the
other build-related enums
- detached-process-enums, system-warnings and
google-analytics-custom-dimensions -> .d.ts renamed to .ts; they held
nothing but enums
- SpecialKeys -> key-commands.d.ts renamed to .ts,
which already exported everything,
so importers are unchanged
The four global files had no imports, making their enums globally visible;
consumers now import them explicitly.
GoogleAnalyticsCrossClientCustomDimensions is referenced nowhere and was
dropped rather than converted into a dead runtime module.
Renaming key-commands to .ts surfaced two interface methods whose missing
return types an ambient context had allowed; both implementations return
nothing, so they are annotated void.
0 commit comments