| 1 |
/// <reference types="node" resolution-mode="require"/> |
| 2 |
/// <reference types="node" resolution-mode="require"/> |
| 3 |
/// <reference types="node" resolution-mode="require"/> |
| 4 |
import EE from 'events'; |
| 5 |
import { Minipass } from 'minipass'; |
| 6 |
declare const _autoClose: unique symbol; |
| 7 |
declare const _close: unique symbol; |
| 8 |
declare const _ended: unique symbol; |
| 9 |
declare const _fd: unique symbol; |
| 10 |
declare const _finished: unique symbol; |
| 11 |
declare const _flags: unique symbol; |
| 12 |
declare const _flush: unique symbol; |
| 13 |
declare const _handleChunk: unique symbol; |
| 14 |
declare const _makeBuf: unique symbol; |
| 15 |
declare const _mode: unique symbol; |
| 16 |
declare const _needDrain: unique symbol; |
| 17 |
declare const _onerror: unique symbol; |
| 18 |
declare const _onopen: unique symbol; |
| 19 |
declare const _onread: unique symbol; |
| 20 |
declare const _onwrite: unique symbol; |
| 21 |
declare const _open: unique symbol; |
| 22 |
declare const _path: unique symbol; |
| 23 |
declare const _pos: unique symbol; |
| 24 |
declare const _queue: unique symbol; |
| 25 |
declare const _read: unique symbol; |
| 26 |
declare const _readSize: unique symbol; |
| 27 |
declare const _reading: unique symbol; |
| 28 |
declare const _remain: unique symbol; |
| 29 |
declare const _size: unique symbol; |
| 30 |
declare const _write: unique symbol; |
| 31 |
declare const _writing: unique symbol; |
| 32 |
declare const _defaultFlag: unique symbol; |
| 33 |
declare const _errored: unique symbol; |
| 34 |
export type ReadStreamOptions = Minipass.Options<Minipass.ContiguousData> & { |
| 35 |
fd?: number; |
| 36 |
readSize?: number; |
| 37 |
size?: number; |
| 38 |
autoClose?: boolean; |
| 39 |
}; |
| 40 |
export type ReadStreamEvents = Minipass.Events<Minipass.ContiguousData> & { |
| 41 |
open: [fd: number]; |
| 42 |
}; |
| 43 |
export declare class ReadStream extends Minipass<Minipass.ContiguousData, Buffer, ReadStreamEvents> { |
| 44 |
[_errored]: boolean; |
| 45 |
[_fd]?: number; |
| 46 |
[_path]: string; |
| 47 |
[_readSize]: number; |
| 48 |
[_reading]: boolean; |
| 49 |
[_size]: number; |
| 50 |
[_remain]: number; |
| 51 |
[_autoClose]: boolean; |
| 52 |
constructor(path: string, opt: ReadStreamOptions); |
| 53 |
get fd(): number | undefined; |
| 54 |
get path(): string; |
| 55 |
write(): void; |
| 56 |
end(): void; |
| 57 |
[_open](): void; |
| 58 |
[_onopen](er?: NodeJS.ErrnoException | null, fd?: number): void; |
| 59 |
[_makeBuf](): Buffer; |
| 60 |
[_read](): void; |
| 61 |
[_onread](er?: NodeJS.ErrnoException | null, br?: number, buf?: Buffer): void; |
| 62 |
[_close](): void; |
| 63 |
[_onerror](er: NodeJS.ErrnoException): void; |
| 64 |
[_handleChunk](br: number, buf: Buffer): boolean; |
| 65 |
emit<Event extends keyof ReadStreamEvents>(ev: Event, ...args: ReadStreamEvents[Event]): boolean; |
| 66 |
} |
| 67 |
export declare class ReadStreamSync extends ReadStream { |
| 68 |
[_open](): void; |
| 69 |
[_read](): void; |
| 70 |
[_close](): void; |
| 71 |
} |
| 72 |
export type WriteStreamOptions = { |
| 73 |
fd?: number; |
| 74 |
autoClose?: boolean; |
| 75 |
mode?: number; |
| 76 |
captureRejections?: boolean; |
| 77 |
start?: number; |
| 78 |
flags?: string; |
| 79 |
}; |
| 80 |
export declare class WriteStream extends EE { |
| 81 |
readable: false; |
| 82 |
writable: boolean; |
| 83 |
[_errored]: boolean; |
| 84 |
[_writing]: boolean; |
| 85 |
[_ended]: boolean; |
| 86 |
[_queue]: Buffer[]; |
| 87 |
[_needDrain]: boolean; |
| 88 |
[_path]: string; |
| 89 |
[_mode]: number; |
| 90 |
[_autoClose]: boolean; |
| 91 |
[_fd]?: number; |
| 92 |
[_defaultFlag]: boolean; |
| 93 |
[_flags]: string; |
| 94 |
[_finished]: boolean; |
| 95 |
[_pos]?: number; |
| 96 |
constructor(path: string, opt: WriteStreamOptions); |
| 97 |
emit(ev: string, ...args: any[]): boolean; |
| 98 |
get fd(): number | undefined; |
| 99 |
get path(): string; |
| 100 |
[_onerror](er: NodeJS.ErrnoException): void; |
| 101 |
[_open](): void; |
| 102 |
[_onopen](er?: null | NodeJS.ErrnoException, fd?: number): void; |
| 103 |
end(buf: string, enc?: BufferEncoding): this; |
| 104 |
end(buf?: Buffer, enc?: undefined): this; |
| 105 |
write(buf: string, enc?: BufferEncoding): boolean; |
| 106 |
write(buf: Buffer, enc?: undefined): boolean; |
| 107 |
[_write](buf: Buffer): void; |
| 108 |
[_onwrite](er?: null | NodeJS.ErrnoException, bw?: number): void; |
| 109 |
[_flush](): void; |
| 110 |
[_close](): void; |
| 111 |
} |
| 112 |
export declare class WriteStreamSync extends WriteStream { |
| 113 |
[_open](): void; |
| 114 |
[_close](): void; |
| 115 |
[_write](buf: Buffer): void; |
| 116 |
} |
| 117 |
export {}; |
| 118 |
//# sourceMappingURL=index.d.ts.map |