import { DataChunk } from '../../chunk/DataChunk'; import { DataSource } from '../../types'; import { EventEmitter } from '@dekkai/event-emitter'; export declare abstract class RemoteDataFile extends EventEmitter implements DataSource { /** * Fired when data loading progresses. Not fired when data loading finishes. * @event */ static LOADING_START: symbol; /** * Fired when data loading progresses. Not fired when data loading finishes. * @event */ static LOADING_PROGRESS: symbol; /** * Fired when the data loading finishes. * @event */ static LOADING_COMPLETE: symbol; /** * The total length, in bytes, of the file this instance represents. */ abstract get byteLength(): Promise; /** * Bytes loaded for this file, useful when parsing streaming files. */ abstract get bytesLoaded(): number; /** * Promise that resolves when this file has finished downloading from the remote server. */ abstract get onLoadingComplete(): Promise; /** * Has the file finished downloading from the remote server. */ abstract get isLoadingComplete(): boolean; /** * This function must ba called in order to start downloading the file, if this function fail the file cannot be * fetched from the server. */ abstract startDownloading(): Promise; /** * Loads the file into an ArrayBuffer. Optionally a `start` and `end` can be specified to load a part of the file. * @param start - The offset at which the data will start loading * @param end - The offset at which the data will stop loading */ abstract loadData(start?: number, end?: number): Promise; /** * Slices the file and returns a 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): DataChunk; }