Luxar Viewer API Documentation - v2026.9.22
    Preparing search index...

    Interface FakeOpfsRoot

    What createFakeOpfsRoot returns.

    interface FakeOpfsRoot {
        root: FileSystemDirectoryHandle & {
            getDirectoryHandle: Mock<Procedure | Constructable>;
        };
        luxarDir: FileSystemDirectoryHandle & {
            getDirectoryHandle: Mock<Procedure | Constructable>;
            removeEntry: Mock<Procedure | Constructable>;
        };
        datasetDir: FakeOpfsDatasetDir;
        files: Map<string, Uint8Array<ArrayBufferLike>>;
        metaFiles: Map<string, string>;
        datasetIds: string[];
        storage: {
            getDirectory: () => Promise<FileSystemDirectoryHandle>;
            estimate: () => Promise<any>;
        };
        install(
            overrides?: { datasetDir?: unknown; estimate?: () => Promise<any> },
        ): FakeOpfsRoot;
    }
    Index
    root: FileSystemDirectoryHandle & {
        getDirectoryHandle: Mock<Procedure | Constructable>;
    }

    The origin's OPFS root — accepts ONLY the luxar/ namespace dir.

    luxarDir: FileSystemDirectoryHandle & {
        getDirectoryHandle: Mock<Procedure | Constructable>;
        removeEntry: Mock<Procedure | Constructable>;
    }

    The luxar/ namespace directory (dataset dirs are children of this).

    datasetDir: FakeOpfsDatasetDir

    The dataset directory every zarr-cache-* id resolves to (see notes).

    files: Map<string, Uint8Array<ArrayBufferLike>>

    Chunk bytes by file name (bucket dirs collapse, names are unique per key).

    metaFiles: Map<string, string>

    String files (_cache_meta.json, the write probe) by file name.

    datasetIds: string[]

    Every dataset id requested from the namespace dir, in call order.

    storage: {
        getDirectory: () => Promise<FileSystemDirectoryHandle>;
        estimate: () => Promise<any>;
    }

    navigator.storage replacement (getDirectory resolves to root).

    • vi.stubGlobal('navigator', { storage }). Overrides swap the dataset dir (a test's instrumented handle) and/or the quota estimate while keeping the same root → luxar/ → dataset chain.

      Parameters

      • Optionaloverrides: { datasetDir?: unknown; estimate?: () => Promise<any> }

      Returns FakeOpfsRoot