diff options
author | Nayeem Rahman <nayeemrmn99@gmail.com> | 2020-06-09 12:18:18 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-09 13:18:18 +0200 |
commit | b3e189ee4f97a9d6c5b7a2164d644aa4c7fa4b79 (patch) | |
tree | 31b8f4f39e730ed017889671f87dd19ad714caac /cli/js/lib.deno.ns.d.ts | |
parent | 54742d29dce4230c36db28fb2306589b8e57d3d9 (diff) |
fix(cli/js/process): Strengthen socket types based on pipes (#4836)
Diffstat (limited to 'cli/js/lib.deno.ns.d.ts')
-rw-r--r-- | cli/js/lib.deno.ns.d.ts | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/cli/js/lib.deno.ns.d.ts b/cli/js/lib.deno.ns.d.ts index 63e9b342e..c79007ebd 100644 --- a/cli/js/lib.deno.ns.d.ts +++ b/cli/js/lib.deno.ns.d.ts @@ -1741,12 +1741,12 @@ declare namespace Deno { options?: { recursive: boolean } ): AsyncIterableIterator<FsEvent>; - export class Process { + export class Process<T extends RunOptions = RunOptions> { readonly rid: number; readonly pid: number; - readonly stdin?: Writer & Closer; - readonly stdout?: Reader & Closer; - readonly stderr?: Reader & Closer; + 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; /** Resolves to the current status of the process. */ status(): Promise<ProcessStatus>; /** Buffer the stdout until EOF and return it as `Uint8Array`. @@ -1829,7 +1829,7 @@ declare namespace Deno { * Details of the spawned process are returned. * * Requires `allow-run` permission. */ - export function run(opt: RunOptions): Process; + export function run<T extends RunOptions = RunOptions>(opt: T): Process<T>; interface InspectOptions { depth?: number; |