Skip to content

Commit

Permalink
Improve nomenclature of ES6 TypeScript defs default export
Browse files Browse the repository at this point in the history
  • Loading branch information
jnickg committed Mar 1, 2024
1 parent 17feb2a commit 06e9806
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions test/other/embind_tsgen_es6.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,5 +110,4 @@ interface EmbindModule {
wstring_test(_0: string): string;
}
export type MainModule = WasmModule & EmbindModule;
export type MainModuleFunctor = (options?: unknown) => Promise<MainModule>;
export default MainModuleFunctor;
export default function MainModuleFactory (options?: unknown): Promise<MainModule>;
3 changes: 1 addition & 2 deletions tools/emscripten.py
Original file line number Diff line number Diff line change
Expand Up @@ -632,8 +632,7 @@ def create_tsd(metadata, embind_tsd):
export_interfaces += ' & EmbindModule'
out += f'export type MainModule = {export_interfaces};\n'
if settings.EXPORT_ES6 and settings.MODULARIZE:
out += 'export type MainModuleFunctor = (options?: unknown) => Promise<MainModule>;\n'
out += 'export default MainModuleFunctor;\n'
out += 'export default function MainModuleFactory (options?: unknown): Promise<MainModule>;\n'
return out


Expand Down

0 comments on commit 06e9806

Please sign in to comment.