@@ -29,6 +29,69 @@ declare module "chrome-trace-event" {
2929 }
3030}
3131
32+ // There are no typings for @webassemblyjs /ast
33+ declare module "@webassemblyjs/ast" {
34+ export function traverse (
35+ ast : any ,
36+ visitor : { [ name : string ] : ( context : { node : Node } ) => void }
37+ ) ;
38+ export class Node {
39+ index : number ;
40+ }
41+ export class Identifier extends Node {
42+ value : string ;
43+ }
44+ export class ModuleImport extends Node {
45+ module : string ;
46+ descr : {
47+ type : string ;
48+ valtype : string ;
49+ } ;
50+ name : string ;
51+ }
52+ export class ModuleExport extends Node {
53+ name : string ;
54+ }
55+ export class IndexLiteral extends Node { }
56+ export class NumberLiteral extends Node { }
57+ export class Global extends Node { }
58+ export class FuncParam extends Node { }
59+ export class Instruction extends Node { }
60+ export class CallInstruction extends Instruction { }
61+ export class ObjectInstruction extends Instruction { }
62+ export class Func extends Node {
63+ signature : Signature ;
64+ }
65+ export class Signature {
66+ params : any ;
67+ result : any ;
68+ }
69+ export class TypeInstructionFunc extends Node { }
70+ export class IndexInFuncSection extends Node { }
71+ export function indexLiteral ( index : number ) : IndexLiteral ;
72+ export function numberLiteral ( num : number ) : NumberLiteral ;
73+ export function global ( globalType : string , nodes : Node [ ] ) : Global ;
74+ export function identifier ( indentifier : string ) : Identifier ;
75+ export function funcParam ( valType : string , id : Identifier ) : FuncParam ;
76+ export function instruction ( inst : string , args : Node [ ] ) : Instruction ;
77+ export function callInstruction ( funcIndex : IndexLiteral ) : CallInstruction ;
78+ export function objectInstruction (
79+ kind : string ,
80+ type : string ,
81+ init : Node [ ]
82+ ) : ObjectInstruction ;
83+ export function func ( initFuncId , funcParams , funcResults , funcBody ) : Func ;
84+ export function typeInstructionFunc ( params , result ) : TypeInstructionFunc ;
85+ export function indexInFuncSection ( index : IndexLiteral ) : IndexInFuncSection ;
86+ export function moduleExport (
87+ identifier : string ,
88+ type : string ,
89+ index : IndexLiteral
90+ ) : ModuleExport ;
91+
92+ export function getSectionMetadata ( ast : any , section : string ) ;
93+ }
94+
3295/**
3396 * Global variable declarations
3497 * @todo Once this issue is resolved, remove these globals and add JSDoc onsite instead
@@ -51,3 +114,5 @@ declare const WebAssembly;
51114declare const importScripts ;
52115declare const $crossOriginLoading$ ;
53116declare const chunkId ;
117+
118+ type TODO = any ;
0 commit comments