21 lines
1.1 KiB
TypeScript
21 lines
1.1 KiB
TypeScript
|
|
import type { AbortOptions, AwaitIterable, Store } from 'interface-store';
|
||
|
|
import type { CID } from 'multiformats/cid';
|
||
|
|
export interface Pair {
|
||
|
|
cid: CID;
|
||
|
|
block: Uint8Array;
|
||
|
|
}
|
||
|
|
export interface Blockstore<HasOptionsExtension = {}, PutOptionsExtension = {}, PutManyOptionsExtension = {}, GetOptionsExtension = {}, GetManyOptionsExtension = {}, GetAllOptionsExtension = {}, DeleteOptionsExtension = {}, DeleteManyOptionsExtension = {}> extends Store<CID, Uint8Array, Pair, HasOptionsExtension, PutOptionsExtension, PutManyOptionsExtension, GetOptionsExtension, GetManyOptionsExtension, DeleteOptionsExtension, DeleteManyOptionsExtension> {
|
||
|
|
/**
|
||
|
|
* Retrieve all cid/block pairs from the blockstore as an unordered iterable
|
||
|
|
*
|
||
|
|
* @example
|
||
|
|
* ```js
|
||
|
|
* for await (const { multihash, block } of store.getAll()) {
|
||
|
|
* console.log('got:', multihash, block)
|
||
|
|
* // => got MultihashDigest('Qmfoo') Uint8Array[...]
|
||
|
|
* }
|
||
|
|
* ```
|
||
|
|
*/
|
||
|
|
getAll: (options?: AbortOptions & GetAllOptionsExtension) => AwaitIterable<Pair>;
|
||
|
|
}
|
||
|
|
//# sourceMappingURL=index.d.ts.map
|