@@ -60,10 +60,16 @@ declare module "@webassemblyjs/ast" {
6060 }
6161 export class ModuleExport extends Node {
6262 name : string ;
63+ descr : ModuleExportDescr ;
64+ }
65+ type Index = Identifier | NumberLiteral ;
66+ export class ModuleExportDescr extends Node {
67+ exportType : string ;
68+ id : Index ;
69+ }
70+ export class NumberLiteral extends Node {
71+ value : number ;
6372 }
64- export class ModuleExportDescr extends Node { }
65- export class IndexLiteral extends Node { }
66- export class NumberLiteral extends Node { }
6773 export class FloatLiteral extends Node { }
6874 export class Global extends Node { }
6975 export class FuncParam extends Node {
@@ -81,14 +87,14 @@ declare module "@webassemblyjs/ast" {
8187 }
8288 export class TypeInstruction extends Node { }
8389 export class IndexInFuncSection extends Node { }
84- export function indexLiteral ( index : number ) : IndexLiteral ;
90+ export function indexLiteral ( index : number ) : Index ;
8591 export function numberLiteralFromRaw ( num : number ) : NumberLiteral ;
8692 export function floatLiteral ( value : number , nan ?: boolean , inf ?: boolean , raw ?: string ) : FloatLiteral ;
8793 export function global ( globalType : string , nodes : Node [ ] ) : Global ;
8894 export function identifier ( indentifier : string ) : Identifier ;
8995 export function funcParam ( valType : string , id : Identifier ) : FuncParam ;
9096 export function instruction ( inst : string , args : Node [ ] ) : Instruction ;
91- export function callInstruction ( funcIndex : IndexLiteral ) : CallInstruction ;
97+ export function callInstruction ( funcIndex : Index ) : CallInstruction ;
9298 export function objectInstruction (
9399 kind : string ,
94100 type : string ,
@@ -97,15 +103,15 @@ declare module "@webassemblyjs/ast" {
97103 export function signature ( params : FuncParam [ ] , results : string [ ] ) : Signature ;
98104 export function func ( initFuncId , Signature , funcBody ) : Func ;
99105 export function typeInstruction ( id : Identifier , functype : Signature ) : TypeInstruction ;
100- export function indexInFuncSection ( index : IndexLiteral ) : IndexInFuncSection ;
106+ export function indexInFuncSection ( index : Index ) : IndexInFuncSection ;
101107 export function moduleExport (
102108 identifier : string ,
103109 descr : ModuleExportDescr
104110 ) : ModuleExport ;
105111 export function moduleExportDescr (
106112 type : string ,
107- index : ModuleExportDescr
108- ) : ModuleExport ;
113+ index : Index
114+ ) : ModuleExportDescr ;
109115
110116 export function getSectionMetadata ( ast : any , section : string ) ;
111117}
0 commit comments