-
Notifications
You must be signed in to change notification settings - Fork 0
/
webassembly.d.ts
28 lines (23 loc) · 993 Bytes
/
webassembly.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
declare namespace BetterTypeScript {
namespace WebAssembly {
interface Instance {
readonly exports: BetterTypeScript.WebAssembly.Exports;
}
interface WebAssemblyInstantiatedSource {
instance: BetterTypeScript.WebAssembly.Instance;
module: globalThis.WebAssembly.Module;
}
type ExportValue = (
& ((...args: any[]) => any)
& globalThis.WebAssembly.Global
& globalThis.WebAssembly.Memory
& globalThis.WebAssembly.Table
);
type Exports = Record<string, BetterTypeScript.WebAssembly.ExportValue>;
}
}
declare namespace WebAssembly {
function instantiate(bytes: BufferSource, importObject?: Imports): Promise<BetterTypeScript.WebAssembly.WebAssemblyInstantiatedSource>;
function instantiate(moduleObject: Module, importObject?: Imports): Promise<BetterTypeScript.WebAssembly.Instance>;
function instantiateStreaming(source: Response | PromiseLike<Response>, importObject?: Imports): Promise<BetterTypeScript.WebAssembly.WebAssemblyInstantiatedSource>;
}