UNPKG

@e280/quay

Version:

File-browser and outliner UI for the web

23 lines (22 loc) 888 B
import { Cask } from "./cask.js"; import { Forklift } from "./forklift.js"; /** * Cellar is an immutable content-addressable file store * - files are identified by their hashes (duplicates are impossible) * - files cannot be modified (delete it and save another) * - no filenames or metadata (store those somewhere else) * - pass in a forklift, which is the backend that actually stores the data * - MemoryForklift is the default * - OpfsForklift is probably what you really want in the browser */ export declare class Cellar { private forklift; static opfs(dirname?: string): Promise<Cellar>; constructor(forklift?: Forklift); list(): AsyncIterable<string>; has(hash: string): Promise<boolean>; save(bytes: Uint8Array): Promise<Cask>; load(hash: string): Promise<Cask>; delete(hash: string): Promise<void>; clear(): Promise<void>; }