Skip to content

fix(typescript): expose public enums to isolated consumers - #448

Open
Galin Iliev (galiniliev) wants to merge 1 commit into
microsoft:mainfrom
galiniliev:fix/typescript-public-enums
Open

Galin Iliev (galiniliev) wants to merge 1 commit into
microsoft:mainfrom
galiniliev:fix/typescript-public-enums

Conversation

@galiniliev

Copy link
Copy Markdown

The TypeScript SDK publishes ambient const enum declarations even though its JavaScript exports ordinary enum objects. Consumers using isolatedModules or verbatimModuleSyntax therefore fail with TS2748 when importing public enum values.

Generate ordinary enums in the TypeScript SDK mirror while leaving the canonical protocol sources and other language generators unchanged. The packed-package regression compiles and runs real root/client/hosts/ws consumers, including numeric flags and reverse mappings. All 74 emitted JavaScript files remain byte-for-byte identical; all 49 runtime enum objects and values match the base build.

Validation:

  • New packed-consumer regression fails before the fix and passes afterward with skipLibCheck: false.
  • npm run generate: passed.
  • Root npm test: 445 passed.
  • TypeScript SDK npm test: 67 passed, including isolated-module consumer modes.
  • SDK, modified generator and regression typechecks: passed.
  • Change-fragment verification and final immutable-tarball consumer/runtime proof: passed.

A separate non-gating root TypeScript probe reports ten unchanged baseline errors in unrelated scripts. No protocol or package version bump is included.

Generate ordinary enums in the TypeScript SDK mirror so package declarations work with isolatedModules and verbatimModuleSyntax. Preserve canonical protocol sources and all emitted JavaScript values.

Build before SDK tests and exercise an installed npm tarball through TypeScript compilation and plain Node execution, including numeric enum flags and reverse mappings.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant