mirror of
https://github.com/denoland/deno.git
synced 2025-01-03 12:58:54 -05:00
fix(cli/js/process): Fix conditional types for process sockets (#6275)
This commit is contained in:
parent
affba80454
commit
d77a55a973
2 changed files with 18 additions and 6 deletions
12
cli/js/lib.deno.ns.d.ts
vendored
12
cli/js/lib.deno.ns.d.ts
vendored
|
@ -1779,9 +1779,15 @@ declare namespace Deno {
|
|||
export class Process<T extends RunOptions = RunOptions> {
|
||||
readonly rid: number;
|
||||
readonly pid: number;
|
||||
readonly stdin: T["stdin"] extends "piped" ? Writer & Closer : null;
|
||||
readonly stdout: T["stdout"] extends "piped" ? Reader & Closer : null;
|
||||
readonly stderr: T["stderr"] extends "piped" ? Reader & Closer : null;
|
||||
readonly stdin: T["stdin"] extends "piped"
|
||||
? Writer & Closer
|
||||
: (Writer & Closer) | null;
|
||||
readonly stdout: T["stdout"] extends "piped"
|
||||
? Reader & Closer
|
||||
: (Writer & Closer) | null;
|
||||
readonly stderr: T["stderr"] extends "piped"
|
||||
? Reader & Closer
|
||||
: (Writer & Closer) | null;
|
||||
/** Resolves to the current status of the process. */
|
||||
status(): Promise<ProcessStatus>;
|
||||
/** Buffer the stdout until EOF and return it as `Uint8Array`.
|
||||
|
|
|
@ -32,9 +32,15 @@ async function runStatus(rid: number): Promise<ProcessStatus> {
|
|||
export class Process<T extends RunOptions = RunOptions> {
|
||||
readonly rid: number;
|
||||
readonly pid: number;
|
||||
readonly stdin!: T["stdin"] extends "piped" ? Writer & Closer : null;
|
||||
readonly stdout!: T["stdout"] extends "piped" ? Reader & Closer : null;
|
||||
readonly stderr!: T["stderr"] extends "piped" ? Reader & Closer : null;
|
||||
readonly stdin!: T["stdin"] extends "piped"
|
||||
? Writer & Closer
|
||||
: (Writer & Closer) | null;
|
||||
readonly stdout!: T["stdout"] extends "piped"
|
||||
? Reader & Closer
|
||||
: (Writer & Closer) | null;
|
||||
readonly stderr!: T["stderr"] extends "piped"
|
||||
? Reader & Closer
|
||||
: (Writer & Closer) | null;
|
||||
|
||||
// @internal
|
||||
constructor(res: RunResponse) {
|
||||
|
|
Loading…
Reference in a new issue