import { Volume } from "memfs"; import { makeFsModule, type FsImplementation } from "./fs.js"; export declare const STRING_ENCODINGS: readonly ["utf8", "utf-8", "utf16le", "utf-16le", "ucs2", "ucs-2", "latin1", "binary", "ascii", "base64", "base64url", "hex"]; type StringEncoding = (typeof STRING_ENCODINGS)[number]; export declare function encode(text: string, encoding: StringEncoding): string; export type FsCaseDriver = Omit, "constants" | "mkdir" | "rmdir"> & { mkdir(path: string, options?: { recursive?: boolean; mode?: number; }): Promise; rmdir(path: string, options?: { recursive?: boolean; }): Promise; }; type ObservedFailure = { readonly name: string; readonly message: string; readonly code: string; readonly path?: string; }; type Observed = { readonly result: unknown; } | ObservedFailure; export type RecordedTruth = { readonly result: unknown; } | (ObservedFailure & { readonly errno: number; readonly syscall: string; readonly dest?: string; }); export type RecordedCase = { readonly title: string; readonly resolved: boolean; readonly node: RecordedTruth; readonly gap?: string; }; export type RecordedPlatform = { readonly nodeVersion: string; readonly cases: readonly RecordedCase[]; }; export type NodeTruthFixture = { readonly platforms: Readonly>; }; export declare const HANGS = "hangs"; export type FsConformanceCase = { readonly title: string; readonly setup?: (volume: Volume) => void; readonly invoke: (fs: FsCaseDriver) => Promise; readonly node: RecordedTruth; readonly gap?: { readonly reason: string; readonly memfs: Observed | typeof HANGS; }; readonly readsAnswer?: true; }; export declare function readSystemError(code: string): { errno: number; description: string; }; export declare function systemErrorMessage(code: string, syscall: string, path?: string, dest?: string): string; export declare function createNodeTruthFs(truth: RecordedTruth): FsImplementation; export declare function readRecordedOutcome(operation: Promise): Promise; export declare function readObserved(operation: Promise): Promise; export declare function toObserved(truth: RecordedTruth): Observed; export declare function toRecordedObserved(entry: RecordedCase): Observed; export declare function driveCase(testCase: FsConformanceCase): { fs: FsCaseDriver; reference: FsCaseDriver; volume: Volume; }; export declare const CASE_ROOT = "/repo"; export declare const CASE_VOLUME: Readonly>; type SystemErrorCase = { readonly title: string; readonly syscall: string; readonly code: string; readonly path?: string; readonly dest?: string; readonly setup?: (volume: Volume) => void; readonly invoke: (fs: FsCaseDriver) => Promise; readonly gap?: FsConformanceCase["gap"]; }; export declare function systemErrorTruth(entry: { readonly code: string; readonly syscall: string; readonly path?: string; readonly dest?: string; }): RecordedTruth; export declare function toConformanceCase(entry: SystemErrorCase): FsConformanceCase; export declare const SYSTEM_ERROR_CASES: readonly SystemErrorCase[]; export declare const MKDIR_RM_RMDIR_CASES: readonly FsConformanceCase[]; export declare const WRITE_CASES: readonly FsConformanceCase[]; export declare const stageLoop: (volume: Volume) => void; export declare const LOOP_HANGS = "memfs recurses through the cycle instead of answering ELOOP"; export declare const SYMLINK_CASES: readonly FsConformanceCase[]; export declare const COPY_RENAME_CASES: readonly FsConformanceCase[]; export declare const READ_AND_SHAPE_CASES: readonly FsConformanceCase[]; export declare const FS_CONFORMANCE_CASES: readonly FsConformanceCase[]; export {};