refactor: remove combined io interface like ReadCloser (#4944)

This commit removes "combined" interfaces from cli/js/io.ts; in the
like of "ReadCloser", "WriteCloser" in favor of using intersections
of concrete interfaces.
This commit is contained in:
Bartek Iwańczuk 2020-04-28 12:32:43 +02:00 committed by GitHub
parent dea3ca39ba
commit b508e84567
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 9 additions and 40 deletions

View file

@ -495,13 +495,6 @@ declare namespace Deno {
seekSync(offset: number, whence: SeekMode): number;
}
export interface ReadCloser extends Reader, Closer {}
export interface WriteCloser extends Writer, Closer {}
export interface ReadSeeker extends Reader, Seeker {}
export interface WriteSeeker extends Writer, Seeker {}
export interface ReadWriteCloser extends Reader, Writer, Closer {}
export interface ReadWriteSeeker extends Reader, Writer, Seeker {}
/** Copies from `src` to `dst` until either `EOF` is reached on `src` or an
* error occurs. It resolves to the number of bytes copied or rejects with
* the first error encountered while copying.
@ -2195,9 +2188,9 @@ declare namespace Deno {
export class Process {
readonly rid: number;
readonly pid: number;
readonly stdin?: WriteCloser;
readonly stdout?: ReadCloser;
readonly stderr?: ReadCloser;
readonly stdin?: Writer & Closer;
readonly stdout?: Reader & Closer;
readonly stderr?: Reader & Closer;
/** Resolves to the current status of the process. */
status(): Promise<ProcessStatus>;
/** Buffer the stdout and return it as `Uint8Array` after `Deno.EOF`.