1 | import { Readable } from 'stream';
|
2 | import { StreamableFileOptions, StreamableHandlerResponse } from './interfaces';
|
3 | import { Logger } from '../services';
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 | export declare class StreamableFile {
|
10 | readonly options: StreamableFileOptions;
|
11 | private readonly stream;
|
12 | protected logger: Logger;
|
13 | protected handleError: (err: Error, response: StreamableHandlerResponse) => void;
|
14 | protected logError: (err: Error) => void;
|
15 | constructor(buffer: Uint8Array, options?: StreamableFileOptions);
|
16 | constructor(readable: Readable, options?: StreamableFileOptions);
|
17 | getStream(): Readable;
|
18 | getHeaders(): {
|
19 | type: string;
|
20 | disposition: string;
|
21 | length: number;
|
22 | };
|
23 | get errorHandler(): (err: Error, response: StreamableHandlerResponse) => void;
|
24 | setErrorHandler(handler: (err: Error, response: StreamableHandlerResponse) => void): this;
|
25 | get errorLogger(): (err: Error) => void;
|
26 | setErrorLogger(handler: (err: Error) => void): this;
|
27 | }
|