Skip to content

Commit

Permalink
refactor: use @std/io/types (#279)
Browse files Browse the repository at this point in the history
  • Loading branch information
iuioiua authored Dec 6, 2024
1 parent fd3324f commit 0c74c13
Showing 1 changed file with 2 additions and 25 deletions.
27 changes: 2 additions & 25 deletions src/pipes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,15 @@ import type { CommandBuilder, KillSignal } from "./command.ts";
import { abortSignalToPromise } from "./common.ts";
import { logger } from "./console/logger.ts";
import type { RequestBuilder } from "./request.ts";
import type { Closer, Reader, ReaderSync, Writer, WriterSync } from "@std/io/types";
export type { Closer, Reader, ReaderSync, Writer, WriterSync };

const encoder = new TextEncoder();

/** `Deno.Reader` stream. */
export interface Reader {
read(p: Uint8Array): Promise<number | null>;
}

/** `Deno.ReaderSync` stream. */
export interface ReaderSync {
readSync(p: Uint8Array): number | null;
}

/** `Deno.WriterSync` stream. */
export interface WriterSync {
writeSync(p: Uint8Array): number;
}

/** `Deno.Writer` stream. */
export interface Writer {
write(p: Uint8Array): Promise<number>;
}

export type PipeReader = Reader | ReaderSync;

export type PipeWriter = Writer | WriterSync;

/** `Deno.Closer` */
export interface Closer {
close(): void;
}

/** Behaviour to use for stdin.
* @value "inherit" - Sends the stdin of the process to the shell (default).
* @value "null" - Does not pipe or redirect the pipe.
Expand Down

0 comments on commit 0c74c13

Please sign in to comment.