Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve ES6 support in TypeScript definitions generation #21460

Merged
merged 1 commit into from
Mar 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions test/other/embind_tsgen_ignore_2.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,4 @@ interface EmbindModule {
wstring_test(_0: string): string;
}
export type MainModule = WasmModule & EmbindModule;
export default function MainModuleFactory (options?: unknown): Promise<MainModule>;
2 changes: 2 additions & 0 deletions tools/emscripten.py
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,8 @@ def create_tsd(metadata, embind_tsd):
if embind_tsd:
export_interfaces += ' & EmbindModule'
out += f'export type MainModule = {export_interfaces};\n'
if settings.EXPORT_ES6 and settings.MODULARIZE:
out += 'export default function MainModuleFactory (options?: unknown): Promise<MainModule>;\n'
return out


Expand Down
Loading