@agoric/notifier 0.6.3-upgrade-14-dev-c8f9e7b.0 → 0.6.3-upgrade-16-fi-dev-8879538.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.
@@ -1,301 +0,0 @@
1
- type ERef<T> = import('@endo/far').ERef<T>;
2
- type PromiseKit<T> = import('@endo/promise-kit').PromiseKit<T>;
3
- /**
4
- * Deprecated. Use PromiseKit instead.
5
- */
6
- type PromiseRecord<T> = import('@endo/promise-kit').PromiseRecord<T>;
7
- /**
8
- * An AsyncIterator that can be forked at a given position
9
- * into multiple independent ForkableAsyncIterators starting from that position.
10
- */
11
- type ForkableAsyncIterator<T, TReturn = any, TNext = undefined> = AsyncIterator<T, TReturn, TNext> & {
12
- fork(): ForkableAsyncIterator<T, TReturn, TNext>;
13
- };
14
- type AsyncIterableOnly<T, TReturn = any, TNext = undefined> = {
15
- [Symbol.asyncIterator](): AsyncIterableIterator<T, TReturn, TNext>;
16
- };
17
- type ForkableAsyncIterableIterator<T, TReturn = any, TNext = undefined> = {
18
- [Symbol.asyncIterator](): ForkableAsyncIterableIterator<T, TReturn, TNext>;
19
- fork(): ForkableAsyncIterableIterator<T, TReturn, TNext>;
20
- } & ForkableAsyncIterator<T, TReturn, TNext>;
21
- /**
22
- * An AsyncIterable that produces ForkableAsyncIterators.
23
- */
24
- type ForkableAsyncIterable<T, TReturn = any, TNext = undefined> = {
25
- [Symbol.asyncIterator]: () => ForkableAsyncIterator<T, TReturn, TNext>;
26
- };
27
- /**
28
- * <T>
29
- * A valid sequence of calls to the methods of an `IterationObserver`
30
- * represents an iteration. A valid sequence consists of any number of calls
31
- * to `updateState` with the successive non-final values, followed by a
32
- * final call to either `finish` with a successful `completion` value
33
- * or `fail` with the alleged `reason` for failure. After at most one
34
- * terminating calls, no further calls to these methods are valid and must be
35
- * rejected.
36
- */
37
- type IterationObserver<T> = {
38
- updateState: (nonFinalValue: T) => void;
39
- finish: (completion: T) => void;
40
- fail: (reason: unknown) => void;
41
- };
42
- /**
43
- * Will be shared between machines, so it must be safe to expose. But software
44
- * outside the current package should consider it opaque, not depending on its
45
- * internal structure.
46
- */
47
- type PublicationRecord<T> = {
48
- head: IteratorResult<T>;
49
- /**
50
- * starts at 1 for the first result
51
- * and advances by 1 for each subsequent result
52
- */
53
- publishCount: bigint;
54
- tail: Promise<PublicationRecord<T>>;
55
- };
56
- type EachTopic<T> = {
57
- /**
58
- * Returns a promise for a "current" PublicationRecord (referencing its
59
- * immediate successor via a `tail` promise) that is later than the
60
- * provided publishCount.
61
- * Used to make forward-lossless ("each") iterators.
62
- */
63
- subscribeAfter: (publishCount?: bigint) => Promise<PublicationRecord<T>>;
64
- };
65
- /**
66
- * An EachTopic with default asyncIterable behaviour.
67
- *
68
- * NOTE: the publication records and iterators returned by this object are
69
- * ephemeral and will be severed during upgrade. A caller should use
70
- * `subscribeEach` to wrap this topic in a local iterable which automatically
71
- * attempts to reconnect upon being severed.
72
- */
73
- type IterableEachTopic<T> = ForkableAsyncIterable<T, T> & EachTopic<T>;
74
- /**
75
- * A LatestTopic with default asyncIterable behaviour.
76
- *
77
- * NOTE: the iterators returned by this object are ephemeral and will be severed
78
- * during upgrade. A caller should use `subscribeLatest` to wrap this topic in
79
- * a local iterable which automatically attempts to reconnect upon being
80
- * severed.
81
- */
82
- type IterableLatestTopic<T> = AsyncIterableOnly<T, T> & LatestTopic<T>;
83
- type LatestTopic<T> = {
84
- /**
85
- * Returns a promise for an update record as of an update count.
86
- * If the `updateCount` argument is omitted or differs from the current update count,
87
- * the promise promptly resolves to the current record.
88
- * Otherwise, after the next state change, the promise resolves to the resulting record.
89
- * This is an attenuated form of `subscribeAfter` whose return value stands alone and
90
- * does not allow consumers to pin a chain of historical PublicationRecords.
91
- * Used to make lossy ("latest") iterators.
92
- * NOTE: Use of `number` as an `updateCount` is deprecated.
93
- */
94
- getUpdateSince: (updateCount?: bigint | number) => Promise<UpdateRecord<T>>;
95
- };
96
- /**
97
- * This type is deprecated but is still
98
- * used externally.
99
- */
100
- type BaseNotifier<T> = LatestTopic<T>;
101
- /**
102
- * A stream of results that allows consumers to configure
103
- * forward-lossless "each" iteration with `subscribeEach` and
104
- * lossy "latest" iteration with `subscribeLatest`.
105
- */
106
- type Subscriber<T> = LatestTopic<T> & EachTopic<T>;
107
- /**
108
- * A valid sequence of calls to the methods of an `IterationObserver`
109
- * represents an iteration. A valid sequence consists of any number of calls
110
- * to `publish` with the successive non-final values, followed by a
111
- * final call to either `finish` with a successful `completion` value
112
- * or `fail` with the alleged `reason` for failure. After at most one
113
- * terminating calls, no further calls to these methods are valid and must be
114
- * rejected.
115
- */
116
- type Publisher<T> = {
117
- publish: (nonFinalValue: T) => void;
118
- finish: (completion: T) => void;
119
- fail: (reason: any) => void;
120
- };
121
- type PublishObserver<T> = Partial<Publisher<T>>;
122
- /**
123
- * <T>
124
- */
125
- type PublishKit<T> = {
126
- publisher: Publisher<T>;
127
- subscriber: Subscriber<T>;
128
- };
129
- /**
130
- * <T>
131
- */
132
- type StoredPublishKit<T> = {
133
- publisher: Publisher<T>;
134
- subscriber: StoredSubscriber<T>;
135
- };
136
- /**
137
- * Durability configures constraints on non-terminal values that can be
138
- * published to a durable publish kit (terminal values sent to finish or fail
139
- * must always be durable).
140
- * - 'mandatory' means that each value must be durable, so it can be restored
141
- * on upgrade.
142
- * - 'opportunistic' means that a durable value is persisted for post-upgrade
143
- * restoration, but a non-durable value is still accepted (and will result in
144
- * valueless restoration).
145
- * - 'ignored' means that a value is not persisted for restoration even if it
146
- * is durable.
147
- *
148
- * 'mandatory' is the only currently-supported value, and others must not be
149
- * enabled without test coverage.
150
- */
151
- type DurablePublishKitValueDurability = 'mandatory' | 'opportunistic' | 'ignored';
152
- type DurablePublishKitState = {
153
- valueDurability: DurablePublishKitValueDurability;
154
- publishCount: bigint;
155
- status: 'live' | 'finished' | 'failed';
156
- /**
157
- * hasValue indicates the presence of value. It starts off false,
158
- * and can be reset to false when a durable publish kit is restored and
159
- * the previous value was not durable, or non-terminal and valueDurablity is 'ignored'.
160
- */
161
- hasValue: boolean;
162
- /**
163
- * value holds either a non-terminal value from `publish` or a terminal value
164
- * from `finish` or `fail`, depending upon the value in status.
165
- */
166
- value: any;
167
- };
168
- /**
169
- * <T>
170
- */
171
- type UpdateRecord<T> = {
172
- /**
173
- * is whatever state the service wants to publish
174
- */
175
- value: T;
176
- /**
177
- * is a value that identifies the update. For
178
- * the last update, it is `undefined`.
179
- */
180
- updateCount?: bigint | undefined;
181
- };
182
- /**
183
- * Will be shared between machines,
184
- * so it must be safe to expose. But other software should avoid depending on
185
- * its internal structure.
186
- */
187
- type NotifierInternals<T> = BaseNotifier<T>;
188
- /**
189
- * <T> an object that can be used to get the current state or updates
190
- */
191
- type Notifier<T> = NotifierInternals<T> & ForkableAsyncIterable<T, T> & SharableNotifier<T>;
192
- type SharableNotifier<T> = {
193
- /**
194
- * Used to replicate the multicast values at other sites. To manually create a
195
- * local representative of a Notification, do
196
- * ```js
197
- * localIterable =
198
- * makeNotifier(E(remoteIterable).getSharableNotifierInternals());
199
- * ```
200
- * The resulting `localIterable` also supports such remote use, and
201
- * will return access to the same representation.
202
- */
203
- getSharableNotifierInternals: () => Promise<NotifierInternals<T>>;
204
- };
205
- /**
206
- * <T> the produced notifier/updater pair
207
- */
208
- type NotifierRecord<T> = {
209
- /**
210
- * the (closely-held) notifier producer
211
- */
212
- updater: IterationObserver<T>;
213
- /**
214
- * the (widely-held) notifier consumer
215
- */
216
- notifier: Notifier<T>;
217
- };
218
- /**
219
- * <T>
220
- * A form of AsyncIterable supporting distributed and multicast usage.
221
- */
222
- type Subscription<T> = IterableEachTopic<T> & EachTopic<T> & SharableSubscription<T>;
223
- type SharableSubscription<T> = {
224
- /**
225
- * Used to replicate the multicast values at other sites. To manually create a
226
- * local representative of a Subscription, do
227
- * ```js
228
- * localIterable =
229
- * makeSubscription(E(remoteIterable).getSharableSubscriptionInternals());
230
- * ```
231
- * The resulting `localIterable` also supports such remote use, and
232
- * will return access to the same representation.
233
- */
234
- getSharableSubscriptionInternals: () => Promise<EachTopic<T>>;
235
- };
236
- /**
237
- * <T>
238
- */
239
- type SubscriptionRecord<T> = {
240
- publication: IterationObserver<T>;
241
- subscription: Subscription<T>;
242
- };
243
- type Marshaller<Slot = unknown> = import('@endo/marshal').Marshal<Slot>;
244
- type Unserializer = Pick<Marshaller, 'fromCapData'>;
245
- /**
246
- * Defined by vstorageStoreKey in vstorage.go
247
- */
248
- type VStorageKey = {
249
- storeName: string;
250
- storeSubkey: string;
251
- dataPrefixBytes: string;
252
- noDataValue?: string | undefined;
253
- };
254
- /**
255
- * This represents a node in an IAVL tree.
256
- *
257
- * The active implementation is x/vstorage, an Agoric extension of the Cosmos SDK.
258
- *
259
- * Vstorage is a hierarchical externally-reachable storage structure that
260
- * identifies children by restricted ASCII name and is associated with arbitrary
261
- * string-valued data for each node, defaulting to the empty string.
262
- */
263
- type StorageNode = {
264
- /**
265
- * publishes some data (append to the node)
266
- */
267
- setValue: (data: string) => Promise<void>;
268
- /**
269
- * the chain storage path at which the node was constructed
270
- */
271
- getPath: () => string;
272
- /**
273
- * DEPRECATED use getPath
274
- */
275
- getStoreKey: () => Promise<VStorageKey>;
276
- makeChildNode: (subPath: string, options?: {
277
- sequence?: boolean;
278
- }) => StorageNode;
279
- };
280
- type StoredFacet = {
281
- /**
282
- * the chain storage path at which the node was constructed
283
- */
284
- getPath: () => Promise<string>;
285
- /**
286
- * DEPRECATED use getPath
287
- */
288
- getStoreKey: StorageNode['getStoreKey'];
289
- /**
290
- * get the unserializer for the stored data
291
- */
292
- getUnserializer: () => Unserializer;
293
- };
294
- type StoredSubscription<T> = Subscription<T> & {
295
- getStoreKey: () => Promise<VStorageKey & {
296
- subscription: Subscription<T>;
297
- }>;
298
- getUnserializer: () => Unserializer;
299
- };
300
- type StoredSubscriber<T> = Subscriber<T> & StoredFacet;
301
- //# sourceMappingURL=types-ambient.d.ts.map
@@ -1 +0,0 @@
1
- {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,MAAM,QAAQ,WAAW,CAAC;6BAChB,MAAM,YAAY;QAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAC,KAAK,WAAW;;;;;;aAKhE,MAAM,QAAQ,MAAM,CAAC;;;;iBACrB,WAAW,CAAC,aAAa,CAAC;;;;qBAC1B,MAAM,YAAY;;6BAMnB,aAAa,CAAC,CAAC,GAAG;IAC9B,WAAe,EAAE,MAAM,QAAQ,WAAW,GAAG;QAAE,YAAY,EAAE,aAAa,CAAC,CAAC,CAAA;KAAE,CAAC,CAAC;IAChF,eAAmB,EAAE,MAAM,YAAY,CAAC;CACrC;2BAKS,WAAW,CAAC,CAAC,GAAG,WAAW"}
@@ -1,346 +0,0 @@
1
- // @jessie-check
2
-
3
- /**
4
- * @template T
5
- * @typedef {import('@endo/far').ERef<T>} ERef
6
- */
7
-
8
- /**
9
- * @template T
10
- * @typedef {import('@endo/promise-kit').PromiseKit<T>} PromiseKit
11
- */
12
-
13
- /**
14
- * Deprecated. Use PromiseKit instead.
15
- *
16
- * @template T
17
- * @typedef {import('@endo/promise-kit').PromiseRecord<T>} PromiseRecord
18
- */
19
-
20
- /**
21
- * @template T
22
- * @template [TReturn=any]
23
- * @template [TNext=undefined]
24
- * @typedef {AsyncIterator<T, TReturn, TNext> & {
25
- * fork(): ForkableAsyncIterator<T, TReturn, TNext>
26
- * }} ForkableAsyncIterator An AsyncIterator that can be forked at a given position
27
- * into multiple independent ForkableAsyncIterators starting from that position.
28
- */
29
-
30
- /**
31
- * @template T
32
- * @template [TReturn=any]
33
- * @template [TNext=undefined]
34
- * @typedef {{ [Symbol.asyncIterator](): AsyncIterableIterator<T, TReturn, TNext> }} AsyncIterableOnly
35
- */
36
-
37
- /**
38
- * @template T
39
- * @template [TReturn=any]
40
- * @template [TNext=undefined]
41
- * @typedef {{
42
- * [Symbol.asyncIterator](): ForkableAsyncIterableIterator<T, TReturn, TNext>,
43
- * fork(): ForkableAsyncIterableIterator<T, TReturn, TNext> } &
44
- * ForkableAsyncIterator<T, TReturn, TNext>
45
- * } ForkableAsyncIterableIterator
46
- */
47
-
48
- /**
49
- * @template T
50
- * @template [TReturn=any]
51
- * @template [TNext=undefined]
52
- * @typedef {{
53
- * [Symbol.asyncIterator]: () => ForkableAsyncIterator<T, TReturn, TNext>
54
- * }} ForkableAsyncIterable
55
- * An AsyncIterable that produces ForkableAsyncIterators.
56
- */
57
-
58
- /**
59
- * @template T
60
- * @typedef {object} IterationObserver<T>
61
- * A valid sequence of calls to the methods of an `IterationObserver`
62
- * represents an iteration. A valid sequence consists of any number of calls
63
- * to `updateState` with the successive non-final values, followed by a
64
- * final call to either `finish` with a successful `completion` value
65
- * or `fail` with the alleged `reason` for failure. After at most one
66
- * terminating calls, no further calls to these methods are valid and must be
67
- * rejected.
68
- * @property {(nonFinalValue: T) => void} updateState
69
- * @property {(completion: T) => void} finish
70
- * @property {(reason: unknown) => void} fail
71
- */
72
-
73
- // /////////////////////////////////////////////////////////////////////////////
74
-
75
- /**
76
- * @template T
77
- * @typedef {object} PublicationRecord
78
- * Will be shared between machines, so it must be safe to expose. But software
79
- * outside the current package should consider it opaque, not depending on its
80
- * internal structure.
81
- * @property {IteratorResult<T>} head
82
- * @property {bigint} publishCount starts at 1 for the first result
83
- * and advances by 1 for each subsequent result
84
- * @property {Promise<PublicationRecord<T>>} tail
85
- */
86
-
87
- /**
88
- * @template T
89
- * @typedef {object} EachTopic
90
- * @property {(publishCount?: bigint) => Promise<PublicationRecord<T>>} subscribeAfter
91
- * Returns a promise for a "current" PublicationRecord (referencing its
92
- * immediate successor via a `tail` promise) that is later than the
93
- * provided publishCount.
94
- * Used to make forward-lossless ("each") iterators.
95
- */
96
-
97
- /**
98
- * @template T
99
- * @typedef {ForkableAsyncIterable<T, T> & EachTopic<T>} IterableEachTopic
100
- * An EachTopic with default asyncIterable behaviour.
101
- *
102
- * NOTE: the publication records and iterators returned by this object are
103
- * ephemeral and will be severed during upgrade. A caller should use
104
- * `subscribeEach` to wrap this topic in a local iterable which automatically
105
- * attempts to reconnect upon being severed.
106
- */
107
-
108
- /**
109
- * @template T
110
- * @typedef {AsyncIterableOnly<T, T> & LatestTopic<T>} IterableLatestTopic
111
- * A LatestTopic with default asyncIterable behaviour.
112
- *
113
- * NOTE: the iterators returned by this object are ephemeral and will be severed
114
- * during upgrade. A caller should use `subscribeLatest` to wrap this topic in
115
- * a local iterable which automatically attempts to reconnect upon being
116
- * severed.
117
- */
118
-
119
- /**
120
- * @template T
121
- * @typedef {object} LatestTopic
122
- * @property {(updateCount?: bigint | number) => Promise<UpdateRecord<T>>} getUpdateSince
123
- * Returns a promise for an update record as of an update count.
124
- * If the `updateCount` argument is omitted or differs from the current update count,
125
- * the promise promptly resolves to the current record.
126
- * Otherwise, after the next state change, the promise resolves to the resulting record.
127
- * This is an attenuated form of `subscribeAfter` whose return value stands alone and
128
- * does not allow consumers to pin a chain of historical PublicationRecords.
129
- * Used to make lossy ("latest") iterators.
130
- * NOTE: Use of `number` as an `updateCount` is deprecated.
131
- */
132
-
133
- /**
134
- * @template T
135
- * @typedef {LatestTopic<T>} BaseNotifier This type is deprecated but is still
136
- * used externally.
137
- */
138
-
139
- /**
140
- * @template T
141
- * @typedef {LatestTopic<T> & EachTopic<T>} Subscriber
142
- * A stream of results that allows consumers to configure
143
- * forward-lossless "each" iteration with `subscribeEach` and
144
- * lossy "latest" iteration with `subscribeLatest`.
145
- */
146
-
147
- /**
148
- * @template T
149
- * @typedef {object} Publisher
150
- * A valid sequence of calls to the methods of an `IterationObserver`
151
- * represents an iteration. A valid sequence consists of any number of calls
152
- * to `publish` with the successive non-final values, followed by a
153
- * final call to either `finish` with a successful `completion` value
154
- * or `fail` with the alleged `reason` for failure. After at most one
155
- * terminating calls, no further calls to these methods are valid and must be
156
- * rejected.
157
- * @property {(nonFinalValue: T) => void} publish
158
- * @property {(completion: T) => void} finish
159
- * @property {(reason: any) => void} fail
160
- */
161
-
162
- /**
163
- * @template T
164
- * @typedef {Partial<Publisher<T>>} PublishObserver
165
- */
166
-
167
- /**
168
- * @template T
169
- * @typedef {object} PublishKit<T>
170
- * @property {Publisher<T>} publisher
171
- * @property {Subscriber<T>} subscriber
172
- */
173
-
174
- /**
175
- * @template T
176
- * @typedef {object} StoredPublishKit<T>
177
- * @property {Publisher<T>} publisher
178
- * @property {StoredSubscriber<T>} subscriber
179
- */
180
-
181
- // /////////////////////////////////////////////////////////////////////////////
182
-
183
- /**
184
- * @typedef {'mandatory' | 'opportunistic' | 'ignored'} DurablePublishKitValueDurability
185
- *
186
- * Durability configures constraints on non-terminal values that can be
187
- * published to a durable publish kit (terminal values sent to finish or fail
188
- * must always be durable).
189
- * - 'mandatory' means that each value must be durable, so it can be restored
190
- * on upgrade.
191
- * - 'opportunistic' means that a durable value is persisted for post-upgrade
192
- * restoration, but a non-durable value is still accepted (and will result in
193
- * valueless restoration).
194
- * - 'ignored' means that a value is not persisted for restoration even if it
195
- * is durable.
196
- *
197
- * 'mandatory' is the only currently-supported value, and others must not be
198
- * enabled without test coverage.
199
- */
200
-
201
- /**
202
- * @typedef {object} DurablePublishKitState
203
- *
204
- * @property {DurablePublishKitValueDurability} valueDurability
205
- *
206
- * @property {bigint} publishCount
207
- *
208
- * @property {'live' | 'finished' | 'failed'} status
209
- *
210
- * @property {boolean} hasValue
211
- * hasValue indicates the presence of value. It starts off false,
212
- * and can be reset to false when a durable publish kit is restored and
213
- * the previous value was not durable, or non-terminal and valueDurablity is 'ignored'.
214
- *
215
- * @property {any} value
216
- * value holds either a non-terminal value from `publish` or a terminal value
217
- * from `finish` or `fail`, depending upon the value in status.
218
- */
219
-
220
- // /////////////////////////////////////////////////////////////////////////////
221
-
222
- /**
223
- * @template T
224
- * @typedef {object} UpdateRecord<T>
225
- * @property {T} value is whatever state the service wants to publish
226
- * @property {bigint} [updateCount] is a value that identifies the update. For
227
- * the last update, it is `undefined`.
228
- */
229
-
230
- /**
231
- * @template T
232
- * @typedef {BaseNotifier<T>} NotifierInternals Will be shared between machines,
233
- * so it must be safe to expose. But other software should avoid depending on
234
- * its internal structure.
235
- */
236
-
237
- /**
238
- * @template T
239
- * @typedef {NotifierInternals<T> &
240
- * ForkableAsyncIterable<T, T> &
241
- * SharableNotifier<T>
242
- * } Notifier<T> an object that can be used to get the current state or updates
243
- */
244
-
245
- /**
246
- * @template T
247
- * @typedef {object} SharableNotifier
248
- * @property {() => Promise<NotifierInternals<T>>} getSharableNotifierInternals
249
- * Used to replicate the multicast values at other sites. To manually create a
250
- * local representative of a Notification, do
251
- * ```js
252
- * localIterable =
253
- * makeNotifier(E(remoteIterable).getSharableNotifierInternals());
254
- * ```
255
- * The resulting `localIterable` also supports such remote use, and
256
- * will return access to the same representation.
257
- */
258
-
259
- /**
260
- * @template T
261
- * @typedef {object} NotifierRecord<T> the produced notifier/updater pair
262
- * @property {IterationObserver<T>} updater the (closely-held) notifier producer
263
- * @property {Notifier<T>} notifier the (widely-held) notifier consumer
264
- */
265
-
266
- // /////////////////////////////////////////////////////////////////////////////
267
-
268
- /**
269
- * @template T
270
- * @typedef {IterableEachTopic<T> & EachTopic<T> &
271
- * SharableSubscription<T>} Subscription<T>
272
- * A form of AsyncIterable supporting distributed and multicast usage.
273
- */
274
-
275
- /**
276
- * @template T
277
- * @typedef {object} SharableSubscription
278
- * @property {() => Promise<EachTopic<T>>} getSharableSubscriptionInternals
279
- * Used to replicate the multicast values at other sites. To manually create a
280
- * local representative of a Subscription, do
281
- * ```js
282
- * localIterable =
283
- * makeSubscription(E(remoteIterable).getSharableSubscriptionInternals());
284
- * ```
285
- * The resulting `localIterable` also supports such remote use, and
286
- * will return access to the same representation.
287
- */
288
-
289
- /**
290
- * @template T
291
- * @typedef {object} SubscriptionRecord<T>
292
- * @property {IterationObserver<T>} publication
293
- * @property {Subscription<T>} subscription
294
- */
295
-
296
- // /////////////////////////////////////////////////////////////////////////////
297
-
298
- /** @template [Slot=unknown] @typedef {import('@endo/marshal').Marshal<Slot>} Marshaller */
299
- /** @typedef {Pick<Marshaller, 'fromCapData'>} Unserializer */
300
-
301
- /**
302
- * Defined by vstorageStoreKey in vstorage.go
303
- *
304
- * @typedef VStorageKey
305
- * @property {string} storeName
306
- * @property {string} storeSubkey
307
- * @property {string} dataPrefixBytes
308
- * @property {string} [noDataValue]
309
- */
310
-
311
- /**
312
- * This represents a node in an IAVL tree.
313
- *
314
- * The active implementation is x/vstorage, an Agoric extension of the Cosmos SDK.
315
- *
316
- * Vstorage is a hierarchical externally-reachable storage structure that
317
- * identifies children by restricted ASCII name and is associated with arbitrary
318
- * string-valued data for each node, defaulting to the empty string.
319
- *
320
- * @typedef {object} StorageNode
321
- * @property {(data: string) => Promise<void>} setValue publishes some data (append to the node)
322
- * @property {() => string} getPath the chain storage path at which the node was constructed
323
- * @property {() => Promise<VStorageKey>} getStoreKey DEPRECATED use getPath
324
- * @property {(subPath: string, options?: {sequence?: boolean}) => StorageNode} makeChildNode
325
- */
326
-
327
- /**
328
- * @typedef {object} StoredFacet
329
- * @property {() => Promise<string>} getPath the chain storage path at which the node was constructed
330
- * @property {StorageNode['getStoreKey']} getStoreKey DEPRECATED use getPath
331
- * @property {() => Unserializer} getUnserializer get the unserializer for the stored data
332
- */
333
-
334
- /**
335
- * @deprecated use StoredSubscriber
336
- * @template T
337
- * @typedef {Subscription<T> & {
338
- * getStoreKey: () => Promise<VStorageKey & { subscription: Subscription<T> }>,
339
- * getUnserializer: () => Unserializer,
340
- * }} StoredSubscription
341
- */
342
-
343
- /**
344
- * @template T
345
- * @typedef {Subscriber<T> & StoredFacet} StoredSubscriber
346
- */