datastore-level
Advanced tools
Comparing version 9.0.4 to 10.0.0
@@ -0,75 +1,26 @@ | ||
import { Batch, Key, KeyQuery, Pair, Query } from 'interface-datastore'; | ||
import { BaseDatastore } from 'datastore-core'; | ||
import { Level } from 'level'; | ||
import type { DatabaseOptions, OpenOptions } from 'level'; | ||
/** | ||
* @typedef {import('interface-datastore').Datastore} Datastore | ||
* @typedef {import('interface-datastore').Pair} Pair | ||
* @typedef {import('interface-datastore').Batch} Batch | ||
* @typedef {import('interface-datastore').Query} Query | ||
* @typedef {import('interface-datastore').KeyQuery} KeyQuery | ||
* @typedef {import('interface-datastore').Options} QueryOptions | ||
* @typedef {import('abstract-level').AbstractLevel<any, string, Uint8Array>} LevelDb | ||
*/ | ||
/** | ||
* A datastore backed by leveldb | ||
*/ | ||
export class LevelDatastore extends BaseDatastore { | ||
/** | ||
* @param {string | LevelDb} path | ||
* @param {import('level').DatabaseOptions<string, Uint8Array> & import('level').OpenOptions} [opts] | ||
*/ | ||
constructor(path: string | import("abstract-level/types/abstract-level").AbstractLevel<any, string, Uint8Array>, opts?: (import("classic-level").DatabaseOptions<string, Uint8Array> & import("browser-level").DatabaseOptions<string, Uint8Array> & import("classic-level").OpenOptions & import("abstract-level").AbstractOpenOptions) | undefined); | ||
/** @type {LevelDb} */ | ||
db: import("abstract-level/types/abstract-level").AbstractLevel<any, string, Uint8Array>; | ||
/** @type {import('level').OpenOptions} */ | ||
opts: import('level').OpenOptions; | ||
/** | ||
* @param {Key} key | ||
* @param {Uint8Array} value | ||
*/ | ||
export declare class LevelDatastore extends BaseDatastore { | ||
db: Level<string, Uint8Array>; | ||
private readonly opts; | ||
constructor(path: string | Level<string, Uint8Array>, opts?: DatabaseOptions<string, Uint8Array> & OpenOptions); | ||
open(): Promise<void>; | ||
put(key: Key, value: Uint8Array): Promise<void>; | ||
/** | ||
* @param {Key} key | ||
* @returns {Promise<Uint8Array>} | ||
*/ | ||
get(key: Key): Promise<Uint8Array>; | ||
/** | ||
* @param {Key} key | ||
* @returns {Promise<boolean>} | ||
*/ | ||
has(key: Key): Promise<boolean>; | ||
/** | ||
* @param {Key} key | ||
* @returns {Promise<void>} | ||
*/ | ||
delete(key: Key): Promise<void>; | ||
/** | ||
* @param {Query} q | ||
*/ | ||
query(q: Query): AsyncIterable<import("interface-datastore").Pair>; | ||
/** | ||
* @param {KeyQuery} q | ||
*/ | ||
queryKeys(q: KeyQuery): AsyncGenerator<Key, void, undefined>; | ||
/** | ||
* @param {object} opts | ||
* @param {boolean} opts.values | ||
* @param {string} [opts.prefix] | ||
* @returns {AsyncIterable<Pair>} | ||
*/ | ||
close(): Promise<void>; | ||
batch(): Batch; | ||
query(q: Query): AsyncIterable<Pair>; | ||
queryKeys(q: KeyQuery): AsyncIterable<Key>; | ||
_query(opts: { | ||
values: boolean; | ||
prefix?: string | undefined; | ||
prefix?: string; | ||
}): AsyncIterable<Pair>; | ||
} | ||
export type LevelIterator = { | ||
next: (cb: (err: Error, key: string | Uint8Array | null, value: any) => void) => void; | ||
end: (cb: (err: Error) => void) => void; | ||
}; | ||
export type Datastore = import('interface-datastore').Datastore; | ||
export type Pair = import('interface-datastore').Pair; | ||
export type Batch = import('interface-datastore').Batch; | ||
export type Query = import('interface-datastore').Query; | ||
export type KeyQuery = import('interface-datastore').KeyQuery; | ||
export type QueryOptions = import('interface-datastore').Options; | ||
export type LevelDb = import('abstract-level').AbstractLevel<any, string, Uint8Array>; | ||
import { BaseDatastore } from "datastore-core"; | ||
import { Key } from "interface-datastore"; | ||
//# sourceMappingURL=index.d.ts.map |
{ | ||
"name": "datastore-level", | ||
"version": "9.0.4", | ||
"version": "10.0.0", | ||
"description": "Datastore implementation with level(up|down) backend", | ||
@@ -55,3 +55,3 @@ "author": "Friedel Ziegelmayer<dignifiedquire@gmail.com>", | ||
"types": "./dist/src/index.d.ts", | ||
"import": "./src/index.js" | ||
"import": "./dist/src/index.js" | ||
} | ||
@@ -165,5 +165,4 @@ }, | ||
"dependencies": { | ||
"abstract-level": "^1.0.3", | ||
"datastore-core": "^8.0.1", | ||
"interface-datastore": "^7.0.0", | ||
"datastore-core": "^9.0.1", | ||
"interface-datastore": "^8.0.0", | ||
"it-filter": "^2.0.0", | ||
@@ -176,12 +175,7 @@ "it-map": "^2.0.0", | ||
"devDependencies": { | ||
"@ipld/dag-cbor": "^8.0.0", | ||
"@types/rimraf": "^3.0.2", | ||
"aegir": "^37.5.1", | ||
"interface-datastore-tests": "^3.0.0", | ||
"aegir": "^38.1.7", | ||
"interface-datastore-tests": "^4.0.0", | ||
"ipfs-utils": "^9.0.4", | ||
"level-mem": "^6.0.1", | ||
"memory-level": "^1.0.0", | ||
"multiformats": "^10.0.2", | ||
"rimraf": "^3.0.2" | ||
"memory-level": "^1.0.0" | ||
} | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
138831
7
4
9
890
+ Added@libp2p/interface@1.7.0(transitive)
+ Added@libp2p/logger@4.0.20(transitive)
+ Addeddatastore-core@9.2.9(transitive)
+ Addedinterface-store@5.1.8(transitive)
+ Addedit-all@3.0.6(transitive)
+ Addedit-drain@3.0.7(transitive)
+ Addedit-filter@3.1.1(transitive)
+ Addedit-map@3.1.1(transitive)
+ Addedit-merge@3.0.5(transitive)
+ Addedit-peekable@3.0.5(transitive)
+ Addedit-pipe@3.0.1(transitive)
+ Addedit-sort@3.0.6(transitive)
+ Addedit-stream-types@2.0.2(transitive)
+ Addedit-take@3.0.6(transitive)
+ Addedms@3.0.0-canary.1(transitive)
+ Addedsupports-color@9.4.0(transitive)
+ Addedweald@1.0.4(transitive)
- Removedabstract-level@^1.0.3
- Removed@libp2p/interface-peer-id@2.0.2(transitive)
- Removed@libp2p/logger@2.1.1(transitive)
- Removeddatastore-core@8.0.4(transitive)
- Removeddebug@4.3.7(transitive)
- Removedinterface-datastore@7.0.4(transitive)
- Removedinterface-store@3.0.4(transitive)
- Removedit-drain@2.0.1(transitive)
- Removedit-merge@2.0.1(transitive)
- Removedit-pipe@2.0.5(transitive)
- Removedit-stream-types@1.0.5(transitive)
- Removedms@2.1.3(transitive)
- Removedmultiformats@11.0.212.1.3(transitive)
- Removednanoid@4.0.2(transitive)
- Removeduint8arrays@4.0.10(transitive)
Updateddatastore-core@^9.0.1
Updatedinterface-datastore@^8.0.0