/// /// /// /// /// import type { BigIntStats, ReadStream, StatOptions, Stats, WriteStream, WriteVResult } from 'fs'; import type { CreateReadStreamOptions, CreateWriteStreamOptions, FakeFS } from '../FakeFS'; import type { Path } from '../path'; interface ObjectEncodingOptions { encoding?: BufferEncoding | null | undefined; } interface FlagAndOpenMode { mode?: Mode | undefined; flag?: OpenMode | undefined; } type OpenMode = number | string; type Mode = number | string; interface FileReadResult { bytesRead: number; buffer: T; } interface FileReadOptions { buffer?: T; offset?: number | null; length?: number | null; position?: number | null; } interface ReadVResult { bytesRead: number; buffers: Array; } interface AbortSignal { readonly aborted: boolean; } interface Abortable { signal?: AbortSignal | undefined; } type WriteArgsBuffer = [ buffer: TBuffer, offset?: number | null, length?: number | null, position?: number | null ]; type WriteArgsString = [ data: string, position?: number | null, encoding?: BufferEncoding | null ]; declare const kBaseFs: unique symbol; declare const kFd: unique symbol; declare const kClosePromise: unique symbol; declare const kCloseResolve: unique symbol; declare const kCloseReject: unique symbol; declare const kRefs: unique symbol; declare const kRef: unique symbol; declare const kUnref: unique symbol; export declare class FileHandle

{ [kBaseFs]: FakeFS

; [kFd]: number; [kRefs]: number; [kClosePromise]: Promise | undefined; [kCloseResolve]: (() => void) | undefined; [kCloseReject]: (() => void) | undefined; constructor(fd: number, baseFs: FakeFS

); get fd(): number; appendFile(data: string | Uint8Array, options?: (ObjectEncodingOptions & FlagAndOpenMode) | BufferEncoding | null): Promise; chown(uid: number, gid: number): Promise; chmod(mode: number): Promise; createReadStream(options?: CreateReadStreamOptions): ReadStream; createWriteStream(options?: CreateWriteStreamOptions): WriteStream; datasync(): Promise; sync(): Promise; read(options?: FileReadOptions): Promise>; read(buffer: Buffer, offset?: number | null, length?: number | null, position?: number | null): Promise>; readFile(options?: { encoding?: null | undefined; flag?: OpenMode | undefined; } | null): Promise; readFile(options: { encoding: BufferEncoding; flag?: OpenMode | undefined; } | BufferEncoding): Promise; readLines(options?: CreateReadStreamOptions): import("readline").Interface; stat(opts?: StatOptions & { bigint?: false | undefined; }): Promise; stat(opts: StatOptions & { bigint: true; }): Promise; truncate(len?: number): Promise; utimes(atime: string | number | Date, mtime: string | number | Date): Promise; writeFile(data: string | Uint8Array, options?: (ObjectEncodingOptions & FlagAndOpenMode & Abortable) | BufferEncoding | null): Promise; write(...args: WriteArgsString): Promise<{ bytesWritten: number; buffer: string; }>; write(...args: WriteArgsBuffer): Promise<{ bytesWritten: number; buffer: TBuffer; }>; writev(buffers: Array, position?: number): Promise; readv(buffers: ReadonlyArray, position?: number): Promise; close(): Promise; [kRef](caller: Function): void; [kUnref](): void; } export {};