1 | declare module 'wasi' {
|
2 | interface WASIOptions {
|
3 | |
4 |
|
5 |
|
6 |
|
7 |
|
8 | args?: string[];
|
9 | |
10 |
|
11 |
|
12 |
|
13 | env?: object;
|
14 | |
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 | preopens?: {
|
21 | [key: string]: string;
|
22 | };
|
23 | }
|
24 |
|
25 | class WASI {
|
26 | constructor(options?: WASIOptions);
|
27 | /**
|
28 | *
|
29 | * Attempt to begin execution of `instance` by invoking its `_start()` export.
|
30 | * If `instance` does not contain a `_start()` export, then `start()` attempts to
|
31 | * invoke the `__wasi_unstable_reactor_start()` export. If neither of those exports
|
32 | * is present on `instance`, then `start()` does nothing.
|
33 | *
|
34 | * `start()` requires that `instance` exports a [`WebAssembly.Memory`][] named
|
35 | * `memory`. If `instance` does not have a `memory` export an exception is thrown.
|
36 | */
|
37 | start(instance: object): void; // TODO: avoid DOM dependency until WASM moved to own lib.
|
38 | /**
|
39 | * Is an object that implements the WASI system call API. This object
|
40 | * should be passed as the `wasi_unstable` import during the instantiation of a
|
41 | * [`WebAssembly.Instance`][].
|
42 | */
|
43 | readonly wasiImport: { [key: string]: any };
|
44 | }
|
45 | }
|