summaryrefslogtreecommitdiff
path: root/std/wasi
diff options
context:
space:
mode:
authorCasper Beyer <caspervonb@pm.me>2020-12-10 23:13:57 +0800
committerGitHub <noreply@github.com>2020-12-10 16:13:57 +0100
commit5f05e1783e9f08d1be4b71f2099601458da78dcd (patch)
treec016ca70aa740057bcd1b4c55a4b66850a448723 /std/wasi
parentf91fa16661fa10fd029e6cf26008faee95233143 (diff)
docs(std/wasi): document ContextOptions (#8715)
Diffstat (limited to 'std/wasi')
-rw-r--r--std/wasi/snapshot_preview1.ts23
1 files changed, 23 insertions, 0 deletions
diff --git a/std/wasi/snapshot_preview1.ts b/std/wasi/snapshot_preview1.ts
index 2ec51da88..bc63e82dd 100644
--- a/std/wasi/snapshot_preview1.ts
+++ b/std/wasi/snapshot_preview1.ts
@@ -279,9 +279,32 @@ export class ExitStatus {
}
export interface ContextOptions {
+ /**
+ * An array of strings that the WebAssembly instance will see as command-line
+ * arguments.
+ *
+ * The first argument is the virtual path to the command itself.
+ */
args?: string[];
+
+ /**
+ * An object of string keys mapped to string values that the WebAssembly module will see as its environment.
+ */
env?: { [key: string]: string | undefined };
+
+ /**
+ * An object of string keys mapped to string values that the WebAssembly module will see as it's filesystem.
+ *
+ * The string keys of are treated as directories within the sandboxed
+ * filesystem, the values are the real paths to those directories on the host
+ * machine.
+ *
+ */
preopens?: { [key: string]: string };
+
+ /**
+ * Determines if calls to exit from within the WebAssembly module will terminate the proess or return.
+ */
exitOnReturn?: boolean;
}