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