123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- import {Stream} from 'stream';
- declare class MaxBufferErrorClass extends Error {
- readonly name: 'MaxBufferError';
- constructor();
- }
- declare namespace getStream {
- interface Options {
-
- readonly maxBuffer?: number;
- }
- interface OptionsWithEncoding<EncodingType = BufferEncoding> extends Options {
-
- readonly encoding?: EncodingType;
- }
- type MaxBufferError = MaxBufferErrorClass;
- }
- declare const getStream: {
-
- (stream: Stream, options?: getStream.OptionsWithEncoding): Promise<string>;
-
- buffer(
- stream: Stream,
- options?: getStream.OptionsWithEncoding
- ): Promise<Buffer>;
-
- array<StreamObjectModeType>(
- stream: Stream,
- options?: getStream.Options
- ): Promise<StreamObjectModeType[]>;
- array(
- stream: Stream,
- options: getStream.OptionsWithEncoding<'buffer'>
- ): Promise<Buffer[]>;
- array(
- stream: Stream,
- options: getStream.OptionsWithEncoding<BufferEncoding>
- ): Promise<string[]>;
- MaxBufferError: typeof MaxBufferErrorClass;
-
- default: typeof getStream;
- };
- export = getStream;
|