UNPKG

blockstore-core

Version:

Contains various implementations of the API contract described in interface-blockstore

22 lines 1.29 kB
import { BaseBlockstore } from './base.ts'; import type { AbortOptions } from 'abort-error'; import type { Blockstore, InputPair, Pair } from 'interface-blockstore'; import type { CID } from 'multiformats/cid'; /** * A blockstore that can combine multiple stores. Puts and deletes * will write through to all blockstores. Has and get will * try each store sequentially. getAll will use every store but also * deduplicate any yielded pairs. */ export declare class TieredBlockstore extends BaseBlockstore { private readonly stores; constructor(stores: Blockstore[]); put(key: CID, value: Uint8Array | Iterable<Uint8Array> | AsyncIterable<Uint8Array>, options?: AbortOptions): Promise<CID>; get(key: CID, options?: AbortOptions): Generator<Uint8Array> | AsyncGenerator<Uint8Array>; has(key: CID, options?: AbortOptions): Promise<boolean>; delete(key: CID, options?: AbortOptions): Promise<void>; putMany(source: Iterable<InputPair> | AsyncIterable<InputPair>, options?: AbortOptions): Generator<CID> | AsyncGenerator<CID>; deleteMany(source: Iterable<CID> | AsyncIterable<CID>, options?: AbortOptions): Generator<CID> | AsyncGenerator<CID>; getAll(options?: AbortOptions): Generator<Pair> | AsyncGenerator<Pair>; } //# sourceMappingURL=tiered.d.ts.map