diff options
-rw-r--r-- | cli/js/lib.deno.ns.d.ts | 12 | ||||
-rw-r--r-- | cli/js/process.ts | 12 |
2 files changed, 18 insertions, 6 deletions
diff --git a/cli/js/lib.deno.ns.d.ts b/cli/js/lib.deno.ns.d.ts index f9438ed9c..f3ee04243 100644 --- a/cli/js/lib.deno.ns.d.ts +++ b/cli/js/lib.deno.ns.d.ts @@ -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`. diff --git a/cli/js/process.ts b/cli/js/process.ts index f318b0c1c..c7c3358f5 100644 --- a/cli/js/process.ts +++ b/cli/js/process.ts @@ -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) { |