Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

typings: provide internal types for wasi bindings #54119

Merged
merged 2 commits into from
Aug 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions typings/globals.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { TimersBinding } from './internalBinding/timers';
import { TypesBinding } from './internalBinding/types';
import { URLBinding } from './internalBinding/url';
import { UtilBinding } from './internalBinding/util';
import { WASIBinding } from './internalBinding/wasi';
import { WorkerBinding } from './internalBinding/worker';
import { ModulesBinding } from './internalBinding/modules';

Expand Down Expand Up @@ -48,6 +49,7 @@ interface InternalBindingMap {
types: TypesBinding;
url: URLBinding;
util: UtilBinding;
wasi: WASIBinding;
worker: WorkerBinding;
}

Expand Down
14 changes: 14 additions & 0 deletions typings/internalBinding/wasi.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
declare namespace InternalWASIBinding {
type EnvStr = `${string}=${string}`

class WASI {
constructor(args: string[], env: EnvStr[], preopens: string[], stdio: [stdin: number, stdout: number, stderr: number])

_setMemory(memory: WebAssembly.Memory): void;
}
}

export interface WASIBinding {
WASI: typeof InternalWASIBinding.WASI;
}

Loading