@agoric/vat-data 0.5.3-dev-4f72580.0 → 0.5.3-dev-bef63e5.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.
Files changed (2) hide show
  1. package/package.json +6 -6
  2. package/src/exo-utils.js +20 -13
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agoric/vat-data",
3
- "version": "0.5.3-dev-4f72580.0+4f72580",
3
+ "version": "0.5.3-dev-bef63e5.0+bef63e5",
4
4
  "description": "Safe access to VatData global",
5
5
  "type": "module",
6
6
  "repository": "https://github.com/Agoric/agoric-sdk",
@@ -19,10 +19,10 @@
19
19
  "author": "Agoric",
20
20
  "license": "Apache-2.0",
21
21
  "dependencies": {
22
- "@agoric/assert": "0.6.1-dev-4f72580.0+4f72580",
23
- "@agoric/internal": "0.3.3-dev-4f72580.0+4f72580",
24
- "@agoric/store": "0.9.3-dev-4f72580.0+4f72580",
25
- "@agoric/swingset-liveslots": "0.10.3-dev-4f72580.0+4f72580"
22
+ "@agoric/assert": "0.6.1-dev-bef63e5.0+bef63e5",
23
+ "@agoric/internal": "0.3.3-dev-bef63e5.0+bef63e5",
24
+ "@agoric/store": "0.9.3-dev-bef63e5.0+bef63e5",
25
+ "@agoric/swingset-liveslots": "0.10.3-dev-bef63e5.0+bef63e5"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@endo/init": "^1.0.1",
@@ -47,5 +47,5 @@
47
47
  "typeCoverage": {
48
48
  "atLeast": 98.23
49
49
  },
50
- "gitHead": "4f7258043c55cb9d60e1d50cbdddb712910950f4"
50
+ "gitHead": "bef63e5f0c6ad6a553b3eef69d722c060995a247"
51
51
  }
package/src/exo-utils.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // @jessie-check
2
-
2
+ /* eslint-disable @typescript-eslint/prefer-ts-expect-error -- for casting from deprecated types that aren't worth fixing */
3
3
  import { initEmpty } from '@agoric/store';
4
4
 
5
5
  import { provide, VatData as globalVatData } from './vat-data-bindings.js';
@@ -31,6 +31,7 @@ export const ignoreContext =
31
31
  harden(ignoreContext);
32
32
 
33
33
  // TODO: Find a good home for this function used by @agoric/vat-data and testing code
34
+ /** @param {import('@agoric/swingset-liveslots').VatData} VatData */
34
35
  export const makeExoUtils = VatData => {
35
36
  const {
36
37
  defineKind,
@@ -41,6 +42,7 @@ export const makeExoUtils = VatData => {
41
42
  } = VatData;
42
43
 
43
44
  /**
45
+ * @deprecated Use Exos/ExoClasses instead of Kinds
44
46
  * @param {Baggage} baggage
45
47
  * @param {string} kindName
46
48
  * @returns {DurableKindHandle}
@@ -101,9 +103,11 @@ export const makeExoUtils = VatData => {
101
103
  * self: T,
102
104
  * state: ReturnType<I>
103
105
  * }>} [options]
104
- * @returns {(...args: Parameters<I>) => (T & RemotableBrand<{}, T>)}
106
+ * @returns {(...args: Parameters<I>) => import('@endo/exo/src/exo-makers.js').Guarded<T>}
105
107
  */
106
108
  const defineVirtualExoClass = (tag, interfaceGuard, init, methods, options) =>
109
+ // eslint-disable-next-line @typescript-eslint/prefer-ts-expect-error
110
+ // @ts-ignore cast
107
111
  defineKind(tag, init, methods, {
108
112
  ...options,
109
113
  thisfulMethods: true,
@@ -118,14 +122,14 @@ export const makeExoUtils = VatData => {
118
122
  * @param {InterfaceGuardKit | undefined} interfaceGuardKit
119
123
  * @param {I} init
120
124
  * @param {T & ThisType<{
121
- * facets: T,
125
+ * facets: import('@endo/exo/src/exo-makers.js').GuardedKit<T>,
122
126
  * state: ReturnType<I>
123
127
  * }> } facets
124
128
  * @param {DefineKindOptions<{
125
129
  * facets: T,
126
130
  * state: ReturnType<I>
127
131
  * }>} [options]
128
- * @returns {(...args: Parameters<I>) => (T & RemotableBrand<{}, T>)}
132
+ * @returns {(...args: Parameters<I>) => import('@endo/exo/src/exo-makers.js').GuardedKit<T>}
129
133
  */
130
134
  const defineVirtualExoClassKit = (
131
135
  tag,
@@ -134,6 +138,7 @@ export const makeExoUtils = VatData => {
134
138
  facets,
135
139
  options,
136
140
  ) =>
141
+ // @ts-ignore cast
137
142
  defineKindMulti(tag, init, facets, {
138
143
  ...options,
139
144
  thisfulMethods: true,
@@ -155,7 +160,7 @@ export const makeExoUtils = VatData => {
155
160
  * self: T,
156
161
  * state: ReturnType<I>
157
162
  * }>} [options]
158
- * @returns {(...args: Parameters<I>) => (T & RemotableBrand<{}, T>)}
163
+ * @returns {(...args: Parameters<I>) => import('@endo/exo/src/exo-makers.js').Guarded<T>}
159
164
  */
160
165
  const defineDurableExoClass = (
161
166
  kindHandle,
@@ -164,6 +169,7 @@ export const makeExoUtils = VatData => {
164
169
  methods,
165
170
  options,
166
171
  ) =>
172
+ // @ts-ignore cast
167
173
  defineDurableKind(kindHandle, init, methods, {
168
174
  ...options,
169
175
  thisfulMethods: true,
@@ -178,14 +184,14 @@ export const makeExoUtils = VatData => {
178
184
  * @param {InterfaceGuardKit | undefined} interfaceGuardKit
179
185
  * @param {I} init
180
186
  * @param {T & ThisType<{
181
- * facets: T,
187
+ * facets: import('@endo/exo/src/exo-makers.js').GuardedKit<T>,
182
188
  * state: ReturnType<I>
183
189
  * }> } facets
184
190
  * @param {DefineKindOptions<{
185
191
  * facets: T,
186
192
  * state: ReturnType<I>
187
193
  * }>} [options]
188
- * @returns {(...args: Parameters<I>) => (T & RemotableBrand<{}, T>)}
194
+ * @returns {(...args: Parameters<I>) => import('@endo/exo/src/exo-makers.js').GuardedKit<T>}
189
195
  */
190
196
  const defineDurableExoClassKit = (
191
197
  kindHandle,
@@ -194,6 +200,7 @@ export const makeExoUtils = VatData => {
194
200
  facets,
195
201
  options,
196
202
  ) =>
203
+ // @ts-ignore cast
197
204
  defineDurableKindMulti(kindHandle, init, facets, {
198
205
  ...options,
199
206
  thisfulMethods: true,
@@ -216,7 +223,7 @@ export const makeExoUtils = VatData => {
216
223
  * self: T,
217
224
  * state: ReturnType<I>
218
225
  * }>} [options]
219
- * @returns {(...args: Parameters<I>) => (T & RemotableBrand<{}, T>)}
226
+ * @returns {(...args: Parameters<I>) => import('@endo/exo/src/exo-makers.js').Guarded<T>}
220
227
  */
221
228
  const prepareExoClass = (
222
229
  baggage,
@@ -243,14 +250,14 @@ export const makeExoUtils = VatData => {
243
250
  * @param {InterfaceGuardKit | undefined} interfaceGuardKit
244
251
  * @param {I} init
245
252
  * @param {T & ThisType<{
246
- * facets: T,
253
+ * facets: import('@endo/exo/src/exo-makers.js').GuardedKit<T>,
247
254
  * state: ReturnType<I>
248
255
  * }> } facets
249
256
  * @param {DefineKindOptions<{
250
257
  * facets: T,
251
258
  * state: ReturnType<I>
252
259
  * }>} [options]
253
- * @returns {(...args: Parameters<I>) => (T & RemotableBrand<{}, T>)}
260
+ * @returns {(...args: Parameters<I>) => import('@endo/exo/src/exo-makers.js').GuardedKit<T>}
254
261
  */
255
262
  const prepareExoClassKit = (
256
263
  baggage,
@@ -276,7 +283,7 @@ export const makeExoUtils = VatData => {
276
283
  * @param {InterfaceGuard | undefined} interfaceGuard
277
284
  * @param {M} methods
278
285
  * @param {DefineKindOptions<{ self: M }>} [options]
279
- * @returns {M & RemotableBrand<{}, M>}
286
+ * @returns {import('@endo/exo/src/exo-makers.js').Guarded<M>}
280
287
  */
281
288
  const prepareExo = (
282
289
  baggage,
@@ -305,7 +312,7 @@ export const makeExoUtils = VatData => {
305
312
  * @param {string} kindName
306
313
  * @param {M} methods
307
314
  * @param {DefineKindOptions<{ self: M }>} [options]
308
- * @returns {M & RemotableBrand<{}, M>}
315
+ * @returns {import('@endo/exo/src/exo-makers.js').Guarded<M>}
309
316
  */
310
317
  const prepareSingleton = (baggage, kindName, methods, options = undefined) =>
311
318
  prepareExo(baggage, kindName, undefined, methods, options);
@@ -319,8 +326,8 @@ export const makeExoUtils = VatData => {
319
326
  prepareExoClass,
320
327
  prepareExoClassKit,
321
328
  prepareExo,
322
- prepareSingleton,
323
329
 
330
+ prepareSingleton,
324
331
  provideKindHandle,
325
332
  prepareKind,
326
333
  prepareKindMulti,