hackpro-sdk
Version:
44 lines (43 loc) • 2.04 kB
TypeScript
/// <reference types="node" />
import { Writable } from 'readable-stream';
import { SourceDestination } from '../source-destination/source-destination';
import { SparseStreamChunk } from './shared';
export interface SparseWritable extends NodeJS.WritableStream {
_write(chunk: SparseStreamChunk, encoding: string, callback: (err?: Error | void) => void): void;
}
export declare class SparseWriteStream extends Writable implements SparseWritable {
private destination;
firstBytesToKeep: number;
private maxRetries;
position: number;
bytesWritten: number;
private _firstChunks;
constructor(destination: SourceDestination, firstBytesToKeep?: number, maxRetries?: number);
private writeChunk;
private __write;
_write(chunk: SparseStreamChunk, _enc: string, callback: (error: Error | undefined) => void): void;
private __final;
/**
* @summary Write buffered data before a stream ends, called by stream internals
*/
_final(callback: (error?: Error | void) => void): void;
}
export declare const ProgressSparseWriteStream: {
new (...args: any[]): {
_attributeValue: number;
_attributeDelta: number;
addListener(event: string | symbol, listener: Function): any;
on(event: string | symbol, listener: Function): any;
once(event: string | symbol, listener: Function): any;
prependListener(event: string | symbol, listener: Function): any;
prependOnceListener(event: string | symbol, listener: Function): any;
removeListener(event: string | symbol, listener: Function): any;
removeAllListeners(event?: string | symbol | undefined): any;
setMaxListeners(n: number): any;
getMaxListeners(): number;
listeners(event: string | symbol): Function[];
emit(event: string | symbol, ...args: any[]): boolean;
eventNames(): (string | symbol)[];
listenerCount(type: string | symbol): number;
};
} & typeof SparseWriteStream;