export declare class BrowserVfsError extends Error {
    readonly code: string;
    constructor(code: string, message: string);
}
export interface WorkspaceFileStat {
    path: string;
    size: number;
    etag: string;
    revision: string;
    updatedAt: string;
    contentType?: string;
}
export interface WorkspaceFileEntry extends WorkspaceFileStat {
    kind: "file";
}
export interface WorkspaceDirectoryEntry {
    kind: "directory";
    path: string;
    size: 0;
    etag: "";
    revision: "";
    updatedAt: string;
}
export type WorkspaceEntry = WorkspaceFileEntry | WorkspaceDirectoryEntry;
export interface WorkspaceWriteOptions {
    contentType?: string;
}
export interface BrowserWorkspaceSnapshotFile {
    path: string;
    contentBase64: string;
    contentType?: string;
    updatedAt: string;
}
export interface BrowserWorkspaceSnapshot {
    version: 1;
    files: BrowserWorkspaceSnapshotFile[];
}
export interface BrowserWorkspaceBackend {
    stat(path: string): Promise<WorkspaceFileStat | null>;
    readFile(path: string): Promise<Uint8Array | null>;
    writeFile(path: string, data: Uint8Array, options?: WorkspaceWriteOptions): Promise<WorkspaceFileStat>;
    deleteFile(path: string): Promise<boolean>;
    listFiles(prefix?: string): Promise<WorkspaceEntry[]>;
    clear(): Promise<void>;
}
export interface BrowserWorkspace {
    readFile(path: string): Promise<Uint8Array | null>;
    readText(path: string): Promise<string | null>;
    writeFile(path: string, data: Uint8Array | string, options?: WorkspaceWriteOptions): Promise<WorkspaceFileStat>;
    deleteFile(path: string): Promise<boolean>;
    stat(path: string): Promise<WorkspaceFileStat | null>;
    listFiles(prefix?: string): Promise<WorkspaceEntry[]>;
    dirtyPaths(): string[];
    markClean(paths?: Iterable<string>): void;
    exportSnapshot(): Promise<Uint8Array>;
    importSnapshot(data: Uint8Array | string, options?: {
        markDirty?: boolean;
    }): Promise<void>;
}
export interface PersistentWorkspaceOptions {
    namespace?: string;
    globalScope?: Pick<typeof globalThis, "indexedDB" | "navigator">;
}
export declare function normalizeWorkspacePath(input: string): string;
export declare function projectWorkspaceRoot(projectId: string): string;
export declare class MemoryWorkspaceBackend implements BrowserWorkspaceBackend {
    private readonly files;
    stat(path: string): Promise<WorkspaceFileStat | null>;
    readFile(path: string): Promise<Uint8Array | null>;
    writeFile(path: string, data: Uint8Array, options?: WorkspaceWriteOptions): Promise<WorkspaceFileStat>;
    deleteFile(path: string): Promise<boolean>;
    listFiles(prefix?: string): Promise<WorkspaceEntry[]>;
    clear(): Promise<void>;
}
export declare class OpfsWorkspaceBackend implements BrowserWorkspaceBackend {
    private readonly root;
    private index;
    private constructor();
    static create(options?: PersistentWorkspaceOptions): Promise<OpfsWorkspaceBackend>;
    private filesDirectory;
    private readIndex;
    private writeIndex;
    private fileName;
    stat(path: string): Promise<WorkspaceFileStat | null>;
    readFile(path: string): Promise<Uint8Array | null>;
    writeFile(path: string, data: Uint8Array, options?: WorkspaceWriteOptions): Promise<WorkspaceFileStat>;
    deleteFile(path: string): Promise<boolean>;
    listFiles(prefix?: string): Promise<WorkspaceEntry[]>;
    clear(): Promise<void>;
}
export declare class IndexedDbWorkspaceBackend implements BrowserWorkspaceBackend {
    private readonly db;
    private constructor();
    static create(options?: PersistentWorkspaceOptions): Promise<IndexedDbWorkspaceBackend>;
    private store;
    stat(path: string): Promise<WorkspaceFileStat | null>;
    readFile(path: string): Promise<Uint8Array | null>;
    writeFile(path: string, data: Uint8Array, options?: WorkspaceWriteOptions): Promise<WorkspaceFileStat>;
    deleteFile(path: string): Promise<boolean>;
    listFiles(prefix?: string): Promise<WorkspaceEntry[]>;
    clear(): Promise<void>;
}
export declare function createPersistentBrowserWorkspaceBackend(options?: PersistentWorkspaceOptions): Promise<BrowserWorkspaceBackend>;
export declare function createPersistentBrowserWorkspace(options?: PersistentWorkspaceOptions): Promise<BrowserWorkspace>;
export declare function createBrowserWorkspace(backend?: BrowserWorkspaceBackend): BrowserWorkspace;
export declare function isOpfsAvailable(globalScope?: Pick<typeof globalThis, "navigator">): boolean;
export declare function isIndexedDbAvailable(globalScope?: Pick<typeof globalThis, "indexedDB">): boolean;
//# sourceMappingURL=index.d.ts.map