IFClite TypeScript API
    Preparing search index...

    Interface BlobStore

    interface BlobStore {
        delete(hash: string): Promise<boolean>;
        get(hash: string): Promise<Uint8Array<ArrayBufferLike> | null>;
        has(hash: string): Promise<boolean>;
        hashBytes?(bytes: Uint8Array): string;
        list(): Promise<string[]>;
        put(
            bytes: Uint8Array,
            contentType?: string,
            options?: BlobPutOptions,
        ): Promise<BlobMeta>;
        stat?(hash: string): Promise<BlobMeta | null>;
    }

    Implemented by

    Index
    • Parameters

      • hash: string

      Returns Promise<boolean>

    • Parameters

      • hash: string

      Returns Promise<Uint8Array<ArrayBufferLike> | null>

    • Parameters

      • hash: string

      Returns Promise<boolean>

    • Recompute this backend's content identity without writing the blob.

      Parameters

      • bytes: Uint8Array

      Returns string

    • List currently-known blob hashes; ordering is implementation-defined.

      Returns Promise<string[]>

    • Parameters

      • bytes: Uint8Array
      • OptionalcontentType: string
      • Optionaloptions: BlobPutOptions

      Returns Promise<BlobMeta>

    • Return the blob's metadata (size, contentType, uploadedAt) without downloading the bytes. Backends that can't cheaply compute this may return null and force callers to fall back to get.

      Parameters

      • hash: string

      Returns Promise<BlobMeta | null>