@aztec/kv-store 0.77.0-testnet-ignition.26 → 0.77.0-testnet-ignition.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +5 -5
- package/dest/config.d.ts +0 -17
- package/dest/config.d.ts.map +0 -1
- package/dest/indexeddb/array.d.ts +0 -21
- package/dest/indexeddb/array.d.ts.map +0 -1
- package/dest/indexeddb/index.d.ts +0 -7
- package/dest/indexeddb/index.d.ts.map +0 -1
- package/dest/indexeddb/map.d.ts +0 -26
- package/dest/indexeddb/map.d.ts.map +0 -1
- package/dest/indexeddb/set.d.ts +0 -17
- package/dest/indexeddb/set.d.ts.map +0 -1
- package/dest/indexeddb/singleton.d.ts +0 -16
- package/dest/indexeddb/singleton.d.ts.map +0 -1
- package/dest/indexeddb/store.d.ts +0 -97
- package/dest/indexeddb/store.d.ts.map +0 -1
- package/dest/interfaces/array.d.ts +0 -80
- package/dest/interfaces/array.d.ts.map +0 -1
- package/dest/interfaces/array_test_suite.d.ts +0 -3
- package/dest/interfaces/array_test_suite.d.ts.map +0 -1
- package/dest/interfaces/common.d.ts +0 -23
- package/dest/interfaces/common.d.ts.map +0 -1
- package/dest/interfaces/counter.d.ts +0 -59
- package/dest/interfaces/counter.d.ts.map +0 -1
- package/dest/interfaces/index.d.ts +0 -8
- package/dest/interfaces/index.d.ts.map +0 -1
- package/dest/interfaces/map.d.ts +0 -134
- package/dest/interfaces/map.d.ts.map +0 -1
- package/dest/interfaces/map_test_suite.d.ts +0 -3
- package/dest/interfaces/map_test_suite.d.ts.map +0 -1
- package/dest/interfaces/set.d.ts +0 -44
- package/dest/interfaces/set.d.ts.map +0 -1
- package/dest/interfaces/set_test_suite.d.ts +0 -3
- package/dest/interfaces/set_test_suite.d.ts.map +0 -1
- package/dest/interfaces/singleton.d.ts +0 -29
- package/dest/interfaces/singleton.d.ts.map +0 -1
- package/dest/interfaces/singleton_test_suite.d.ts +0 -3
- package/dest/interfaces/singleton_test_suite.d.ts.map +0 -1
- package/dest/interfaces/store.d.ts +0 -145
- package/dest/interfaces/store.d.ts.map +0 -1
- package/dest/interfaces/store_test_suite.d.ts +0 -3
- package/dest/interfaces/store_test_suite.d.ts.map +0 -1
- package/dest/interfaces/utils.d.ts +0 -16
- package/dest/interfaces/utils.d.ts.map +0 -1
- package/dest/lmdb/array.d.ts +0 -23
- package/dest/lmdb/array.d.ts.map +0 -1
- package/dest/lmdb/counter.d.ts +0 -19
- package/dest/lmdb/counter.d.ts.map +0 -1
- package/dest/lmdb/index.d.ts +0 -12
- package/dest/lmdb/index.d.ts.map +0 -1
- package/dest/lmdb/map.d.ts +0 -52
- package/dest/lmdb/map.d.ts.map +0 -1
- package/dest/lmdb/set.d.ts +0 -18
- package/dest/lmdb/set.d.ts.map +0 -1
- package/dest/lmdb/singleton.d.ts +0 -14
- package/dest/lmdb/singleton.d.ts.map +0 -1
- package/dest/lmdb/store.d.ts +0 -110
- package/dest/lmdb/store.d.ts.map +0 -1
- package/dest/lmdb-v2/array.d.ts +0 -18
- package/dest/lmdb-v2/array.d.ts.map +0 -1
- package/dest/lmdb-v2/factory.d.ts +0 -9
- package/dest/lmdb-v2/factory.d.ts.map +0 -1
- package/dest/lmdb-v2/index.d.ts +0 -3
- package/dest/lmdb-v2/index.d.ts.map +0 -1
- package/dest/lmdb-v2/map.d.ts +0 -86
- package/dest/lmdb-v2/map.d.ts.map +0 -1
- package/dest/lmdb-v2/message.d.ts +0 -112
- package/dest/lmdb-v2/message.d.ts.map +0 -1
- package/dest/lmdb-v2/read_transaction.d.ts +0 -14
- package/dest/lmdb-v2/read_transaction.d.ts.map +0 -1
- package/dest/lmdb-v2/singleton.d.ts +0 -12
- package/dest/lmdb-v2/singleton.d.ts.map +0 -1
- package/dest/lmdb-v2/store.d.ts +0 -43
- package/dest/lmdb-v2/store.d.ts.map +0 -1
- package/dest/lmdb-v2/utils.d.ts +0 -19
- package/dest/lmdb-v2/utils.d.ts.map +0 -1
- package/dest/lmdb-v2/write_transaction.d.ts +0 -19
- package/dest/lmdb-v2/write_transaction.d.ts.map +0 -1
- package/dest/stores/index.d.ts +0 -2
- package/dest/stores/index.d.ts.map +0 -1
- package/dest/stores/l2_tips_store.d.ts +0 -13
- package/dest/stores/l2_tips_store.d.ts.map +0 -1
- package/dest/utils.d.ts +0 -12
- package/dest/utils.d.ts.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/kv-store",
|
|
3
|
-
"version": "0.77.0-testnet-ignition.
|
|
3
|
+
"version": "0.77.0-testnet-ignition.27",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dest/interfaces/index.js",
|
|
@@ -25,10 +25,10 @@
|
|
|
25
25
|
"./package.local.json"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@aztec/ethereum": "0.77.0-testnet-ignition.
|
|
29
|
-
"@aztec/foundation": "0.77.0-testnet-ignition.
|
|
30
|
-
"@aztec/native": "0.77.0-testnet-ignition.
|
|
31
|
-
"@aztec/stdlib": "0.77.0-testnet-ignition.
|
|
28
|
+
"@aztec/ethereum": "0.77.0-testnet-ignition.27",
|
|
29
|
+
"@aztec/foundation": "0.77.0-testnet-ignition.27",
|
|
30
|
+
"@aztec/native": "0.77.0-testnet-ignition.27",
|
|
31
|
+
"@aztec/stdlib": "0.77.0-testnet-ignition.27",
|
|
32
32
|
"idb": "^8.0.0",
|
|
33
33
|
"lmdb": "^3.2.0",
|
|
34
34
|
"msgpackr": "^1.11.2",
|
package/dest/config.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { type ConfigMappingsType } from '@aztec/foundation/config';
|
|
2
|
-
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
3
|
-
export type DataStoreConfig = {
|
|
4
|
-
dataDirectory: string | undefined;
|
|
5
|
-
dataStoreMapSizeKB: number;
|
|
6
|
-
l1Contracts?: {
|
|
7
|
-
rollupAddress: EthAddress;
|
|
8
|
-
};
|
|
9
|
-
};
|
|
10
|
-
export declare const dataConfigMappings: ConfigMappingsType<DataStoreConfig>;
|
|
11
|
-
/**
|
|
12
|
-
* Returns the archiver configuration from the environment variables.
|
|
13
|
-
* Note: If an environment variable is not set, the default value is used.
|
|
14
|
-
* @returns The archiver configuration.
|
|
15
|
-
*/
|
|
16
|
-
export declare function getDataConfigFromEnv(): DataStoreConfig;
|
|
17
|
-
//# sourceMappingURL=config.d.ts.map
|
package/dest/config.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,kBAAkB,EAA6C,MAAM,0BAA0B,CAAC;AAC9G,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAEhE,MAAM,MAAM,eAAe,GAAG;IAC5B,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,WAAW,CAAC,EAAE;QAAE,aAAa,EAAE,UAAU,CAAA;KAAE,CAAC;CAC7C,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,kBAAkB,CAAC,eAAe,CAclE,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,oBAAoB,IAAI,eAAe,CAEtD"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { IDBPDatabase, IDBPObjectStore } from 'idb';
|
|
2
|
-
import type { AztecAsyncArray } from '../interfaces/array.js';
|
|
3
|
-
import type { AztecIDBSchema } from './store.js';
|
|
4
|
-
/**
|
|
5
|
-
* A persistent array backed by IndexedDB.
|
|
6
|
-
*/
|
|
7
|
-
export declare class IndexedDBAztecArray<T> implements AztecAsyncArray<T> {
|
|
8
|
-
#private;
|
|
9
|
-
constructor(rootDB: IDBPDatabase<AztecIDBSchema>, name: string);
|
|
10
|
-
set db(db: IDBPObjectStore<AztecIDBSchema, ['data'], 'data', 'readwrite'> | undefined);
|
|
11
|
-
get db(): IDBPObjectStore<AztecIDBSchema, ['data'], 'data', 'readwrite'>;
|
|
12
|
-
lengthAsync(): Promise<number>;
|
|
13
|
-
push(...vals: T[]): Promise<number>;
|
|
14
|
-
pop(): Promise<T | undefined>;
|
|
15
|
-
atAsync(index: number): Promise<T | undefined>;
|
|
16
|
-
setAt(index: number, val: T): Promise<boolean>;
|
|
17
|
-
entriesAsync(): AsyncIterableIterator<[number, T]>;
|
|
18
|
-
valuesAsync(): AsyncIterableIterator<T>;
|
|
19
|
-
[Symbol.asyncIterator](): AsyncIterableIterator<T>;
|
|
20
|
-
}
|
|
21
|
-
//# sourceMappingURL=array.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"array.d.ts","sourceRoot":"","sources":["../../src/indexeddb/array.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,KAAK,CAAC;AAEzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD;;GAEG;AACH,qBAAa,mBAAmB,CAAC,CAAC,CAAE,YAAW,eAAe,CAAC,CAAC,CAAC;;gBAMnD,MAAM,EAAE,YAAY,CAAC,cAAc,CAAC,EAAE,IAAI,EAAE,MAAM;IAM9D,IAAI,EAAE,CAAC,EAAE,EAAE,eAAe,CAAC,cAAc,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,GAAG,SAAS,EAEpF;IAED,IAAI,EAAE,IAAI,eAAe,CAAC,cAAc,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,CAEvE;IAEK,WAAW,IAAI,OAAO,CAAC,MAAM,CAAC;IAQ9B,IAAI,CAAC,GAAG,IAAI,EAAE,CAAC,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC;IAenC,GAAG,IAAI,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC;IAa7B,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC;IAW9C,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;IAqB7C,YAAY,IAAI,qBAAqB,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IAQlD,WAAW,IAAI,qBAAqB,CAAC,CAAC,CAAC;IAM9C,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,qBAAqB,CAAC,CAAC,CAAC;CAOnD"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { type Logger } from '@aztec/foundation/log';
|
|
2
|
-
import type { DataStoreConfig } from '../config.js';
|
|
3
|
-
import { AztecIndexedDBStore } from './store.js';
|
|
4
|
-
export { AztecIndexedDBStore } from './store.js';
|
|
5
|
-
export declare function createStore(name: string, config: DataStoreConfig, log?: Logger): Promise<AztecIndexedDBStore>;
|
|
6
|
-
export declare function openTmpStore(ephemeral?: boolean): Promise<AztecIndexedDBStore>;
|
|
7
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/indexeddb/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAgB,MAAM,uBAAuB,CAAC;AAElE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEjD,wBAAsB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE,GAAG,GAAE,MAAiC,gCAgB9G;AAED,wBAAgB,YAAY,CAAC,SAAS,GAAE,OAAe,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAErF"}
|
package/dest/indexeddb/map.d.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { IDBPDatabase, IDBPObjectStore } from 'idb';
|
|
2
|
-
import type { Key, Range } from '../interfaces/common.js';
|
|
3
|
-
import type { AztecAsyncMultiMap } from '../interfaces/map.js';
|
|
4
|
-
import type { AztecIDBSchema } from './store.js';
|
|
5
|
-
/**
|
|
6
|
-
* A map backed by IndexedDB.
|
|
7
|
-
*/
|
|
8
|
-
export declare class IndexedDBAztecMap<K extends Key, V> implements AztecAsyncMultiMap<K, V> {
|
|
9
|
-
#private;
|
|
10
|
-
protected name: string;
|
|
11
|
-
constructor(rootDB: IDBPDatabase<AztecIDBSchema>, mapName: string);
|
|
12
|
-
set db(db: IDBPObjectStore<AztecIDBSchema, ['data'], 'data', 'readwrite'> | undefined);
|
|
13
|
-
get db(): IDBPObjectStore<AztecIDBSchema, ['data'], 'data', 'readwrite'>;
|
|
14
|
-
getAsync(key: K): Promise<V | undefined>;
|
|
15
|
-
getValuesAsync(key: K): AsyncIterableIterator<V>;
|
|
16
|
-
hasAsync(key: K): Promise<boolean>;
|
|
17
|
-
set(key: K, val: V): Promise<void>;
|
|
18
|
-
swap(_key: K, _fn: (val: V | undefined) => V): Promise<void>;
|
|
19
|
-
setIfNotExists(key: K, val: V): Promise<boolean>;
|
|
20
|
-
delete(key: K): Promise<void>;
|
|
21
|
-
deleteValue(key: K, val: V): Promise<void>;
|
|
22
|
-
entriesAsync(range?: Range<K>): AsyncIterableIterator<[K, V]>;
|
|
23
|
-
valuesAsync(range?: Range<K>): AsyncIterableIterator<V>;
|
|
24
|
-
keysAsync(range?: Range<K>): AsyncIterableIterator<K>;
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=map.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"map.d.ts","sourceRoot":"","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AE,GAAG,EAAE,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;IAQhD,MAAM,CAAC,GAAG,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAI7B,WAAW,CAAC,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAgBzC,YAAY,CAAC,KAAK,GAAE,KAAK,CAAC,CAAC,CAAM,GAAG,qBAAqB,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAkBjE,WAAW,CAAC,KAAK,GAAE,KAAK,CAAC,CAAC,CAAM,GAAG,qBAAqB,CAAC,CAAC,CAAC;IAM3D,SAAS,CAAC,KAAK,GAAE,KAAK,CAAC,CAAC,CAAM,GAAG,qBAAqB,CAAC,CAAC,CAAC;CAmBjE"}
|
package/dest/indexeddb/set.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { IDBPDatabase, IDBPObjectStore } from 'idb';
|
|
2
|
-
import type { Key, Range } from '../interfaces/common.js';
|
|
3
|
-
import type { AztecAsyncSet } from '../interfaces/set.js';
|
|
4
|
-
import type { AztecIDBSchema } from './store.js';
|
|
5
|
-
/**
|
|
6
|
-
* A set backed by IndexedDB.
|
|
7
|
-
*/
|
|
8
|
-
export declare class IndexedDBAztecSet<K extends Key> implements AztecAsyncSet<K> {
|
|
9
|
-
private map;
|
|
10
|
-
constructor(rootDb: IDBPDatabase<AztecIDBSchema>, mapName: string);
|
|
11
|
-
set db(db: IDBPObjectStore<AztecIDBSchema, ['data'], 'data', 'readwrite'> | undefined);
|
|
12
|
-
hasAsync(key: K): Promise<boolean>;
|
|
13
|
-
add(key: K): Promise<void>;
|
|
14
|
-
delete(key: K): Promise<void>;
|
|
15
|
-
entriesAsync(range?: Range<K>): AsyncIterableIterator<K>;
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=set.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"set.d.ts","sourceRoot":"","sources":["../../src/indexeddb/set.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,KAAK,CAAC;AAEzD,OAAO,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD;;GAEG;AACH,qBAAa,iBAAiB,CAAC,CAAC,SAAS,GAAG,CAAE,YAAW,aAAa,CAAC,CAAC,CAAC;IACvE,OAAO,CAAC,GAAG,CAAgC;gBAE/B,MAAM,EAAE,YAAY,CAAC,cAAc,CAAC,EAAE,OAAO,EAAE,MAAM;IAIjE,IAAI,EAAE,CAAC,EAAE,EAAE,eAAe,CAAC,cAAc,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,GAAG,SAAS,EAEpF;IAED,QAAQ,CAAC,GAAG,EAAE,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;IAIlC,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAI1B,MAAM,CAAC,GAAG,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAItB,YAAY,CAAC,KAAK,GAAE,KAAK,CAAC,CAAC,CAAM,GAAG,qBAAqB,CAAC,CAAC,CAAC;CAGpE"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { IDBPDatabase, IDBPObjectStore } from 'idb';
|
|
2
|
-
import type { AztecAsyncSingleton } from '../interfaces/singleton.js';
|
|
3
|
-
import type { AztecIDBSchema } from './store.js';
|
|
4
|
-
/**
|
|
5
|
-
* Stores a single value in IndexedDB.
|
|
6
|
-
*/
|
|
7
|
-
export declare class IndexedDBAztecSingleton<T> implements AztecAsyncSingleton<T> {
|
|
8
|
-
#private;
|
|
9
|
-
constructor(rootDB: IDBPDatabase<AztecIDBSchema>, name: string);
|
|
10
|
-
set db(db: IDBPObjectStore<AztecIDBSchema, ['data'], 'data', 'readwrite'> | undefined);
|
|
11
|
-
get db(): IDBPObjectStore<AztecIDBSchema, ['data'], 'data', 'readwrite'>;
|
|
12
|
-
getAsync(): Promise<T | undefined>;
|
|
13
|
-
set(val: T): Promise<boolean>;
|
|
14
|
-
delete(): Promise<boolean>;
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=singleton.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"singleton.d.ts","sourceRoot":"","sources":["../../src/indexeddb/singleton.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,KAAK,CAAC;AAEzD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD;;GAEG;AACH,qBAAa,uBAAuB,CAAC,CAAC,CAAE,YAAW,mBAAmB,CAAC,CAAC,CAAC;;gBAM3D,MAAM,EAAE,YAAY,CAAC,cAAc,CAAC,EAAE,IAAI,EAAE,MAAM;IAM9D,IAAI,EAAE,CAAC,EAAE,EAAE,eAAe,CAAC,cAAc,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,GAAG,SAAS,EAEpF;IAED,IAAI,EAAE,IAAI,eAAe,CAAC,cAAc,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,CAEvE;IAEK,QAAQ,IAAI,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC;IAKlC,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;IAW7B,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC;CAIjC"}
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import type { Logger } from '@aztec/foundation/log';
|
|
2
|
-
import { type DBSchema, type IDBPDatabase } from 'idb';
|
|
3
|
-
import type { AztecAsyncArray } from '../interfaces/array.js';
|
|
4
|
-
import type { Key, StoreSize } from '../interfaces/common.js';
|
|
5
|
-
import type { AztecAsyncCounter } from '../interfaces/counter.js';
|
|
6
|
-
import type { AztecAsyncMap, AztecAsyncMultiMap } from '../interfaces/map.js';
|
|
7
|
-
import type { AztecAsyncSet } from '../interfaces/set.js';
|
|
8
|
-
import type { AztecAsyncSingleton } from '../interfaces/singleton.js';
|
|
9
|
-
import type { AztecAsyncKVStore } from '../interfaces/store.js';
|
|
10
|
-
export type StoredData<V> = {
|
|
11
|
-
value: V;
|
|
12
|
-
container: string;
|
|
13
|
-
key: string;
|
|
14
|
-
keyCount: number;
|
|
15
|
-
slot: string;
|
|
16
|
-
};
|
|
17
|
-
export interface AztecIDBSchema extends DBSchema {
|
|
18
|
-
data: {
|
|
19
|
-
value: StoredData<any>;
|
|
20
|
-
key: string;
|
|
21
|
-
indexes: {
|
|
22
|
-
container: string;
|
|
23
|
-
key: string;
|
|
24
|
-
keyCount: number;
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* A key-value store backed by IndexedDB.
|
|
30
|
-
*/
|
|
31
|
-
export declare class AztecIndexedDBStore implements AztecAsyncKVStore {
|
|
32
|
-
#private;
|
|
33
|
-
readonly isEphemeral: boolean;
|
|
34
|
-
constructor(rootDB: IDBPDatabase<AztecIDBSchema>, isEphemeral: boolean, log: Logger, name: string);
|
|
35
|
-
/**
|
|
36
|
-
* Creates a new AztecKVStore backed by IndexedDB. The path to the database is optional. If not provided,
|
|
37
|
-
* the database will be stored in a temporary location and be deleted when the process exists.
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
* @param path - A path on the disk to store the database. Optional
|
|
41
|
-
* @param ephemeral - true if the store should only exist in memory and not automatically be flushed to disk. Optional
|
|
42
|
-
* @param log - A logger to use. Optional
|
|
43
|
-
* @returns The store
|
|
44
|
-
*/
|
|
45
|
-
static open(log: Logger, name?: string, ephemeral?: boolean): Promise<AztecIndexedDBStore>;
|
|
46
|
-
/**
|
|
47
|
-
* Forks the current DB into a new DB by backing it up to a temporary location and opening a new indexedb.
|
|
48
|
-
* @returns A new AztecIndexedDBStore.
|
|
49
|
-
*/
|
|
50
|
-
fork(): Promise<AztecAsyncKVStore>;
|
|
51
|
-
/**
|
|
52
|
-
* Creates a new AztecMap in the store.
|
|
53
|
-
* @param name - Name of the map
|
|
54
|
-
* @returns A new AztecMap
|
|
55
|
-
*/
|
|
56
|
-
openMap<K extends Key, V>(name: string): AztecAsyncMap<K, V>;
|
|
57
|
-
/**
|
|
58
|
-
* Creates a new AztecSet in the store.
|
|
59
|
-
* @param name - Name of the set
|
|
60
|
-
* @returns A new AztecSet
|
|
61
|
-
*/
|
|
62
|
-
openSet<K extends Key>(name: string): AztecAsyncSet<K>;
|
|
63
|
-
/**
|
|
64
|
-
* Creates a new AztecMultiMap in the store. A multi-map stores multiple values for a single key automatically.
|
|
65
|
-
* @param name - Name of the map
|
|
66
|
-
* @returns A new AztecMultiMap
|
|
67
|
-
*/
|
|
68
|
-
openMultiMap<K extends Key, V>(name: string): AztecAsyncMultiMap<K, V>;
|
|
69
|
-
openCounter<K extends Key>(_name: string): AztecAsyncCounter<K>;
|
|
70
|
-
/**
|
|
71
|
-
* Creates a new AztecArray in the store.
|
|
72
|
-
* @param name - Name of the array
|
|
73
|
-
* @returns A new AztecArray
|
|
74
|
-
*/
|
|
75
|
-
openArray<T>(name: string): AztecAsyncArray<T>;
|
|
76
|
-
/**
|
|
77
|
-
* Creates a new AztecSingleton in the store.
|
|
78
|
-
* @param name - Name of the singleton
|
|
79
|
-
* @returns A new AztecSingleton
|
|
80
|
-
*/
|
|
81
|
-
openSingleton<T>(name: string): AztecAsyncSingleton<T>;
|
|
82
|
-
/**
|
|
83
|
-
* Runs a callback in a transaction.
|
|
84
|
-
* @param callback - Function to execute in a transaction
|
|
85
|
-
* @returns A promise that resolves to the return value of the callback
|
|
86
|
-
*/
|
|
87
|
-
transactionAsync<T>(callback: () => Promise<T>): Promise<T>;
|
|
88
|
-
/**
|
|
89
|
-
* Clears all entries in the store & sub DBs.
|
|
90
|
-
*/
|
|
91
|
-
clear(): Promise<void>;
|
|
92
|
-
/** Deletes this store and removes the database */
|
|
93
|
-
delete(): Promise<void>;
|
|
94
|
-
estimateSize(): Promise<StoreSize>;
|
|
95
|
-
close(): Promise<void>;
|
|
96
|
-
}
|
|
97
|
-
//# sourceMappingURL=store.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/indexeddb/store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAEpD,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,YAAY,EAAoB,MAAM,KAAK,CAAC;AAEzE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC9E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAMhE,MAAM,MAAM,UAAU,CAAC,CAAC,IAAI;IAAE,KAAK,EAAE,CAAC,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAA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AC,CAAC;IAM9C;;;;OAIG;IACH,aAAa,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,mBAAmB,CAAC,CAAC,CAAC;IAMtD;;;;OAIG;IACG,gBAAgB,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IAkBjE;;OAEG;IACG,KAAK;IAIX,kDAAkD;IAClD,MAAM;IAMN,YAAY,IAAI,OAAO,CAAC,SAAS,CAAC;IAIlC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAGvB"}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* An array backed by a persistent store. Can not have any holes in it.
|
|
3
|
-
*/
|
|
4
|
-
interface BaseAztecArray<T> {
|
|
5
|
-
/**
|
|
6
|
-
* Pushes values to the end of the array
|
|
7
|
-
* @param vals - The values to push to the end of the array
|
|
8
|
-
* @returns The new length of the array
|
|
9
|
-
*/
|
|
10
|
-
push(...vals: T[]): Promise<number>;
|
|
11
|
-
/**
|
|
12
|
-
* Pops a value from the end of the array.
|
|
13
|
-
* @returns The value that was popped, or undefined if the array was empty
|
|
14
|
-
*/
|
|
15
|
-
pop(): Promise<T | undefined>;
|
|
16
|
-
/**
|
|
17
|
-
* Updates the value at the given index. Index can be in the range [-length, length - 1).
|
|
18
|
-
* @param index - The index to set the value at
|
|
19
|
-
* @param val - The value to set
|
|
20
|
-
* @returns Whether the value was set
|
|
21
|
-
*/
|
|
22
|
-
setAt(index: number, val: T): Promise<boolean>;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* An array backed by a persistent store. Can not have any holes in it.
|
|
26
|
-
*/
|
|
27
|
-
export interface AztecAsyncArray<T> extends BaseAztecArray<T> {
|
|
28
|
-
/**
|
|
29
|
-
* The size of the array
|
|
30
|
-
*/
|
|
31
|
-
lengthAsync(): Promise<number>;
|
|
32
|
-
/**
|
|
33
|
-
* Gets the value at the given index. Index can be in the range [-length, length - 1).
|
|
34
|
-
* If the index is negative, it will be treated as an offset from the end of the array.
|
|
35
|
-
*
|
|
36
|
-
* @param index - The index to get the value from
|
|
37
|
-
* @returns The value at the given index or undefined if the index is out of bounds
|
|
38
|
-
*/
|
|
39
|
-
atAsync(index: number): Promise<T | undefined>;
|
|
40
|
-
/**
|
|
41
|
-
* Iterates over the array with indexes.
|
|
42
|
-
*/
|
|
43
|
-
entriesAsync(): AsyncIterableIterator<[number, T]>;
|
|
44
|
-
/**
|
|
45
|
-
* Iterates over the array.
|
|
46
|
-
*/
|
|
47
|
-
valuesAsync(): AsyncIterableIterator<T>;
|
|
48
|
-
/**
|
|
49
|
-
* Iterates over the array.
|
|
50
|
-
*/
|
|
51
|
-
[Symbol.asyncIterator](): AsyncIterableIterator<T>;
|
|
52
|
-
}
|
|
53
|
-
export interface AztecArray<T> extends BaseAztecArray<T> {
|
|
54
|
-
/**
|
|
55
|
-
* The size of the array
|
|
56
|
-
*/
|
|
57
|
-
length: number;
|
|
58
|
-
/**
|
|
59
|
-
* Gets the value at the given index. Index can be in the range [-length, length - 1).
|
|
60
|
-
* If the index is negative, it will be treated as an offset from the end of the array.
|
|
61
|
-
*
|
|
62
|
-
* @param index - The index to get the value from
|
|
63
|
-
* @returns The value at the given index or undefined if the index is out of bounds
|
|
64
|
-
*/
|
|
65
|
-
at(index: number): T | undefined;
|
|
66
|
-
/**
|
|
67
|
-
* Iterates over the array with indexes.
|
|
68
|
-
*/
|
|
69
|
-
entries(): IterableIterator<[number, T]>;
|
|
70
|
-
/**
|
|
71
|
-
* Iterates over the array.
|
|
72
|
-
*/
|
|
73
|
-
values(): IterableIterator<T>;
|
|
74
|
-
/**
|
|
75
|
-
* Iterates over the array.
|
|
76
|
-
*/
|
|
77
|
-
[Symbol.iterator](): IterableIterator<T>;
|
|
78
|
-
}
|
|
79
|
-
export {};
|
|
80
|
-
//# sourceMappingURL=array.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
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AC,CAAC,CAAC;IAE9B;;OAEG;IACH,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,gBAAgB,CAAC,CAAC,CAAC,CAAC;CAC1C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"array_test_suite.d.ts","sourceRoot":"","sources":["../../src/interfaces/array_test_suite.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAGlE,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,YAAY,GAAG,OAAO,CAAC,iBAAiB,CAAC,EACzD,UAAU,GAAE,OAAe,QAsH5B"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The key type for use with the kv-store
|
|
3
|
-
*/
|
|
4
|
-
export type Key = string | number | Array<string | number>;
|
|
5
|
-
/**
|
|
6
|
-
* A range of keys to iterate over.
|
|
7
|
-
*/
|
|
8
|
-
export type Range<K extends Key = Key> = {
|
|
9
|
-
/** The key of the first item to include */
|
|
10
|
-
start?: K;
|
|
11
|
-
/** The key of the last item to include */
|
|
12
|
-
end?: K;
|
|
13
|
-
/** Whether to iterate in reverse */
|
|
14
|
-
reverse?: boolean;
|
|
15
|
-
/** The maximum number of items to iterate over */
|
|
16
|
-
limit?: number;
|
|
17
|
-
};
|
|
18
|
-
export type StoreSize = {
|
|
19
|
-
mappingSize: number;
|
|
20
|
-
actualSize: number;
|
|
21
|
-
numItems: number;
|
|
22
|
-
};
|
|
23
|
-
//# sourceMappingURL=common.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/interfaces/common.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,GAAG,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;AAE3D;;GAEG;AACH,MAAM,MAAM,KAAK,CAAC,CAAC,SAAS,GAAG,GAAG,GAAG,IAAI;IACvC,2CAA2C;IAC3C,KAAK,CAAC,EAAE,CAAC,CAAC;IACV,0CAA0C;IAC1C,GAAG,CAAC,EAAE,CAAC,CAAC;IACR,oCAAoC;IACpC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,kDAAkD;IAClD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC"}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import type { Key, Range } from './common.js';
|
|
2
|
-
/**
|
|
3
|
-
* A map that counts how many times it sees a key. Once 0 is reached, that key is removed from the map.
|
|
4
|
-
* Iterating over the map will only return keys that have a count over 0.
|
|
5
|
-
*
|
|
6
|
-
* Keys are stored in sorted order
|
|
7
|
-
*/
|
|
8
|
-
interface AztecBaseCounter<K extends Key = Key> {
|
|
9
|
-
/**
|
|
10
|
-
* Resets the count of the given key to the given value.
|
|
11
|
-
* @param key - The key to reset
|
|
12
|
-
* @param value - The value to reset the key to
|
|
13
|
-
*/
|
|
14
|
-
set(key: K, value: number): Promise<void>;
|
|
15
|
-
/**
|
|
16
|
-
* Updates the count of the given key by the given delta. This can be used to increment or decrement the count.
|
|
17
|
-
* Once a key's count reaches 0, it is removed from the map.
|
|
18
|
-
*
|
|
19
|
-
* @param key - The key to update
|
|
20
|
-
* @param delta - The amount to modify the key by
|
|
21
|
-
*/
|
|
22
|
-
update(key: K, delta: number): Promise<void>;
|
|
23
|
-
}
|
|
24
|
-
export interface AztecCounter<K extends Key = Key> extends AztecBaseCounter<K> {
|
|
25
|
-
/**
|
|
26
|
-
* Gets the current count.
|
|
27
|
-
* @param key - The key to get the count of
|
|
28
|
-
*/
|
|
29
|
-
get(key: K): number;
|
|
30
|
-
/**
|
|
31
|
-
* Returns keys in the map in sorted order. Only returns keys that have been seen at least once.
|
|
32
|
-
* @param range - The range of keys to iterate over
|
|
33
|
-
*/
|
|
34
|
-
keys(range: Range<K>): IterableIterator<K>;
|
|
35
|
-
/**
|
|
36
|
-
* Returns keys and their counts in the map sorted by the key. Only returns keys that have been seen at least once.
|
|
37
|
-
* @param range - The range of keys to iterate over
|
|
38
|
-
*/
|
|
39
|
-
entries(range: Range<K>): IterableIterator<[K, number]>;
|
|
40
|
-
}
|
|
41
|
-
export interface AztecAsyncCounter<K extends Key = Key> extends AztecBaseCounter<K> {
|
|
42
|
-
/**
|
|
43
|
-
* Gets the current count.
|
|
44
|
-
* @param key - The key to get the count of
|
|
45
|
-
*/
|
|
46
|
-
getAsync(key: K): Promise<number>;
|
|
47
|
-
/**
|
|
48
|
-
* Returns keys in the map in sorted order. Only returns keys that have been seen at least once.
|
|
49
|
-
* @param range - The range of keys to iterate over
|
|
50
|
-
*/
|
|
51
|
-
keysAsync(range: Range<K>): AsyncIterableIterator<K>;
|
|
52
|
-
/**
|
|
53
|
-
* Returns keys and their counts in the map sorted by the key. Only returns keys that have been seen at least once.
|
|
54
|
-
* @param range - The range of keys to iterate over
|
|
55
|
-
*/
|
|
56
|
-
entriesAsync(range: Range<K>): AsyncIterableIterator<[K, number]>;
|
|
57
|
-
}
|
|
58
|
-
export {};
|
|
59
|
-
//# sourceMappingURL=counter.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"counter.d.ts","sourceRoot":"","sources":["../../src/interfaces/counter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAE9C;;;;;GAKG;AACH,UAAU,gBAAgB,CAAC,CAAC,SAAS,GAAG,GAAG,GAAG;IAC5C;;;;OAIG;IACH,GAAG,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE1C;;;;;;OAMG;IACH,MAAM,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9C;AAED,MAAM,WAAW,YAAY,CAAC,CAAC,SAAS,GAAG,GAAG,GAAG,CAAE,SAAQ,gBAAgB,CAAC,CAAC,CAAC;IAC5E;;;OAGG;IACH,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,MAAM,CAAC;IAEpB;;;OAGG;IACH,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC;IAE3C;;;OAGG;IACH,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,gBAAgB,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;CACzD;AAED,MAAM,WAAW,iBAAiB,CAAC,CAAC,SAAS,GAAG,GAAG,GAAG,CAAE,SAAQ,gBAAgB,CAAC,CAAC,CAAC;IACjF;;;OAGG;IACH,QAAQ,CAAC,GAAG,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAElC;;;OAGG;IACH,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,qBAAqB,CAAC,CAAC,CAAC,CAAC;IAErD;;;OAGG;IACH,YAAY,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,qBAAqB,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;CACnE"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export * from './array.js';
|
|
2
|
-
export * from './map.js';
|
|
3
|
-
export * from './counter.js';
|
|
4
|
-
export * from './singleton.js';
|
|
5
|
-
export * from './store.js';
|
|
6
|
-
export * from './set.js';
|
|
7
|
-
export type { Range, StoreSize } from './common.js';
|
|
8
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,YAAY,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC"}
|
package/dest/interfaces/map.d.ts
DELETED
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
import type { Key, Range } from './common.js';
|
|
2
|
-
/**
|
|
3
|
-
* A map backed by a persistent store.
|
|
4
|
-
*/
|
|
5
|
-
interface AztecBaseMap<K extends Key, V> {
|
|
6
|
-
/**
|
|
7
|
-
* Sets the value at the given key.
|
|
8
|
-
* @param key - The key to set the value at
|
|
9
|
-
* @param val - The value to set
|
|
10
|
-
*/
|
|
11
|
-
set(key: K, val: V): Promise<void>;
|
|
12
|
-
/**
|
|
13
|
-
* Sets the value at the given key if it does not already exist.
|
|
14
|
-
* @param key - The key to set the value at
|
|
15
|
-
* @param val - The value to set
|
|
16
|
-
*/
|
|
17
|
-
setIfNotExists(key: K, val: V): Promise<boolean>;
|
|
18
|
-
/**
|
|
19
|
-
* Deletes the value at the given key.
|
|
20
|
-
* @param key - The key to delete the value at
|
|
21
|
-
*/
|
|
22
|
-
delete(key: K): Promise<void>;
|
|
23
|
-
}
|
|
24
|
-
export interface AztecMap<K extends Key, V> extends AztecBaseMap<K, V> {
|
|
25
|
-
/**
|
|
26
|
-
* Gets the value at the given key.
|
|
27
|
-
* @param key - The key to get the value from
|
|
28
|
-
*/
|
|
29
|
-
get(key: K): V | undefined;
|
|
30
|
-
/**
|
|
31
|
-
* Checks if a key exists in the map.
|
|
32
|
-
* @param key - The key to check
|
|
33
|
-
* @returns True if the key exists, false otherwise
|
|
34
|
-
*/
|
|
35
|
-
has(key: K): boolean;
|
|
36
|
-
/**
|
|
37
|
-
* Iterates over the map's key-value entries in the key's natural order
|
|
38
|
-
* @param range - The range of keys to iterate over
|
|
39
|
-
*/
|
|
40
|
-
entries(range?: Range<K>): IterableIterator<[K, V]>;
|
|
41
|
-
/**
|
|
42
|
-
* Iterates over the map's values in the key's natural order
|
|
43
|
-
* @param range - The range of keys to iterate over
|
|
44
|
-
*/
|
|
45
|
-
values(range?: Range<K>): IterableIterator<V>;
|
|
46
|
-
/**
|
|
47
|
-
* Iterates over the map's keys in the key's natural order
|
|
48
|
-
* @param range - The range of keys to iterate over
|
|
49
|
-
*/
|
|
50
|
-
keys(range?: Range<K>): IterableIterator<K>;
|
|
51
|
-
/**
|
|
52
|
-
* Clears the map.
|
|
53
|
-
*/
|
|
54
|
-
clear(): Promise<void>;
|
|
55
|
-
}
|
|
56
|
-
export interface AztecMapWithSize<K extends Key, V> extends AztecMap<K, V> {
|
|
57
|
-
/**
|
|
58
|
-
* Gets the size of the map.
|
|
59
|
-
* @returns The size of the map
|
|
60
|
-
*/
|
|
61
|
-
size(): number;
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* A map backed by a persistent store that can have multiple values for a single key.
|
|
65
|
-
*/
|
|
66
|
-
export interface AztecMultiMap<K extends Key, V> extends AztecMap<K, V> {
|
|
67
|
-
/**
|
|
68
|
-
* Gets all the values at the given key.
|
|
69
|
-
* @param key - The key to get the values from
|
|
70
|
-
*/
|
|
71
|
-
getValues(key: K): IterableIterator<V>;
|
|
72
|
-
/**
|
|
73
|
-
* Deletes a specific value at the given key.
|
|
74
|
-
* @param key - The key to delete the value at
|
|
75
|
-
* @param val - The value to delete
|
|
76
|
-
*/
|
|
77
|
-
deleteValue(key: K, val: V): Promise<void>;
|
|
78
|
-
}
|
|
79
|
-
export interface AztecMultiMapWithSize<K extends Key, V> extends AztecMultiMap<K, V> {
|
|
80
|
-
/**
|
|
81
|
-
* Gets the size of the map.
|
|
82
|
-
* @returns The size of the map
|
|
83
|
-
*/
|
|
84
|
-
size(): number;
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* A map backed by a persistent store.
|
|
88
|
-
*/
|
|
89
|
-
export interface AztecAsyncMap<K extends Key, V> extends AztecBaseMap<K, V> {
|
|
90
|
-
/**
|
|
91
|
-
* Gets the value at the given key.
|
|
92
|
-
* @param key - The key to get the value from
|
|
93
|
-
*/
|
|
94
|
-
getAsync(key: K): Promise<V | undefined>;
|
|
95
|
-
/**
|
|
96
|
-
* Checks if a key exists in the map.
|
|
97
|
-
* @param key - The key to check
|
|
98
|
-
* @returns True if the key exists, false otherwise
|
|
99
|
-
*/
|
|
100
|
-
hasAsync(key: K): Promise<boolean>;
|
|
101
|
-
/**
|
|
102
|
-
* Iterates over the map's key-value entries in the key's natural order
|
|
103
|
-
* @param range - The range of keys to iterate over
|
|
104
|
-
*/
|
|
105
|
-
entriesAsync(range?: Range<K>): AsyncIterableIterator<[K, V]>;
|
|
106
|
-
/**
|
|
107
|
-
* Iterates over the map's values in the key's natural order
|
|
108
|
-
* @param range - The range of keys to iterate over
|
|
109
|
-
*/
|
|
110
|
-
valuesAsync(range?: Range<K>): AsyncIterableIterator<V>;
|
|
111
|
-
/**
|
|
112
|
-
* Iterates over the map's keys in the key's natural order
|
|
113
|
-
* @param range - The range of keys to iterate over
|
|
114
|
-
*/
|
|
115
|
-
keysAsync(range?: Range<K>): AsyncIterableIterator<K>;
|
|
116
|
-
}
|
|
117
|
-
/**
|
|
118
|
-
* A map backed by a persistent store that can have multiple values for a single key.
|
|
119
|
-
*/
|
|
120
|
-
export interface AztecAsyncMultiMap<K extends Key, V> extends AztecAsyncMap<K, V> {
|
|
121
|
-
/**
|
|
122
|
-
* Gets all the values at the given key.
|
|
123
|
-
* @param key - The key to get the values from
|
|
124
|
-
*/
|
|
125
|
-
getValuesAsync(key: K): AsyncIterableIterator<V>;
|
|
126
|
-
/**
|
|
127
|
-
* Deletes a specific value at the given key.
|
|
128
|
-
* @param key - The key to delete the value at
|
|
129
|
-
* @param val - The value to delete
|
|
130
|
-
*/
|
|
131
|
-
deleteValue(key: K, val: V): Promise<void>;
|
|
132
|
-
}
|
|
133
|
-
export {};
|
|
134
|
-
//# sourceMappingURL=map.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"map.d.ts","sourceRoot":"","sources":["../../src/interfaces/map.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAE9C;;GAEG;AACH,UAAU,YAAY,CAAC,CAAC,SAAS,GAAG,EAAE,CAAC;IACrC;;;;OAIG;IACH,GAAG,CAAC,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEnC;;;;OAIG;IACH,cAAc,CAAC,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAEjD;;;OAGG;IACH,MAAM,CAAC,GAAG,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/B;AACD,MAAM,WAAW,QAAQ,CAAC,CAAC,SAAS,GAAG,EAAE,CAAC,CAAE,SAAQ,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC;IACpE;;;OAGG;IACH,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC;IAE3B;;;;OAIG;IACH,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,OAAO,CAAC;IAErB;;;OAGG;IACH,OAAO,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,gBAAgB,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAEpD;;;OAGG;IACH,MAAM,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC;IAE9C;;;OAGG;IACH,IAA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