OpenFairyGUI API
    Preparing search index...

    Interface FileSystem

    Platform-neutral project filesystem contract shared by project and binary I/O.

    Host-specific adapters live in node-io.ts and web-io.ts.

    interface FileSystem {
        dirname(path: string): string;
        exists(path: string): Promise<boolean>;
        join(...paths: string[]): string;
        mkdir(path: string): Promise<void>;
        readdir(path: string): Promise<string[]>;
        readFile(path: string): Promise<string>;
        readFileRaw(path: string): Promise<Uint8Array<ArrayBufferLike>>;
        resolvePath?(path: string): string | Promise<string>;
        rmdir?(path: string): Promise<void>;
        stat?(path: string): Promise<{ isDirectory(): boolean }>;
        unlink?(path: string): Promise<void>;
        writeFile(path: string, content: string): Promise<void>;
        writeFileRaw(path: string, data: Uint8Array): Promise<void>;
    }
    Index
    • Canonical spelling of an existing path, used to protect live files during stale-source cleanup.

      Parameters

      • path: string

      Returns string | Promise<string>

    • Removes an empty directory when the adapter supports resource-folder cleanup.

      Parameters

      • path: string

      Returns Promise<void>

    • Optional directory probe; without it, mixed readdir entries must reject file enumeration with ENOTDIR or TypeMismatchError.

      Parameters

      • path: string

      Returns Promise<{ isDirectory(): boolean }>

    • Removes a file when the adapter supports project-source cleanup.

      Parameters

      • path: string

      Returns Promise<void>