OpenFairyGUI API
    Preparing search index...

    Interface BackendFileSystem

    interface BackendFileSystem {
        acquireSessionLock(lockPath: string): Promise<BackendSessionLock>;
        dirname(filePath: string): string;
        getSessionLockPath?(canonicalProjectPath: string): string;
        join(...paths: string[]): string;
        mkdir(dirPath: string, options?: { recursive?: boolean }): Promise<void>;
        readdir(dirPath: string): Promise<string[]>;
        readFile(filePath: string): Promise<string>;
        readFileRaw(filePath: string): Promise<Uint8Array<ArrayBufferLike>>;
        resolve(...paths: string[]): string;
        resolvePath(filePath: string): Promise<string>;
        rmdir(dirPath: string): Promise<void>;
        runProjectWriteTransaction?(
            projectRoot: string,
            write: (stagedFileSystem: BackendFileSystem) => Promise<void>,
        ): Promise<void>;
        stat(filePath: string): Promise<BackendFileStat>;
        unlink(filePath: string): Promise<void>;
        validateProjectRoot?(projectRoot: string): Promise<void>;
        writeFile(filePath: string, content: string): Promise<void>;
        writeFileRaw(filePath: string, data: Uint8Array): Promise<void>;
    }
    Index
    • Optional host-specific lock location. Node keeps it beside the project so directory swaps do not move it.

      Parameters

      • canonicalProjectPath: string

      Returns string

    • Stages project writes. On failure, throw ProjectWriteTransactionError to report rollback and recovery paths.

      Parameters

      Returns Promise<void>

    • Optional host validation before a project is read. Node rejects links anywhere in the project tree.

      Parameters

      • projectRoot: string

      Returns Promise<void>