- Add GETTING_STARTED.md with quick start guide and development modes - Add INSTALL.sh automated installation script - Add INSTALLATION_CHECKLIST.md, INSTALLATION_SUCCESS.md, and INSTALLATION_SUMMARY.md - Add QUICK_REFERENCE.md for common commands - Add SETUP_GUIDE.md with detailed setup instructions - Update README.md with improved project overview - Add did-wallet app dependencies and node_modules
39 lines
1.4 KiB
TypeScript
39 lines
1.4 KiB
TypeScript
/* eslint-disable @typescript-eslint/ban-types */
|
|
// this ignore is so we can use {} as the default value for the options
|
|
// extensions below - it normally means "any non-nullish value" but here
|
|
// we are using it as an intersection type - see the aside at the bottom:
|
|
// https://github.com/typescript-eslint/typescript-eslint/issues/2063#issuecomment-675156492
|
|
|
|
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>
|
|
}
|