UNPKG

ipull

Version:

The only file downloader you'll ever need. For node.js and the browser, CLI and library for fast and reliable file downloads.

23 lines (22 loc) 710 B
import { WriteCallback } from "../base-download-engine-fetch-stream.js"; export type SmartChunkSplitOptions = { chunkSize: number; startChunk: number; endChunk: number; lastChunkEndsFile: boolean; totalSize: number; }; export default class SmartChunkSplit { private readonly _callback; private readonly _options; private readonly _lastChunkSize; private _bytesWriteLocation; private _chunks; private _closed; constructor(_callback: WriteCallback, _options: SmartChunkSplitOptions); calcLastChunkSize(): number; addChunk(data: Uint8Array): void; get savedLength(): number; closeAndSendLeftoversIfLengthIsUnknown(): void; private _sendChunk; }