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
{{ message }}
Repository navigation
BridgeJS: Incorrect type name references in generated TypeScript for tsEnum-style enums and struct associated values #612
The TypeScript declaration generator (BridgeJSLink.generateTypeScript()) produces invalid .d.ts with incorrect type name references in function signatures and enum associated value types.
tsEnum-style enums: For enums using @JS(enumStyle: .tsEnum), the generated function signatures reference TSDirectionTag, TSThemeTag, TSHttpStatusTag — but the actual emitted type names are DirectionTag, ThemeTag, HttpStatusTag (without the TS prefix). The codegen applies a different naming convention for the Tag type alias than for the enum declaration itself.
Struct associated values: When an exported @JS struct Point is used as an associated value in an enum (e.g., case structPayload(Point)), the enum tag union references PointTag but the emitted type is Point (as an interface). The Tag suffix is incorrectly appended.
Reproduction
Running tsc --noEmit against the snapshot .d.ts files:
EnumAssociatedValue.d.ts(85,65): error TS2304: Cannot find name 'PointTag'.
EnumCase.d.ts(45,31): error TS2552: Cannot find name 'TSDirectionTag'. Did you mean 'DirectionTag'?
EnumRawType.d.ts(116,23): error TS2552: Cannot find name 'TSThemeTag'. Did you mean 'ThemeTag'?
EnumRawType.d.ts(125,29): error TS2304: Cannot find name 'TSHttpStatusTag'.
Activity
krodak commentedon Feb 10, 2026
Closed by #614