@@ -19,10 +19,11 @@ export function convertIDL(rootTypes: webidl2.IDLRootType[]) {
19
19
}
20
20
}
21
21
22
- // declare function Ammo(): Promise<void>;
22
+ const ammoDefault = ts . createExportAssignment ( [ ] , [ ] , false , ts . createIdentifier ( 'Ammo' ) )
23
+ // export declare function Ammo(): Promise<void>;
23
24
const ammoPromise = ts . createFunctionDeclaration (
24
25
/* decorators */ [ ] ,
25
- /* modifiers */ [ ts . createModifier ( ts . SyntaxKind . DeclareKeyword ) ] ,
26
+ /* modifiers */ [ ts . createModifier ( ts . SyntaxKind . ExportKeyword ) , ts . createModifier ( ts . SyntaxKind . DeclareKeyword ) ] ,
26
27
/* asteriskToken */ undefined ,
27
28
/* name */ 'Ammo' ,
28
29
/* typeParameters */ [ ] ,
@@ -41,15 +42,18 @@ export function convertIDL(rootTypes: webidl2.IDLRootType[]) {
41
42
/* type */ ts . createKeywordTypeNode ( ts . SyntaxKind . VoidKeyword ) ,
42
43
/* body */ undefined
43
44
)
44
- // declare module Ammo { ... }
45
- const ammo = ts . createModuleDeclaration (
45
+ // export declare module Ammo { ... }
46
+ const ammoModule = ts . createModuleDeclaration (
46
47
/* decorators */ [ ] ,
47
- /* modifiers */ [ ts . createModifier ( ts . SyntaxKind . DeclareKeyword ) ] ,
48
+ /* modifiers */ [ ts . createModifier ( ts . SyntaxKind . ExportKeyword ) , ts . createModifier ( ts . SyntaxKind . DeclareKeyword ) ] ,
48
49
/* name */ ts . createIdentifier ( 'Ammo' ) ,
49
50
/* body */ ts . createModuleBlock ( [ ammoDestroy , ...nodes ] )
50
51
)
51
52
52
- return [ printer . printNode ( ts . EmitHint . Unspecified , ammoPromise , file ) , printer . printNode ( ts . EmitHint . Unspecified , ammo , file ) ] . join ( '\n' )
53
+ return [
54
+ printer . printNode ( ts . EmitHint . Unspecified , ammoDefault , file ) ,
55
+ printer . printNode ( ts . EmitHint . Unspecified , ammoPromise , file ) ,
56
+ printer . printNode ( ts . EmitHint . Unspecified , ammoModule , file ) ] . join ( '\n' )
53
57
}
54
58
55
59
function convertInterface ( idl : webidl2 . InterfaceType ) {
0 commit comments