Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 16d4c43

Browse filesBrowse files
RulerOfCakesRafaelGSS
authored andcommitted
typings: provide internal types for wasi bindings
PR-URL: #54119 Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
1 parent fc08a9b commit 16d4c43
Copy full SHA for 16d4c43

2 files changed

+16Lines changed: 16 additions & 0 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎typings/globals.d.ts‎

Copy file name to clipboardExpand all lines: typings/globals.d.ts
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { TimersBinding } from './internalBinding/timers';
1515
import { TypesBinding } from './internalBinding/types';
1616
import { URLBinding } from './internalBinding/url';
1717
import { UtilBinding } from './internalBinding/util';
18+
import { WASIBinding } from './internalBinding/wasi';
1819
import { WorkerBinding } from './internalBinding/worker';
1920
import { ModulesBinding } from './internalBinding/modules';
2021

@@ -50,6 +51,7 @@ interface InternalBindingMap {
5051
types: TypesBinding;
5152
url: URLBinding;
5253
util: UtilBinding;
54+
wasi: WASIBinding;
5355
worker: WorkerBinding;
5456
}
5557

Collapse file

‎typings/internalBinding/wasi.d.ts‎

Copy file name to clipboard
+14Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
declare namespace InternalWASIBinding {
2+
type EnvStr = `${string}=${string}`
3+
4+
class WASI {
5+
constructor(args: string[], env: EnvStr[], preopens: string[], stdio: [stdin: number, stdout: number, stderr: number])
6+
7+
_setMemory(memory: WebAssembly.Memory): void;
8+
}
9+
}
10+
11+
export interface WASIBinding {
12+
WASI: typeof InternalWASIBinding.WASI;
13+
}
14+

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.