UNPKG

datastore-core

Version:
31 lines 1.49 kB
import { Key } from 'interface-datastore'; import { BaseDatastore } from './base.js'; import type { Shard } from './index.js'; import type { Batch, KeyQuery, Pair, Query, Datastore } from 'interface-datastore'; import type { AbortOptions, AwaitIterable } from 'interface-store'; /** * Backend independent abstraction of go-ds-flatfs. * * Wraps another datastore such that all values are stored * sharded according to the given sharding function. */ export declare class ShardingDatastore extends BaseDatastore { private readonly child; private shard; constructor(store: Datastore, shard: Shard); open(): Promise<void>; _convertKey(key: Key): Key; _invertKey(key: Key): Key; static create(store: Datastore, shard?: Shard): Promise<Shard>; put(key: Key, val: Uint8Array, options?: AbortOptions): Promise<Key>; get(key: Key, options?: AbortOptions): Promise<Uint8Array>; has(key: Key, options?: AbortOptions): Promise<boolean>; delete(key: Key, options?: AbortOptions): Promise<void>; putMany(source: AwaitIterable<Pair>, options?: AbortOptions): AsyncIterable<Key>; getMany(source: AwaitIterable<Key>, options?: AbortOptions): AsyncIterable<Pair>; deleteMany(source: AwaitIterable<Key>, options?: AbortOptions): AsyncIterable<Key>; batch(): Batch; query(q: Query, options?: AbortOptions): AsyncIterable<Pair>; queryKeys(q: KeyQuery, options?: AbortOptions): AsyncIterable<Key>; } //# sourceMappingURL=sharding.d.ts.map