diff --git a/test/other/embind_tsgen_ignore_2.d.ts b/test/other/embind_tsgen_ignore_2.d.ts index 81ceadf3278a3..44e4a545a5e44 100644 --- a/test/other/embind_tsgen_ignore_2.d.ts +++ b/test/other/embind_tsgen_ignore_2.d.ts @@ -109,3 +109,4 @@ interface EmbindModule { wstring_test(_0: string): string; } export type MainModule = WasmModule & EmbindModule; +export default function MainModuleFactory (options?: unknown): Promise; diff --git a/tools/emscripten.py b/tools/emscripten.py index f89ac03cc5d69..ec2f71062f4c2 100644 --- a/tools/emscripten.py +++ b/tools/emscripten.py @@ -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;\n' return out