Skip to content

[jspi] Fix TypeScript definitions for JSPI exports#26943

Merged
brendandahl merged 1 commit into
emscripten-core:mainfrom
brendandahl:jspi-c-exports
May 13, 2026
Merged

[jspi] Fix TypeScript definitions for JSPI exports#26943
brendandahl merged 1 commit into
emscripten-core:mainfrom
brendandahl:jspi-c-exports

Conversation

@brendandahl

Copy link
Copy Markdown
Collaborator

JSPI exported functions return a Promise when invoked from JavaScript. However, the generated TypeScript definitions previously typed them as returning synchronous values.

Update the TypeScript definition generator to check whether JSPI is enabled and wrap the return types of JSPI exports in a Promise. Also add test coverage for JSPI TypeScript definitions and wildcard matching.

@brendandahl brendandahl requested a review from sbc100 May 13, 2026 21:36
JSPI exported functions return a Promise when invoked from JavaScript.
However, the generated TypeScript definitions previously typed them as
returning synchronous values.

Update the TypeScript definition generator to check whether JSPI is
enabled and wrap the return types of JSPI exports in a Promise. Also
add test coverage for JSPI TypeScript definitions and wildcard matching.
@brendandahl brendandahl merged commit fdb1378 into emscripten-core:main May 13, 2026
30 checks passed
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.

2 participants