typings: wire up spawn_sync internal binding types

Signed-off-by: agape1225 <49804691+agape1225@users.noreply.github.com>
PR-URL: https://github.com/nodejs/node/pull/65996
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
This commit is contained in:
agape1225 authored and GitHub committed 2026-09-27 03:54:54 +00:00
1 parent 14e8f5bca4
commit cf0434f59c
2 files changed
+35

No files matched your search

+2
View File
@@ -35,6 +35,7 @@ import { QuicBinding } from './internalBinding/quic';
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';
@@ -88,6 +89,7 @@ interface InternalBindingMap {
sea: SeaBinding;
serdes: SerdesBinding;
signal_wrap: SignalWrapBinding;
spawn_sync: SpawnSyncBinding;
stream_pipe: StreamPipeBinding;
string_decoder: StringDecoderBinding;
symbols: SymbolsBinding;
+33
View File
@@ -0,0 +1,33 @@
type SpawnSyncStdio =
| { type: 'ignore' }
| { type: 'pipe'; readable: boolean; writable: boolean; input?: ArrayBufferView }
| { 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 | null;
gid?: number | null;
detached?: boolean;
windowsHide?: boolean;
windowsVerbatimArguments?: boolean;
timeout?: number | null;
maxBuffer?: number | null;
killSignal?: number | null;
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;
}