UNPKG

1.65 kBTypeScriptView Raw
1/// <reference types="node" />
2/// <reference types="node" />
3import { Readable, ReadableOptions, Writable, WritableOptions } from "stream";
4export declare class ReadAfterDestroyedError extends Error {
5}
6export declare class ReadAfterReleasedError extends Error {
7}
8export interface ReadStreamOptions {
9 highWaterMark?: ReadableOptions["highWaterMark"];
10 encoding?: ReadableOptions["encoding"];
11}
12export declare class ReadStream extends Readable {
13 private _pos;
14 private _writeStream;
15 constructor(writeStream: WriteStream, options?: ReadStreamOptions);
16 _read(n: number): void;
17}
18export interface WriteStreamOptions {
19 highWaterMark?: WritableOptions["highWaterMark"];
20 defaultEncoding?: WritableOptions["defaultEncoding"];
21 tmpdir?: () => string;
22}
23export declare class WriteStream extends Writable {
24 private _fd;
25 private _path;
26 private _pos;
27 private _readStreams;
28 private _released;
29 constructor(options?: WriteStreamOptions);
30 _cleanup: (callback: (error: null | Error) => void) => void;
31 _cleanupSync: () => void;
32 _final(callback: (error?: null | Error) => any): void;
33 _write(chunk: Buffer, encoding: string, callback: (error?: null | Error) => any): void;
34 release(): void;
35 _destroy(error: undefined | null | Error, callback: (error?: null | Error) => any): void;
36 createReadStream(options?: ReadStreamOptions): ReadStream;
37}
38declare const _default: {
39 WriteStream: typeof WriteStream;
40 ReadStream: typeof ReadStream;
41 ReadAfterDestroyedError: typeof ReadAfterDestroyedError;
42 ReadAfterReleasedError: typeof ReadAfterReleasedError;
43};
44export default _default;