/// import { LocalDataFile } from './LocalDataFile'; import { LocalFileSourceNode } from '../types'; import { Stats as FSStats } from 'fs'; /** * Represents a data file on the node platform. */ export declare class LocalDataFileNode extends LocalDataFile { /** * Utility function to wrap a file as a [[DataFile]] for this platform. * @param source - The file to wrap */ static fromSource(source: LocalFileSourceNode): Promise; /** * Node file handle returned by the `fs.open` function */ private handle; /** * File stats for the wrapped file, used to obtain the byte length of the file during slicing */ private stats; /** * @param handle - A node file handle * @param stats - Stats for the file the handle points at */ constructor(handle: number, stats: FSStats); /** * The total length, in bytes, of the file this instance represents. */ get byteLength(): Promise; /** * Closes the local file handle for the current platform. After this function is called all subsequent operations * on this file, or any other data sources depending on this file, will fail. */ close(): void; /** * 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 */ loadData(start?: number, end?: number): Promise; /** * Loads data into a buffer with the specified parameters. * @param buffer - The buffer in which the data will be loaded. It must be large enough to fit the data requested * @param offset - The byte offset within the buffer at which the data will be written * @param start - The byte offset within the file where data will be read * @param end - The byte offset within the file at which the data will stop being read */ private loadDataIntoBuffer; }