import { DocometPath } from './docomet-path.js'; import { DocometInspectableObjectClass } from '../docomet-inspectable.js'; import type { Readable } from 'node:stream'; /** * File * @see {@link DocometEncoding} * @see {@link DocometPath} * @see {@link DocometStream} */ export declare class DocometFile extends DocometInspectableObjectClass { #private; /** * Detects encoding of file * @param path File path * @returns Detected encoding */ static detectEncodingAsync(path: string): Promise; /** * Creates `DocometFile` instance * @param args Arguments for constructor * @returns `DocometFile` instance */ static new(...args: ConstructorParameters): DocometFile; /** * Absolute path */ get absolutePath(): string; /** * Path object */ get path(): DocometPath; /** * Creates `DocometFile` instance * @param path File path */ constructor(path: string); /** * Reads lines from file * @param size Number of bytes to read * @returns Async generator of lines */ readLineAsync(size?: number): AsyncGenerator; /** * Reads all lines from file * @param size Number of bytes to read * @returns Array of lines */ readLinesAsync(size?: number): Promise; /** * Reads file content asynchronously * @returns File content */ readAsync(): Promise; /** * Reads file content synchronously * @returns File content */ read(): string; /** * Writes data to file asynchronously * @param data Data to write */ writeAsync(data: string | Uint8Array | Readable): Promise; /** * Converts to string * @returns String representation */ toString(): string; /** * Converts to JSON object * @returns JSON representation */ toJSON(): string; }