import { DataSource } from '../types'; /** * [[DataSource]] that represents a section (chunk) of a larger data source (parent). Useful when chunking a data source to * parallelize processing. */ export declare class DataChunk implements DataSource { /** * The parent data source this chunk belongs to. */ private source; /** * The start of the data, in bytes, this chunk represents within its parent data source. */ private start; /** * The end of the data, in bytes, this chunk represents within its parent data source. */ private end; /** * Variable to store the loaded data for this chunk. */ private _buffer; /** * When this chunk is loaded, returns the buffer containing the data for this chunk, `null` otherwise. */ get buffer(): ArrayBuffer; /** * The total byte length this chunk represents. * * NOTE: This value can change after a chunk is loaded for the first time if the chunk belongs to a remote data * source, if the total size is unknown, the value will be -1. */ get byteLength(): Promise; /** * Is this chunk loaded in memory. */ get loaded(): boolean; /** * @param source - The parent data source for this chunk * @param start - The start of this chunk, in bytes, within the parent data source * @param end - The end of this chunk, in bytes, within the parent data source */ constructor(source: DataSource, start: number, end: number); /** * Loads this chunk into memory. * * NOTE: If this chunk belongs to a remote [[DataSource]], this function waits until the data for this chunk has been * transferred from the remote and into memory. Also, if the final size for the remote [[DataSource]] is unknown, * the [[byteLength]] of this chunk could change after it finishes loading. */ load(): Promise; /** * Unloads this chunk from memory. */ unload(): void; /** * Slices this chunk and returns a new data chunk pointing at the data within the specified boundaries. * @param start - Pointer to the start of the data in bytes * @param end - Pointer to the end of the data in bytes */ slice(start: number, end: number): DataSource; /** * Loads the data source into an ArrayBuffer. Optionally a `start` and `end` can be specified to load a part of the * data. * @param start - The offset at which the data will start loading * @param end - The offset at which the data will stop loading */ loadData(start?: number, end?: number): Promise; }