Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -33,6 +33,7 @@ import { ProfilerBinding } from './internalBinding/profiler';
import { SeaBinding } from './internalBinding/sea';
import { SerdesBinding } from './internalBinding/serdes';
import { SignalWrapBinding } from './internalBinding/signal_wrap';
import { SpawnSyncBinding } from './internalBinding/spawn_sync';
import { StreamPipeBinding } from './internalBinding/stream_pipe';
import { StringDecoderBinding } from './internalBinding/string_decoder';
import { SymbolsBinding } from './internalBinding/symbols';
Expand Down Expand Up @@ -84,6 +85,7 @@ interface InternalBindingMap {
sea: SeaBinding;
serdes: SerdesBinding;
signal_wrap: SignalWrapBinding;
spawn_sync: SpawnSyncBinding;
stream_pipe: StreamPipeBinding;
string_decoder: StringDecoderBinding;
symbols: SymbolsBinding;
Expand Down
33 changes: 33 additions & 0 deletions typings/internalBinding/spawn_sync.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
type SpawnSyncStdio =
| { type: 'ignore' }
| { type: 'pipe'; readable: boolean; writable: boolean; input?: Uint8Array }
| { type: 'inherit'; fd: number }
| { type: 'fd'; fd: number };

export interface SpawnSyncOptions {
file: string;
args: readonly string[];
cwd?: string | null;
envPairs?: readonly string[] | null;
uid?: number;
gid?: number;
detached?: boolean;
windowsHide?: boolean;
windowsVerbatimArguments?: boolean;
timeout?: number;
maxBuffer?: number;
killSignal?: number;
stdio: readonly SpawnSyncStdio[];
}

export interface SpawnSyncResult {
error?: number;
status: number | null;
signal: string | null;
output: (Uint8Array | null)[] | null;
pid: number;
}

export interface SpawnSyncBinding {
spawn(options: SpawnSyncOptions): SpawnSyncResult;
}
Loading