@agoric/store 0.9.3-u18.1 → 0.9.3-u19.0

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agoric/store",
3
- "version": "0.9.3-u18.1",
3
+ "version": "0.9.3-u19.0",
4
4
  "description": "Wrapper for JavaScript map",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -14,7 +14,9 @@
14
14
  "lint-fix": "yarn lint:eslint --fix",
15
15
  "lint": "run-s --continue-on-error lint:*",
16
16
  "lint:types": "tsc",
17
- "lint:eslint": "eslint ."
17
+ "lint:eslint": "eslint .",
18
+ "prepack": "tsc --build tsconfig.build.json",
19
+ "postpack": "git clean -f '*.d.ts*' '*.tsbuildinfo'"
18
20
  },
19
21
  "repository": {
20
22
  "type": "git",
@@ -30,15 +32,15 @@
30
32
  },
31
33
  "homepage": "https://github.com/Agoric/agoric-sdk#readme",
32
34
  "dependencies": {
33
- "@endo/errors": "^1.2.8",
34
- "@endo/exo": "^1.5.7",
35
- "@endo/marshal": "^1.6.2",
36
- "@endo/pass-style": "^1.4.7",
37
- "@endo/patterns": "^1.4.7"
35
+ "@endo/errors": "^1.2.9",
36
+ "@endo/exo": "^1.5.8",
37
+ "@endo/marshal": "^1.6.3",
38
+ "@endo/pass-style": "^1.4.8",
39
+ "@endo/patterns": "^1.4.8"
38
40
  },
39
41
  "devDependencies": {
40
- "@endo/init": "^1.1.7",
41
- "@endo/ses-ava": "^1.2.8",
42
+ "@endo/init": "^1.1.8",
43
+ "@endo/ses-ava": "^1.2.9",
42
44
  "ava": "^5.3.0"
43
45
  },
44
46
  "files": [
@@ -59,7 +61,7 @@
59
61
  "timeout": "2m"
60
62
  },
61
63
  "typeCoverage": {
62
- "atLeast": 89.53
64
+ "atLeast": 89.69
63
65
  },
64
- "gitHead": "f8c45b8a2e29a51522a81a6692af25b2d7f6b50f"
66
+ "gitHead": "29e9704c375a06bb617027093b30d2d25faa6471"
65
67
  }
package/src/index.d.ts ADDED
@@ -0,0 +1,14 @@
1
+ export { makeScalarWeakSetStore } from "./stores/scalarWeakSetStore.js";
2
+ export { makeScalarSetStore } from "./stores/scalarSetStore.js";
3
+ export { makeScalarWeakMapStore } from "./stores/scalarWeakMapStore.js";
4
+ export { makeScalarMapStore } from "./stores/scalarMapStore.js";
5
+ export { provideLazy } from "./stores/store-utils.js";
6
+ /** @type {MustMatch} */
7
+ export const mustMatch: MustMatch;
8
+ export { makeLegacyMap } from "./legacy/legacyMap.js";
9
+ export { makeLegacyWeakMap } from "./legacy/legacyWeakMap.js";
10
+ export * from "./types.js";
11
+ import type { MustMatch } from '@agoric/internal';
12
+ export { isKey, assertKey, assertScalarKey, makeCopySet, getCopySetKeys, makeCopyBag, makeCopyBagFromElements, getCopyBagEntries, makeCopyMap, getCopyMapEntries, coerceToElements, coerceToBagEntries, compareKeys, keyLT, keyLTE, keyEQ, keyGTE, keyGT, elementsIsSuperset, elementsIsDisjoint, elementsCompare, elementsUnion, elementsDisjointUnion, elementsIntersection, elementsDisjointSubtract, setIsSuperset, setIsDisjoint, setCompare, setUnion, setDisjointUnion, setIntersection, setDisjointSubtract, bagIsSuperbag, bagCompare, bagUnion, bagIntersection, bagDisjointSubtract, M, getRankCover, isPattern, assertPattern, matches, isCopySet, isCopyMap } from "@endo/patterns";
13
+ export { initEmpty, defineExoClass, defineExoClassKit, makeExo } from "@endo/exo";
14
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":";;;;;AAgEA,wBAAwB;AACxB,wBADW,SAAS,CACuB;;;;+BAhEf,kBAAkB"}
@@ -0,0 +1,3 @@
1
+ export function makeLegacyMap<K, V>(tag?: string): LegacyMap<K, V>;
2
+ import type { LegacyMap } from '../types.js';
3
+ //# sourceMappingURL=legacyMap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"legacyMap.d.ts","sourceRoot":"","sources":["legacyMap.js"],"names":[],"mappings":"AAsCO,8BAJM,CAAC,EAAC,CAAC,QACL,MAAM,GACJ,UAAU,CAAC,EAAE,CAAC,CAAC,CAqC3B;+BAzE2C,aAAa"}
@@ -0,0 +1,3 @@
1
+ export function makeLegacyWeakMap<K, V>(tag?: string): LegacyWeakMap<K, V>;
2
+ import type { LegacyWeakMap } from '../types.js';
3
+ //# sourceMappingURL=legacyWeakMap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"legacyWeakMap.d.ts","sourceRoot":"","sources":["legacyWeakMap.js"],"names":[],"mappings":"AAaO,kCAJM,CAAC,EAAC,CAAC,QACL,MAAM,GACJ,cAAc,CAAC,EAAE,CAAC,CAAC,CAkC/B;mCA7CgC,aAAa"}
@@ -0,0 +1,8 @@
1
+ export function makeMapStoreMethods<K extends Key, V extends Passable>(jsmap: Map<K, V>, assertKVOkToAdd: (k: K, v: V) => void, assertKVOkToSet: (k: K, v: V) => void, assertKeyOkToDelete?: (k: K) => void, tag?: string): MapStoreMethods<K, V>;
2
+ export function makeScalarMapStore(tag?: string, { keyShape, valueShape }?: StoreOptions): MapStore<any, any>;
3
+ import type { Key } from '@endo/patterns';
4
+ import type { Passable } from '@endo/pass-style';
5
+ import type { MapStoreMethods } from '../types.js';
6
+ import type { StoreOptions } from '../types.js';
7
+ import type { MapStore } from '../types.js';
8
+ //# sourceMappingURL=scalarMapStore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scalarMapStore.d.ts","sourceRoot":"","sources":["scalarMapStore.js"],"names":[],"mappings":"AAkCO,oCATY,CAAC,SAAP,GAAK,EACM,CAAC,SAAZ,QAAU,SACZ,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,mBACT,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,IAAI,mBACpB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,IAAI,wBACpB,CAAC,CAAC,EAAE,CAAC,KAAK,IAAI,QACd,MAAM,GACJ,gBAAgB,CAAC,EAAE,CAAC,CAAC,CAyFjC;AAiBM,yCAJI,MAAM,6BACN,YAAY,GACV,SAAS,GAAG,EAAE,GAAG,CAAC,CA8C9B;yBAlK8B,gBAAgB;8BADpB,kBAAkB;qCAEa,aAAa;kCAAb,aAAa;8BAAb,aAAa"}
@@ -0,0 +1,7 @@
1
+ export function makeSetStoreMethods<K extends Key>(jsset: Set<K>, assertKeyOkToAdd: (k: K) => void, assertKeyOkToDelete?: (k: K) => void, keyName?: string): SetStoreMethods<K>;
2
+ export function makeScalarSetStore<K>(tag?: string, { keyShape }?: StoreOptions): SetStore<K>;
3
+ import type { Key } from '@endo/patterns';
4
+ import type { SetStoreMethods } from '../types.js';
5
+ import type { StoreOptions } from '../types.js';
6
+ import type { SetStore } from '../types.js';
7
+ //# sourceMappingURL=scalarSetStore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scalarSetStore.d.ts","sourceRoot":"","sources":["scalarSetStore.js"],"names":[],"mappings":"AA0BO,oCAPY,CAAC,SAAP,GAAK,SACP,GAAG,CAAC,CAAC,CAAC,oBACN,CAAC,CAAC,EAAE,CAAC,KAAK,IAAI,wBACd,CAAC,CAAC,EAAE,CAAC,KAAK,IAAI,YACd,MAAM,GACJ,gBAAgB,CAAC,CAAC,CAqD9B;AAkBM,mCALM,CAAC,QACH,MAAM,iBACN,YAAY,GACV,SAAS,CAAC,CAAC,CAyBvB;yBAxG8B,gBAAgB;qCACW,aAAa;kCAAb,aAAa;8BAAb,aAAa"}
@@ -0,0 +1,8 @@
1
+ export function makeWeakMapStoreMethods<K extends Key, V extends Passable>(jsmap: WeakMap<K & object, V>, assertKVOkToAdd: (k: K, v: V) => void, assertKVOkToSet: (k: K, v: V) => void, assertKeyOkToDelete?: (k: K) => void, keyName?: string): WeakMapStore<K, V>;
2
+ export function makeScalarWeakMapStore<K, V>(tag?: string, { longLived, keyShape, valueShape }?: StoreOptions): RemotableObject & WeakMapStore<K, V>;
3
+ import type { Key } from '@endo/patterns';
4
+ import type { Passable } from '@endo/pass-style';
5
+ import type { WeakMapStore } from '../types.js';
6
+ import type { StoreOptions } from '../types.js';
7
+ import type { RemotableObject } from '@endo/pass-style';
8
+ //# sourceMappingURL=scalarWeakMapStore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scalarWeakMapStore.d.ts","sourceRoot":"","sources":["scalarWeakMapStore.js"],"names":[],"mappings":"AAyBO,wCATY,CAAC,SAAP,GAAK,EACM,CAAC,SAAZ,QAAU,SACZ,OAAO,CAAC,CAAC,GAAG,MAAM,EAAE,CAAC,CAAC,mBACtB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,IAAI,mBACpB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,IAAI,wBACpB,CAAC,CAAC,EAAE,CAAC,KAAK,IAAI,YACd,MAAM,GACJ,aAAa,CAAC,EAAE,CAAC,CAAC,CA8D9B;AAoBM,uCALM,CAAC,EAAC,CAAC,QACL,MAAM,wCACN,YAAY,GACV,eAAe,GAAG,aAAa,CAAC,EAAE,CAAC,CAAC,CA8ChD;yBA3IqB,gBAAgB;8BACM,kBAAkB;kCACjB,aAAa;kCAAb,aAAa;qCADd,kBAAkB"}
@@ -0,0 +1,7 @@
1
+ export function makeWeakSetStoreMethods<K extends Key>(jsset: WeakSet<K & object>, assertKeyOkToAdd: (k: K) => void, assertKeyOkToDelete?: (k: K) => void, keyName?: string): WeakSetStoreMethods<K>;
2
+ export function makeScalarWeakSetStore<K>(tag?: string, { longLived, keyShape }?: StoreOptions): WeakSetStore<K>;
3
+ import type { Key } from '@endo/patterns';
4
+ import type { WeakSetStoreMethods } from '@agoric/store';
5
+ import type { StoreOptions } from '@agoric/store';
6
+ import type { WeakSetStore } from '@agoric/store';
7
+ //# sourceMappingURL=scalarWeakSetStore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scalarWeakSetStore.d.ts","sourceRoot":"","sources":["scalarWeakSetStore.js"],"names":[],"mappings":"AAsBO,wCAPY,CAAC,SAAP,GAAK,SACP,OAAO,CAAC,CAAC,GAAG,MAAM,CAAC,oBACnB,CAAC,CAAC,EAAE,CAAC,KAAK,IAAI,wBACd,CAAC,CAAC,EAAE,CAAC,KAAK,IAAI,YACd,MAAM,GACJ,oBAAoB,CAAC,CAAC,CA8ClC;AAmBM,uCALM,CAAC,QACH,MAAM,4BACN,YAAY,GACV,aAAa,CAAC,CAAC,CAyB3B;yBAlGqB,gBAAgB;yCAC4B,eAAe;kCAAf,eAAe;kCAAf,eAAe"}
@@ -0,0 +1,23 @@
1
+ export function isCopySet(s: unknown): s is CopySet;
2
+ export function isCopyMap(m: unknown): m is CopyMap;
3
+ export function makeCurrentKeysKit<K extends Key, V extends Passable>(getRawKeys: () => Iterable<K>, checkHas: (k: K) => boolean, compare: RankCompare, assertOkToAdd: (k: K, v?: V) => void, assertOkToDelete?: (k: K) => void, keyName?: string): CurrentKeysKit<K, V>;
4
+ export function provideLazy<K extends Key, V extends Passable>(mapStore: WeakMapStore<K, V>, key: K, makeValue: (key: K) => V): V;
5
+ export function makeAtomicProvider<K extends Key, V extends Passable>(store: WeakMapStore<K, V>): {
6
+ provideAsync: (key: K, makeValue: (key: K) => Promise<V>, finishValue?: (key: K, value: V) => Promise<void>) => Promise<V>;
7
+ };
8
+ export function appendToStoredArray<K extends Key, V extends Passable>(mapStore: MapStore<K, V[]>, key: K, item: V): void;
9
+ export type CurrentKeysKit<K extends Key, V extends Passable> = {
10
+ assertUpdateOnAdd: (k: K, v?: V) => void;
11
+ assertUpdateOnDelete: (k: K) => void;
12
+ iterableKeys: Iterable<K>;
13
+ };
14
+ /**
15
+ * <K, V>
16
+ */
17
+ export type AtomicProvider<K extends Key, V extends Passable> = ReturnType<typeof makeAtomicProvider<K, V>>;
18
+ import type { Key } from '@endo/patterns';
19
+ import type { Passable } from '@endo/pass-style';
20
+ import type { RankCompare } from '@endo/marshal';
21
+ import type { WeakMapStore } from '../types.js';
22
+ import type { MapStore } from '../types.js';
23
+ //# sourceMappingURL=store-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store-utils.d.ts","sourceRoot":"","sources":["store-utils.js"],"names":[],"mappings":"AAqBO,6BAHI,OAAO,GACL,CAAC,IAAI,OAAO,CAEwB;AAY1C,6BAHI,OAAO,GACL,CAAC,IAAI,OAAO,CAEwB;AAsB1C,mCAVY,CAAC,SAAP,GAAK,EACM,CAAC,SAAZ,QAAU,cACZ,MAAM,QAAQ,CAAC,CAAC,CAAC,YACjB,CAAC,CAAC,EAAE,CAAC,KAAK,OAAO,WACjB,WAAW,iBACX,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,IAAI,qBACrB,CAAC,CAAC,EAAE,CAAC,KAAK,IAAI,YACd,MAAM,GACJ,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,CA4DhC;AAeM,4BAPY,CAAC,SAAP,GAAK,EACM,CAAC,SAAZ,QAAU,YACZ,aAAa,CAAC,EAAE,CAAC,CAAC,OAClB,CAAC,aACD,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,GACX,CAAC,CAOb;AAkBM,mCAJY,CAAC,SAAP,GAAK,EACM,CAAC,SAAZ,QAAU,SACZ,aAAa,CAAC,EAAE,CAAC,CAAC;wBAYhB,CAAC,aACD,CAAC,GAAG,EAAE,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,gBAEtB,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,KAEjC,OAAO,CAAC,CAAC,CAAC;EA6BxB;AAeM,oCANY,CAAC,SAAP,GAAK,EACM,CAAC,SAAZ,QAAU,YACZ,SAAS,CAAC,EAAE,CAAC,EAAE,CAAC,OAChB,CAAC,QACD,CAAC,QASX;2BArLkB,CAAC,SAAP,GAAK,EACM,CAAC,SAAZ,QAAU;uBAET,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,IAAI;0BACrB,CAAC,CAAC,EAAE,CAAC,KAAK,IAAI;kBACd,QAAQ,CAAC,CAAC,CAAC;;;;;2BA6JN,CAAC,SAAP,GAAK,EACM,CAAC,SAAZ,QAAU,IACV,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;yBAhMlC,gBAAgB;8BADX,kBAAkB;iCAFf,eAAe;kCACJ,aAAa;8BAAb,aAAa"}
package/src/types.d.ts ADDED
@@ -0,0 +1,212 @@
1
+ /**
2
+ * Of the dimensions on which KeyedStores can
3
+ * differ, we only represent a few of them as standard options. A given store
4
+ * maker should document which options it supports, as well as its positions
5
+ * on dimensions for which it does not support options.
6
+ */
7
+ export type StoreOptions = {
8
+ /**
9
+ * Which way to optimize a weak store. True
10
+ * means that we expect this weak store to outlive most of its keys, in which
11
+ * case we internally may use a JavaScript `WeakMap`. Otherwise we internally
12
+ * may use a JavaScript `Map`. Defaults to true, so please mark short lived
13
+ * stores explicitly.
14
+ */
15
+ longLived?: boolean | undefined;
16
+ /**
17
+ * The contents of this store survive termination
18
+ * of its containing process, allowing for restart or upgrade but at the cost
19
+ * of forbidding storage of references to ephemeral data. Defaults to false.
20
+ */
21
+ durable?: boolean | undefined;
22
+ /**
23
+ * This store pretends to be a durable store
24
+ * but does not enforce that the things stored in it actually be themselves
25
+ * durable (whereas an actual durable store would forbid storage of such
26
+ * items). This is in service of allowing incremental transition to use of
27
+ * durable stores, to enable normal operation and testing when some stuff
28
+ * intended to eventually be durable has not yet been made durable. A store
29
+ * marked as fakeDurable will appear to operate normally but any attempt to
30
+ * upgrade its containing vat will fail with an error. Defaults to false.
31
+ */
32
+ fakeDurable?: boolean | undefined;
33
+ keyShape?: Pattern;
34
+ valueShape?: Pattern;
35
+ };
36
+ export type WeakSetStoreMethods<K> = {
37
+ /**
38
+ * Check if a key exists. The key can be any
39
+ * JavaScript value, though the answer will always be false for keys that
40
+ * cannot be found in this store.
41
+ */
42
+ has: (key: K) => boolean;
43
+ /**
44
+ * Add the key to the set if it is not already
45
+ * there. Do nothing silently if already there. The key must be one allowed by
46
+ * this store. For example a scalar store only allows primitives and
47
+ * remotables.
48
+ */
49
+ add: (key: K) => void;
50
+ /**
51
+ * Remove the key. Throws if not found.
52
+ */
53
+ delete: (key: K) => void;
54
+ addAll: (keys: CopySet<any> | Iterable<K>) => void;
55
+ };
56
+ export type WeakSetStore<K> = RemotableObject & WeakSetStoreMethods<K>;
57
+ export type SetStoreMethods<K> = {
58
+ /**
59
+ * Check if a key exists. The key can be any
60
+ * JavaScript value, though the answer will always be false for keys that
61
+ * cannot be found in this store.
62
+ */
63
+ has: (key: K) => boolean;
64
+ /**
65
+ * Add the key to the set if it is not already
66
+ * there. Do nothing silently if already there. The key must be one allowed by
67
+ * this store. For example a scalar store only allows primitives and
68
+ * remotables.
69
+ */
70
+ add: (key: K) => void;
71
+ /**
72
+ * Remove the key. Throws if not found.
73
+ */
74
+ delete: (key: K) => void;
75
+ addAll: (keys: CopySet<any> | Iterable<K>) => void;
76
+ keys: (keyPatt?: Pattern) => Iterable<K>;
77
+ values: (keyPatt?: Pattern) => Iterable<K>;
78
+ snapshot: (keyPatt?: Pattern) => CopySet<any>;
79
+ getSize: (keyPatt?: Pattern) => number;
80
+ clear: (keyPatt?: Pattern) => void;
81
+ };
82
+ export type SetStore<K> = RemotableObject & SetStoreMethods<K>;
83
+ export type WeakMapStore<K, V> = {
84
+ /**
85
+ * Check if a key exists. The key can be any
86
+ * JavaScript value, though the answer will always be false for keys that
87
+ * cannot be found in this store.
88
+ */
89
+ has: (key: K) => boolean;
90
+ /**
91
+ * Return a value for the key. Throws if not
92
+ * found.
93
+ */
94
+ get: (key: K) => V;
95
+ /**
96
+ * Initialize the key only if it
97
+ * doesn't already exist. The key must be one allowed by this store. For
98
+ * example a scalar store only allows primitives and remotables.
99
+ */
100
+ init: (key: K, value: V) => void;
101
+ /**
102
+ * Set the key. Throws if not found.
103
+ */
104
+ set: (key: K, value: V) => void;
105
+ /**
106
+ * Remove the key. Throws if not found.
107
+ */
108
+ delete: (key: K) => void;
109
+ addAll: (entries: CopyMap<any, any> | Iterable<[K, V]>) => void;
110
+ };
111
+ export type MapStoreMethods<K, V> = {
112
+ /**
113
+ * Check if a key exists. The key can be any
114
+ * JavaScript value, though the answer will always be false for keys that
115
+ * cannot be found in this map
116
+ */
117
+ has: (key: K) => boolean;
118
+ /**
119
+ * Return a value for the key. Throws if not
120
+ * found.
121
+ */
122
+ get: (key: K) => V;
123
+ /**
124
+ * Initialize the key only if it
125
+ * doesn't already exist. The key must be one allowed by this store. For
126
+ * example a scalar store only allows primitives and remotables.
127
+ */
128
+ init: (key: K, value: V) => void;
129
+ /**
130
+ * Set the key. Throws if not found.
131
+ */
132
+ set: (key: K, value: V) => void;
133
+ /**
134
+ * Remove the key. Throws if not found.
135
+ */
136
+ delete: (key: K) => void;
137
+ addAll: (entries: CopyMap<any, Passable> | Iterable<[K, V]>) => void;
138
+ keys: (keyPatt?: Pattern, valuePatt?: Pattern) => Iterable<K>;
139
+ values: (keyPatt?: Pattern, valuePatt?: Pattern) => Iterable<V>;
140
+ entries: (keyPatt?: Pattern, valuePatt?: Pattern) => Iterable<[K, V]>;
141
+ snapshot: (keyPatt?: Pattern, valuePatt?: Pattern) => CopyMap<any, Passable>;
142
+ getSize: (keyPatt?: Pattern, valuePatt?: Pattern) => number;
143
+ clear: (keyPatt?: Pattern, valuePatt?: Pattern) => void;
144
+ };
145
+ export type MapStore<K = any, V = any> = RemotableObject & MapStoreMethods<K, V>;
146
+ /**
147
+ * LegacyWeakMap is deprecated. Use WeakMapStore
148
+ * instead if possible.
149
+ */
150
+ export type LegacyWeakMap<K, V> = {
151
+ /**
152
+ * Check if a key exists
153
+ */
154
+ has: (key: K) => boolean;
155
+ /**
156
+ * Return a value for the key. Throws if not
157
+ * found.
158
+ */
159
+ get: (key: K) => V;
160
+ /**
161
+ * Initialize the key only if it
162
+ * doesn't already exist
163
+ */
164
+ init: (key: K, value: V) => void;
165
+ /**
166
+ * Set the key. Throws if not found.
167
+ */
168
+ set: (key: K, value: V) => void;
169
+ /**
170
+ * Remove the key. Throws if not found.
171
+ */
172
+ delete: (key: K) => void;
173
+ };
174
+ /**
175
+ * LegacyMap is deprecated. Use MapStore instead if
176
+ * possible.
177
+ */
178
+ export type LegacyMap<K, V> = {
179
+ /**
180
+ * Check if a key exists
181
+ */
182
+ has: (key: K) => boolean;
183
+ /**
184
+ * Return a value for the key. Throws if not
185
+ * found.
186
+ */
187
+ get: (key: K) => V;
188
+ /**
189
+ * Initialize the key only if it
190
+ * doesn't already exist
191
+ */
192
+ init: (key: K, value: V) => void;
193
+ /**
194
+ * Set the key. Throws if not found.
195
+ */
196
+ set: (key: K, value: V) => void;
197
+ /**
198
+ * Remove the key. Throws if not found.
199
+ */
200
+ delete: (key: K) => void;
201
+ keys: () => Iterable<K>;
202
+ values: () => Iterable<V>;
203
+ entries: () => Iterable<[K, V]>;
204
+ getSize: () => number;
205
+ clear: () => void;
206
+ };
207
+ import type { Pattern } from '@endo/patterns';
208
+ import type { CopySet } from '@endo/patterns';
209
+ import type { RemotableObject } from '@endo/pass-style';
210
+ import type { CopyMap } from '@endo/patterns';
211
+ import type { Passable } from '@endo/pass-style';
212
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAkCc,OAAO;iBACP,OAAO;;gCAkBR,CAAC;;;;;;SAEA,CAAC,GAAG,EAAE,CAAC,KAAK,OAAO;;;;;;;SAGnB,CAAC,GAAG,EAAE,CAAC,KAAK,IAAI;;;;YAIhB,CAAC,GAAG,EAAE,CAAC,KAAK,IAAI;YAChB,CAAC,IA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