@@ -36,6 +36,7 @@ declare module "@webassemblyjs/ast" {
3636 ModuleImport ?: ( p : NodePath < ModuleImport > ) => void ;
3737 ModuleExport ?: ( p : NodePath < ModuleExport > ) => void ;
3838 Start ?: ( p : NodePath < Start > ) => void ;
39+ Global ?: ( p : NodePath < Global > ) => void ;
3940 }
4041 ) ;
4142 export class NodePath < T > {
@@ -52,32 +53,60 @@ declare module "@webassemblyjs/ast" {
5253 module : string ;
5354 descr : {
5455 type : string ;
55- valtype : string ;
56- id : string ;
56+ valtype ?: string ;
57+ id ?: Identifier ;
58+ signature ?: Signature ;
5759 } ;
5860 name : string ;
5961 }
6062 export class ModuleExport extends Node {
6163 name : string ;
64+ descr : {
65+ type : string ;
66+ exportType : string ;
67+ id ?: Identifier ;
68+ } ;
6269 }
70+ export class ModuleExportDescr extends Node { }
6371 export class IndexLiteral extends Node { }
64- export class NumberLiteral extends Node { }
65- export class Global extends Node { }
66- export class FuncParam extends Node { }
67- export class Instruction extends Node { }
72+ export class NumberLiteral extends Node {
73+ value : number ;
74+ raw : string ;
75+ }
76+ export class FloatLiteral extends Node { }
77+ export class GlobalType extends Node {
78+ valtype : string ;
79+ }
80+ export class Global extends Node {
81+ init : Instruction [ ] ;
82+ globalType : GlobalType ;
83+ }
84+ export class FuncParam extends Node {
85+ valtype : string ;
86+ }
87+ export class Instruction extends Node {
88+ id : string ;
89+ args : NumberLiteral [ ] ;
90+ }
6891 export class CallInstruction extends Instruction { }
6992 export class ObjectInstruction extends Instruction { }
7093 export class Func extends Node {
7194 signature : Signature ;
7295 }
7396 export class Signature {
74- params : any ;
75- result : any ;
97+ params : FuncParam [ ] ;
98+ results : string [ ] ;
7699 }
77- export class TypeInstructionFunc extends Node { }
100+ export class TypeInstruction extends Node { }
78101 export class IndexInFuncSection extends Node { }
79102 export function indexLiteral ( index : number ) : IndexLiteral ;
80- export function numberLiteral ( num : number ) : NumberLiteral ;
103+ export function numberLiteralFromRaw ( num : number ) : NumberLiteral ;
104+ export function floatLiteral (
105+ value : number ,
106+ nan ?: boolean ,
107+ inf ?: boolean ,
108+ raw ?: string
109+ ) : FloatLiteral ;
81110 export function global ( globalType : string , nodes : Node [ ] ) : Global ;
82111 export function identifier ( indentifier : string ) : Identifier ;
83112 export function funcParam ( valType : string , id : Identifier ) : FuncParam ;
@@ -88,13 +117,20 @@ declare module "@webassemblyjs/ast" {
88117 type : string ,
89118 init : Node [ ]
90119 ) : ObjectInstruction ;
91- export function func ( initFuncId , funcParams , funcResults , funcBody ) : Func ;
92- export function typeInstructionFunc ( params , result ) : TypeInstructionFunc ;
120+ export function signature ( params : FuncParam [ ] , results : string [ ] ) : Signature ;
121+ export function func ( initFuncId , Signature , funcBody ) : Func ;
122+ export function typeInstruction (
123+ id : Identifier ,
124+ functype : Signature
125+ ) : TypeInstruction ;
93126 export function indexInFuncSection ( index : IndexLiteral ) : IndexInFuncSection ;
94127 export function moduleExport (
95128 identifier : string ,
129+ descr : ModuleExportDescr
130+ ) : ModuleExport ;
131+ export function moduleExportDescr (
96132 type : string ,
97- index : IndexLiteral
133+ index : ModuleExportDescr
98134 ) : ModuleExport ;
99135
100136 export function getSectionMetadata ( ast : any , section : string ) ;
0 commit comments