mirror of
https://github.com/denoland/deno.git
synced 2025-09-27 12:49:10 +00:00
fix(cli/js/process): Strengthen socket types based on pipes (#4836)
This commit is contained in:
parent
54742d29dc
commit
b3e189ee4f
9 changed files with 61 additions and 54 deletions
10
cli/js/lib.deno.ns.d.ts
vendored
10
cli/js/lib.deno.ns.d.ts
vendored
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue