diff options
author | Luca Casonato <hello@lcas.dev> | 2022-02-15 13:35:22 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-15 13:35:22 +0100 |
commit | bdc8006a362b4f95107a25ca816dcdedb7f44e4a (patch) | |
tree | 928d7c08e1d16302af03404f37ce84b8d39e4a40 /cli/dts/lib.deno.ns.d.ts | |
parent | 7b893bd57f2f013c4a11e1e9f0ba435a3cfc96c0 (diff) |
feat(runtime): web streams in fs & net APIs (#13615)
This commit adds `readable` and `writable` properties to `Deno.File` and
`Deno.Conn`. This makes it very simple to use files and network sockets
with fetch or the native HTTP server.
Diffstat (limited to 'cli/dts/lib.deno.ns.d.ts')
-rw-r--r-- | cli/dts/lib.deno.ns.d.ts | 36 |
1 files changed, 27 insertions, 9 deletions
diff --git a/cli/dts/lib.deno.ns.d.ts b/cli/dts/lib.deno.ns.d.ts index f24e2feca..ff8fbb741 100644 --- a/cli/dts/lib.deno.ns.d.ts +++ b/cli/dts/lib.deno.ns.d.ts @@ -1092,14 +1092,26 @@ declare namespace Deno { stat(): Promise<FileInfo>; statSync(): FileInfo; close(): void; + + readonly readable: ReadableStream<Uint8Array>; + readonly writable: WritableStream<Uint8Array>; } /** A handle for `stdin`. */ - export const stdin: Reader & ReaderSync & Closer & { readonly rid: number }; + export const stdin: Reader & ReaderSync & Closer & { + readonly rid: number; + readonly readable: ReadableStream<Uint8Array>; + }; /** A handle for `stdout`. */ - export const stdout: Writer & WriterSync & Closer & { readonly rid: number }; + export const stdout: Writer & WriterSync & Closer & { + readonly rid: number; + readonly writable: WritableStream<Uint8Array>; + }; /** A handle for `stderr`. */ - export const stderr: Writer & WriterSync & Closer & { readonly rid: number }; + export const stderr: Writer & WriterSync & Closer & { + readonly rid: number; + readonly writable: WritableStream<Uint8Array>; + }; export interface OpenOptions { /** Sets the option for read access. This option, when `true`, means that the @@ -2208,12 +2220,18 @@ declare namespace Deno { export class Process<T extends RunOptions = RunOptions> { readonly rid: number; readonly pid: number; - readonly stdin: T["stdin"] extends "piped" ? Writer & Closer - : (Writer & Closer) | null; - readonly stdout: T["stdout"] extends "piped" ? Reader & Closer - : (Reader & Closer) | null; - readonly stderr: T["stderr"] extends "piped" ? Reader & Closer - : (Reader & Closer) | null; + readonly stdin: T["stdin"] extends "piped" ? Writer & Closer & { + writable: WritableStream<Uint8Array>; + } + : (Writer & Closer & { writable: WritableStream<Uint8Array> }) | null; + readonly stdout: T["stdout"] extends "piped" ? Reader & Closer & { + readable: ReadableStream<Uint8Array>; + } + : (Reader & Closer & { readable: ReadableStream<Uint8Array> }) | null; + readonly stderr: T["stderr"] extends "piped" ? Reader & Closer & { + readable: ReadableStream<Uint8Array>; + } + : (Reader & Closer & { readable: ReadableStream<Uint8Array> }) | null; /** Wait for the process to exit and return its exit status. * * Calling this function multiple times will return the same status. |