@agoric/vow 0.1.1-dev-459998d.0 → 0.1.1-dev-aa68d8f.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/vow",
3
- "version": "0.1.1-dev-459998d.0+459998d",
3
+ "version": "0.1.1-dev-aa68d8f.0+aa68d8f",
4
4
  "description": "Remote (shortening and disconnection-tolerant) Promise-likes",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -20,8 +20,8 @@
20
20
  "lint:types": "tsc"
21
21
  },
22
22
  "dependencies": {
23
- "@agoric/base-zone": "0.1.1-dev-459998d.0+459998d",
24
- "@agoric/internal": "0.3.3-dev-459998d.0+459998d",
23
+ "@agoric/base-zone": "0.1.1-dev-aa68d8f.0+aa68d8f",
24
+ "@agoric/internal": "0.3.3-dev-aa68d8f.0+aa68d8f",
25
25
  "@endo/env-options": "^1.1.3",
26
26
  "@endo/eventual-send": "^1.2.1",
27
27
  "@endo/pass-style": "^1.3.1",
@@ -49,5 +49,5 @@
49
49
  "typeCoverage": {
50
50
  "atLeast": 89.21
51
51
  },
52
- "gitHead": "459998d3944d5ad9d495de146a6322aedcdd06d0"
52
+ "gitHead": "aa68d8fba19087b3a2c72bd59f6f9e47e34ffe1b"
53
53
  }
package/src/E.d.ts CHANGED
@@ -1,6 +1,9 @@
1
1
  export default makeE;
2
2
  export type Callable = (...args: any[]) => any;
3
- export type EProxy = ReturnType<(<A = {}, U extends (x: any) => Promise<any> = (x: any) => Promise<any>>(HandledPromise: import("@endo/eventual-send").HandledPromiseConstructor, { additional, unwrap, }?: {
3
+ export type EProxy = ReturnType<(<A = {}, U extends (x: any) => Promise<any> = (x: any) => Promise<any>>(HandledPromise: {
4
+ new <R>(executor: HandledExecutor<R>, unfulfilledHandler?: Handler<Promise<unknown>>): Promise<R>;
5
+ prototype: Promise<unknown>;
6
+ } & PromiseConstructor & import("@endo/eventual-send").HandledPromiseStaticMethods, { additional, unwrap, }?: {
4
7
  unwrap?: U | undefined;
5
8
  additional?: A | undefined;
6
9
  } | undefined) => (<T>(x: T) => ECallableOrMethods<RemoteFunctions<T>>) & {
@@ -41,15 +44,15 @@ export type EProxy = ReturnType<(<A = {}, U extends (x: any) => Promise<any> = (
41
44
  * unwrapped(x).then(onfulfilled, onrejected)
42
45
  *
43
46
  * @template T
44
- * @template [TResult1=import('./types.js').Unwrap<T>]
47
+ * @template [TResult1=Unwrap<T>]
45
48
  * @template [TResult2=never]
46
49
  * @param {ERef<T>} x value to convert to a handled promise
47
- * @param {(value: import('./types.js').Unwrap<T>) => ERef<TResult1>} [onfulfilled]
50
+ * @param {(value: Unwrap<T>) => ERef<TResult1>} [onfulfilled]
48
51
  * @param {(reason: any) => ERef<TResult2>} [onrejected]
49
52
  * @returns {Promise<TResult1 | TResult2>}
50
53
  * @readonly
51
54
  */
52
- readonly when: <T_4, TResult1 = import("./types.js").Unwrap<T_4>, TResult2 = never>(x: ERef<T_4>, onfulfilled?: ((value: import("./types.js").Unwrap<T_4>) => ERef<TResult1>) | undefined, onrejected?: ((reason: any) => ERef<TResult2>) | undefined) => Promise<TResult1 | TResult2>;
55
+ readonly when: <T_4, TResult1 = Unwrap<T_4>, TResult2 = never>(x: ERef<T_4>, onfulfilled?: ((value: Unwrap<T_4>) => ERef<TResult1>) | undefined, onrejected?: ((reason: any) => ERef<TResult2>) | undefined) => Promise<TResult1 | TResult2>;
53
56
  } & A)>;
54
57
  /**
55
58
  * `DataOnly<T>` means to return a record type `T2` consisting only of
@@ -57,7 +60,7 @@ export type EProxy = ReturnType<(<A = {}, U extends (x: any) => Promise<any> = (
57
60
  */
58
61
  export type DataOnly<T> = Omit<T, FilteredKeys<T, Callable>>;
59
62
  export type ERef<T> = PromiseLike<T> | T;
60
- export type ECallable<T extends Callable> = ((...args: Parameters<T>) => Promise<import("./types.js").Unwrap<ReturnType<T>>>);
63
+ export type ECallable<T extends Callable> = (...args: Parameters<T>) => Promise<Unwrap<ReturnType<T>>>;
61
64
  export type EMethods<T> = { readonly [P in keyof T]: T[P] extends Callable ? ECallable<T[P]> : never; };
62
65
  export type EGetters<T> = { readonly [P in keyof T]: T[P] extends PromiseLike<infer U> ? T[P] : Promise<Awaited<T[P]>>; };
63
66
  export type ESendOnlyCallable<T extends Callable> = (...args: Parameters<T>) => Promise<void>;
@@ -83,8 +86,8 @@ export type PickCallable<T> = (T extends Callable ? (...args: Parameters<T>) =>
83
86
  /**
84
87
  * `RemoteFunctions<T>` means to return the functions and properties that are remotely callable.
85
88
  */
86
- export type RemoteFunctions<T> = (T extends import("@endo/eventual-send").RemotableBrand<infer L, infer R> ? PickCallable<R> : Awaited<T> extends import("@endo/eventual-send").RemotableBrand<infer L, infer R> ? PickCallable<R> : Awaited<T> extends import("./types.js").Vow<infer U> ? RemoteFunctions<U> : T extends PromiseLike<infer U> ? Awaited<T> : T);
87
- export type LocalRecord<T> = (T extends import("@endo/eventual-send").RemotableBrand<infer L, infer R> ? L : Awaited<T> extends import("@endo/eventual-send").RemotableBrand<infer L, infer R> ? L : Awaited<T> extends import("./types.js").Vow<infer U> ? LocalRecord<U> : T extends PromiseLike<infer U> ? Awaited<T> : T);
89
+ export type RemoteFunctions<T> = T extends RemotableBrand<infer L, infer R> ? PickCallable<R> : Awaited<T> extends RemotableBrand<infer L_1, infer R_1> ? PickCallable<R_1> : Awaited<T> extends Vow<infer U> ? RemoteFunctions<U> : T extends PromiseLike<infer U_1> ? Awaited<T> : T;
90
+ export type LocalRecord<T> = T extends RemotableBrand<infer L, infer R> ? L : Awaited<T> extends RemotableBrand<infer L_1, infer R_1> ? L_1 : Awaited<T> extends Vow<infer U> ? LocalRecord<U> : T extends PromiseLike<infer U_1> ? Awaited<T> : T;
88
91
  /**
89
92
  * Type for an object that must only be invoked with E. It supports a given
90
93
  * interface but declares all the functions as asyncable.
@@ -93,12 +96,15 @@ export type EOnly<T> = (T extends Callable ? (...args: Parameters<T>) => ERef<Aw
93
96
  /**
94
97
  * @template [A={}]
95
98
  * @template {(x: any) => Promise<any>} [U=(x: any) => Promise<any>]
96
- * @param {import('@endo/eventual-send').HandledPromiseConstructor} HandledPromise
99
+ * @param {HandledPromiseConstructor} HandledPromise
97
100
  * @param {object} [powers]
98
101
  * @param {U} [powers.unwrap]
99
102
  * @param {A} [powers.additional]
100
103
  */
101
- declare function makeE<A = {}, U extends (x: any) => Promise<any> = (x: any) => Promise<any>>(HandledPromise: import("@endo/eventual-send").HandledPromiseConstructor, { additional, unwrap, }?: {
104
+ declare function makeE<A = {}, U extends (x: any) => Promise<any> = (x: any) => Promise<any>>(HandledPromise: {
105
+ new <R>(executor: HandledExecutor<R>, unfulfilledHandler?: Handler<Promise<unknown>>): Promise<R>;
106
+ prototype: Promise<unknown>;
107
+ } & PromiseConstructor & import("@endo/eventual-send").HandledPromiseStaticMethods, { additional, unwrap, }?: {
102
108
  unwrap?: U | undefined;
103
109
  additional?: A | undefined;
104
110
  } | undefined): (<T>(x: T) => ECallableOrMethods<RemoteFunctions<T>>) & {
@@ -139,14 +145,17 @@ declare function makeE<A = {}, U extends (x: any) => Promise<any> = (x: any) =>
139
145
  * unwrapped(x).then(onfulfilled, onrejected)
140
146
  *
141
147
  * @template T
142
- * @template [TResult1=import('./types.js').Unwrap<T>]
148
+ * @template [TResult1=Unwrap<T>]
143
149
  * @template [TResult2=never]
144
150
  * @param {ERef<T>} x value to convert to a handled promise
145
- * @param {(value: import('./types.js').Unwrap<T>) => ERef<TResult1>} [onfulfilled]
151
+ * @param {(value: Unwrap<T>) => ERef<TResult1>} [onfulfilled]
146
152
  * @param {(reason: any) => ERef<TResult2>} [onrejected]
147
153
  * @returns {Promise<TResult1 | TResult2>}
148
154
  * @readonly
149
155
  */
150
- readonly when: <T_4, TResult1 = import("./types.js").Unwrap<T_4>, TResult2 = never>(x: ERef<T_4>, onfulfilled?: ((value: import("./types.js").Unwrap<T_4>) => ERef<TResult1>) | undefined, onrejected?: ((reason: any) => ERef<TResult2>) | undefined) => Promise<TResult1 | TResult2>;
156
+ readonly when: <T_4, TResult1 = Unwrap<T_4>, TResult2 = never>(x: ERef<T_4>, onfulfilled?: ((value: Unwrap<T_4>) => ERef<TResult1>) | undefined, onrejected?: ((reason: any) => ERef<TResult2>) | undefined) => Promise<TResult1 | TResult2>;
151
157
  } & A;
158
+ import type { Unwrap } from './types.js';
159
+ import type { RemotableBrand } from '@endo/eventual-send';
160
+ import type { Vow } from './types.js';
152
161
  //# sourceMappingURL=E.d.ts.map
package/src/E.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"E.d.ts","sourceRoot":"","sources":["E.js"],"names":[],"mappings":";uBASc,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG;qBAyRvB,UAAU,yBA1GN,GAAG,wBAA0B,GAAG,mCACvC,OAAO,qBAAqB,EAAE,yBAAyB;;;oBAoBjD,CAAC,KAAD,CAAC;IAQV;;;;;;;;;;OAUG;mBAHQ,GAAC,KAAD,GAAC;IAYZ;;;;;;;;OAQG;uBAHQ,GAAC,KAAD,GAAC;IAMZ;;;;;;;;OAQG;wBAHQ,GAAC,KAAD,GAAC;IAYZ;;;;;;;;;;;;OAYG;oBAJ4C,GAAC,oEADrC,IAAI,CACgC,GAAC,AAD/B,CAAC,yBACC,OAAO,YAAY,EAAE,MAAM,CAAC,GAAC,CAAC,yDAC7B,GAAG;OAqBA;;;;;qBAOG,CAAC,IAAtB,IAAI,CAAiB,CAAC,AAAhB,EAAE,YAAY,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;iBAMjB,CAAC,IAAlB,WAAW,CAAM,CAAC,AAAL,CAAC,GAAG,CAAC;sBAMiD,CAAC,qBADpE,CACZ,CAAK,GAAG,IAAI,EAAE,UAAU,CAAuD,CAAC,AAAtD,CAAC,KAAK,OAAO,CAAC,OAAO,YAAY,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAChF;q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lB,KACC,OAAO,CAAC,OAAO,CAAC,GAAC,CAAC,CAAC;IAKhC;;;;;;;;OAQG;wBAFqD,GAAC,KAAD,GAAC,AAD7C,KACC,0BAA0B,CAAC,eAAe,CAAC,GAAC,CAAC,CAAC;IAW3D;;;;;;;;;;;;OAYG;oBAJuB,GAAC,EAEN,QAAQ,gBAAG,QAAQ,aAH7B,IAAI,CACW,GAAC,AADV,CAAC,yCACe,IAAI,CAEhB,QAAQ,AAFiB,CAAC,sCAC3B,GAAG,KAAK,IAAI,CACA,QAAQ,AADC,CAAC,kBAC7B,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;MAgBhD;4BAvR+B,YAAY;oCADkB,qBAAqB;yBACnD,YAAY"}
package/src/E.js CHANGED
@@ -7,6 +7,10 @@ const { assign, create } = Object;
7
7
 
8
8
  const onSend = makeMessageBreakpointTester('ENDO_SEND_BREAKPOINTS');
9
9
 
10
+ /**
11
+ * @import { HandledPromiseConstructor, RemotableBrand } from '@endo/eventual-send'
12
+ * @import { Unwrap, Vow } from './types.js'
13
+ */
10
14
  /** @typedef {(...args: any[]) => any} Callable */
11
15
 
12
16
  /** @type {ProxyHandler<any>} */
@@ -38,7 +42,7 @@ const baseFreezableProxyHandler = {
38
42
  * A Proxy handler for E(x).
39
43
  *
40
44
  * @param {any} recipient Any value passed to E(x)
41
- * @param {import('@endo/eventual-send').HandledPromiseConstructor} HandledPromise
45
+ * @param {HandledPromiseConstructor} HandledPromise
42
46
  * @param {(x: any) => Promise<any>} unwrap
43
47
  * @returns {ProxyHandler<any>} the Proxy handler
44
48
  */
@@ -103,7 +107,7 @@ const makeEProxyHandler = (recipient, HandledPromise, unwrap) =>
103
107
  * It is a variant on the E(x) Proxy handler.
104
108
  *
105
109
  * @param {any} recipient Any value passed to E.sendOnly(x)
106
- * @param {import('@endo/eventual-send').HandledPromiseConstructor} HandledPromise
110
+ * @param {HandledPromiseConstructor} HandledPromise
107
111
  * @param {(x: any) => Promise<any>} unwrap
108
112
  * @returns {ProxyHandler<any>} the Proxy handler
109
113
  */
@@ -166,7 +170,7 @@ const makeESendOnlyProxyHandler = (recipient, HandledPromise, unwrap) =>
166
170
  * It is a variant on the E(x) Proxy handler.
167
171
  *
168
172
  * @param {any} x Any value passed to E.get(x)
169
- * @param {import('@endo/eventual-send').HandledPromiseConstructor} HandledPromise
173
+ * @param {HandledPromiseConstructor} HandledPromise
170
174
  * @param {(x: any) => Promise<any>} unwrap
171
175
  * @returns {ProxyHandler<any>} the Proxy handler
172
176
  */
@@ -183,7 +187,7 @@ const resolve = x => HandledPromise.resolve(x);
183
187
  /**
184
188
  * @template [A={}]
185
189
  * @template {(x: any) => Promise<any>} [U=(x: any) => Promise<any>]
186
- * @param {import('@endo/eventual-send').HandledPromiseConstructor} HandledPromise
190
+ * @param {HandledPromiseConstructor} HandledPromise
187
191
  * @param {object} [powers]
188
192
  * @param {U} [powers.unwrap]
189
193
  * @param {A} [powers.additional]
@@ -263,10 +267,10 @@ const makeE = (
263
267
  * unwrapped(x).then(onfulfilled, onrejected)
264
268
  *
265
269
  * @template T
266
- * @template [TResult1=import('./types.js').Unwrap<T>]
270
+ * @template [TResult1=Unwrap<T>]
267
271
  * @template [TResult2=never]
268
272
  * @param {ERef<T>} x value to convert to a handled promise
269
- * @param {(value: import('./types.js').Unwrap<T>) => ERef<TResult1>} [onfulfilled]
273
+ * @param {(value: Unwrap<T>) => ERef<TResult1>} [onfulfilled]
270
274
  * @param {(reason: any) => ERef<TResult2>} [onrejected]
271
275
  * @returns {Promise<TResult1 | TResult2>}
272
276
  * @readonly
@@ -307,7 +311,7 @@ export default makeE;
307
311
  /**
308
312
  * @template {Callable} T
309
313
  * @typedef {(
310
- * (...args: Parameters<T>) => Promise<import('./types.js').Unwrap<ReturnType<T>>>
314
+ * (...args: Parameters<T>) => Promise<Unwrap<ReturnType<T>>>
311
315
  * )} ECallable
312
316
  */
313
317
 
@@ -393,11 +397,11 @@ export default makeE;
393
397
  *
394
398
  * @template T
395
399
  * @typedef {(
396
- * T extends import('@endo/eventual-send').RemotableBrand<infer L, infer R> // if a given T is some remote interface R
400
+ * T extends RemotableBrand<infer L, infer R> // if a given T is some remote interface R
397
401
  * ? PickCallable<R> // then return the callable properties of R
398
- * : Awaited<T> extends import('@endo/eventual-send').RemotableBrand<infer L, infer R> // otherwise, if the final resolution of T is some remote interface R
402
+ * : Awaited<T> extends RemotableBrand<infer L, infer R> // otherwise, if the final resolution of T is some remote interface R
399
403
  * ? PickCallable<R> // then return the callable properties of R
400
- * : Awaited<T> extends import('./types.js').Vow<infer U>
404
+ * : Awaited<T> extends Vow<infer U>
401
405
  * ? RemoteFunctions<U> // then extract the remotable functions of U
402
406
  * : T extends PromiseLike<infer U> // otherwise, if T is a promise
403
407
  * ? Awaited<T> // then return resolved value T
@@ -408,11 +412,11 @@ export default makeE;
408
412
  /**
409
413
  * @template T
410
414
  * @typedef {(
411
- * T extends import('@endo/eventual-send').RemotableBrand<infer L, infer R>
415
+ * T extends RemotableBrand<infer L, infer R>
412
416
  * ? L
413
- * : Awaited<T> extends import('@endo/eventual-send').RemotableBrand<infer L, infer R>
417
+ * : Awaited<T> extends RemotableBrand<infer L, infer R>
414
418
  * ? L
415
- * : Awaited<T> extends import('./types.js').Vow<infer U>
419
+ * : Awaited<T> extends Vow<infer U>
416
420
  * ? LocalRecord<U>
417
421
  * : T extends PromiseLike<infer U>
418
422
  * ? Awaited<T>
package/src/tools.d.ts CHANGED
@@ -1,9 +1,10 @@
1
- export function prepareVowTools(zone: import("@agoric/base-zone").Zone, powers?: {
1
+ export function prepareVowTools(zone: Zone, powers?: {
2
2
  isRetryableReason?: ((reason: any) => boolean) | undefined;
3
3
  } | undefined): {
4
4
  when: <T, TResult1 = import("./types.js").Unwrap<T>, TResult2 = never>(specimenP: T, onFulfilled?: ((value: import("./types.js").Unwrap<T>) => TResult1 | PromiseLike<TResult1>) | undefined, onRejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined) => Promise<TResult1 | TResult2>;
5
- watch: <T_1 = unknown, TResult1_1 = T_1, TResult2_1 = T_1, C = unknown>(specimenP: import("./types.js").ERef<T_1 | import("./types.js").Vow<T_1>>, watcher?: import("./types.js").Watcher<T_1, TResult1_1, TResult2_1, any> | undefined, watcherContext?: C | undefined) => import("./types.js").Vow<TResult1_1 | TResult2_1>;
5
+ watch: <T_1 = unknown, TResult1_1 = T_1, TResult2_1 = T_1, C = unknown>(specimenP: import("./types.js").ERef<T_1 | import("./types.js").Vow<T_1>>, watcher?: import("./types.js").Watcher<T_1, TResult1_1, TResult2_1> | undefined, watcherContext?: C | undefined) => import("./types.js").Vow<TResult1_1 | TResult2_1>;
6
6
  makeVowKit: <T_2>() => import("./types.js").VowKit<T_2>;
7
7
  allVows: (vows: any) => import("./types.js").Vow<any>;
8
8
  };
9
+ import type { Zone } from '@agoric/base-zone';
9
10
  //# sourceMappingURL=tools.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["tools.js"],"names":[],"mappings":"AAWO,sCAJI,OAAO,mBAAmB,EAAE,IAAI;kCAEvB,GAAG,KAAK,OAAO;;sFAEU,CAAC,yBACR,OAAQ,YAC1C,EAAE,MAAM,CAAC,CAAC,CAAC;uFAWwtG,OAAO,YAAY,EAAE,IAAI,CAAC,GAAC,GAAE,OAAQ,YAAY,EAAE,GAAG,CAAC,GAAC,CAAC,CAAC;;;EAFhyG"}
1
+ {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["tools.js"],"names":[],"mappings":"AAaO;kCAFa,GAAG,KAAK,OAAO;;sFAEc,CAAC;;;;EAWjD;0BAlBuB,mBAAmB"}
package/src/tools.js CHANGED
@@ -4,8 +4,10 @@ import { prepareVowKit } from './vow.js';
4
4
  import { prepareWatch } from './watch.js';
5
5
  import { prepareWatchUtils } from './watch-utils.js';
6
6
 
7
+ /** @import {Zone} from '@agoric/base-zone' */
8
+
7
9
  /**
8
- * @param {import('@agoric/base-zone').Zone} zone
10
+ * @param {Zone} zone
9
11
  * @param {object} [powers]
10
12
  * @param {(reason: any) => boolean} [powers.isRetryableReason]
11
13
  */
package/src/types.d.ts CHANGED
@@ -17,12 +17,13 @@ export type DataOnly<T> = (IsPrimitive<T> extends true ? T : T extends Callable
17
17
  * Follow the chain of vow shortening to the end, returning the final value.
18
18
  * This is used within E, so we must narrow the type to its remote form.
19
19
  */
20
- export type Unwrap<T> = (T extends PromiseLike<infer U> ? Unwrap<U> : T extends import("./types").Vow<infer U> ? Unwrap<U> : IsPrimitive<T> extends true ? T : T extends import("@endo/eventual-send").RemotableBrand<infer Local, infer Primary> ? Local & T : T);
20
+ export type Unwrap<T> = T extends PromiseLike<infer U> ? Unwrap<U> : T extends Vow<infer U_1> ? Unwrap<U_1> : IsPrimitive<T> extends true ? T : T extends RemotableBrand<infer Local, infer Primary> ? Local & T : T;
21
21
  /**
22
- * A type that doesn't assume its parameter is local, but is
23
- * satisfied with both local and remote references.
22
+ * A type that
23
+ * doesn't assume its parameter is local, but is satisfied with both local
24
+ * and remote references.
24
25
  */
25
- export type Remote<Primary, Local = DataOnly<Primary>> = Primary | import("@endo/eventual-send").RemotableBrand<Local, Primary>;
26
+ export type Remote<Primary, Local = DataOnly<Primary>> = Primary | RemotableBrand<Local, Primary>;
26
27
  /**
27
28
  * The first version of the vow implementation
28
29
  * object. CAVEAT: These methods must never be changed or added to, to provide
@@ -41,7 +42,11 @@ export type VowV0<T = any> = {
41
42
  export type VowPayload<T = any> = {
42
43
  vowV0: Remote<VowV0<T>>;
43
44
  };
44
- export type Vow<T = any> = import("@endo/pass-style").CopyTagged<"Vow", VowPayload<T>>;
45
+ export type Vow<T = any> = {
46
+ [passStyle: symbol]: string;
47
+ payload: VowPayload<T>;
48
+ [Symbol.toStringTag]: "Vow";
49
+ };
45
50
  export type VowKit<T = any> = {
46
51
  vow: Vow<T>;
47
52
  resolver: VowResolver<T>;
@@ -59,13 +64,12 @@ export type Watcher<T = any, TResult1 = T, TResult2 = T, C = any> = {
59
64
  onFulfilled?: ((value: T, context?: C) => Vow<TResult1> | PromiseVow<TResult1> | TResult1) | undefined;
60
65
  onRejected?: ((reason: any) => Vow<TResult2> | PromiseVow<TResult2> | TResult2) | undefined;
61
66
  };
62
- export type Specimen<T = any> = import("./types.js").ERef<T | import("./types.js").Vow<T>>;
63
- export type VowTools = ReturnType<(zone: import("@agoric/base-zone").Zone, powers?: {
64
- isRetryableReason?: ((reason: any) => boolean) | undefined;
65
- } | undefined) => {
66
- when: <T, TResult1 = Unwrap<T>, TResult2 = never>(specimenP: T, onFulfilled?: ((value: import("./types").Unwrap<T>) => TResult1 | PromiseLike<TResult1>) | undefined, onRejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined) => Promise<TResult1 | TResult2>;
67
- watch: <T_1 = unknown, TResult1_1 = T_1, TResult2_1 = T_1, C = unknown>(specimenP: import("./types").ERef<T_1 | import("./types").Vow<T_1>>, watcher?: Watcher<T_1, TResult1_1, TResult2_1, any> | undefined, watcherContext?: C | undefined) => Vow<TResult1_1 | TResult2_1>;
67
+ export type Specimen<T = any> = ERef<T | Vow<T>>;
68
+ export type VowTools = {
69
+ when: <T, TResult1 = Unwrap<T>, TResult2 = never>(specimenP: T, onFulfilled?: ((value: Unwrap<T>) => TResult1 | PromiseLike<TResult1>) | undefined, onRejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined) => Promise<TResult1 | TResult2>;
70
+ watch: <T_1 = unknown, TResult1_1 = T_1, TResult2_1 = T_1, C = unknown>(specimenP: ERef<T_1 | Vow<T_1>>, watcher?: Watcher<T_1, TResult1_1, TResult2_1> | undefined, watcherContext?: C | undefined) => Vow<TResult1_1 | TResult2_1>;
68
71
  makeVowKit: <T_2>() => VowKit<T_2>;
69
72
  allVows: (vows: any) => Vow<any>;
70
- }>;
73
+ };
74
+ import type { RemotableBrand } from '@endo/eventual-send';
71
75
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","source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CopyTagged} from '@endo/pass-style'
7
+ * @import {prepareVowTools} from './tools.js'
8
+ */
9
+
4
10
  /** @typedef {(...args: any[]) => any} Callable */
5
11
 
6
12
  /**
@@ -43,9 +49,9 @@ export {};
43
49
  * @template T
44
50
  * @typedef {(
45
51
  * T extends PromiseLike<infer U> ? Unwrap<U> :
46
- * T extends import('./types').Vow<infer U> ? Unwrap<U> :
52
+ * T extends Vow<infer U> ? Unwrap<U> :
47
53
  * IsPrimitive<T> extends true ? T :
48
- * T extends import('@endo/eventual-send').RemotableBrand<infer Local, infer Primary> ? Local & T :
54
+ * T extends RemotableBrand<infer Local, infer Primary> ? Local & T :
49
55
  * T
50
56
  * )} Unwrap
51
57
  */
@@ -55,10 +61,9 @@ export {};
55
61
  * returned from `Remotable` or `Far`.
56
62
  * @template Primary The type of the primary reference.
57
63
  * @template [Local=DataOnly<Primary>] The local properties of the object.
58
- * @typedef {Primary |
59
- * import('@endo/eventual-send').RemotableBrand<Local, Primary>
60
- * } Remote A type that doesn't assume its parameter is local, but is
61
- * satisfied with both local and remote references.
64
+ * @typedef {Primary | RemotableBrand<Local, Primary>} Remote A type that
65
+ * doesn't assume its parameter is local, but is satisfied with both local
66
+ * and remote references.
62
67
  */
63
68
 
64
69
  /**
@@ -82,9 +87,7 @@ export {};
82
87
 
83
88
  /**
84
89
  * @template [T=any]
85
- * @typedef {import('@endo/pass-style').CopyTagged<
86
- * 'Vow', VowPayload<T>
87
- * >} Vow
90
+ * @typedef {CopyTagged<'Vow', VowPayload<T>>} Vow
88
91
  */
89
92
 
90
93
  /**
@@ -121,7 +124,7 @@ export {};
121
124
 
122
125
  /**
123
126
  * @template [T=any]
124
- * @typedef {import('./types.js').ERef<T | import('./types.js').Vow<T>>} Specimen
127
+ * @typedef {ERef<T | Vow<T>>} Specimen
125
128
  */
126
129
 
127
- /** @typedef {ReturnType<import('./tools.js').prepareVowTools>} VowTools */
130
+ /** @typedef {ReturnType<typeof prepareVowTools>} VowTools */
@@ -1,6 +1,7 @@
1
1
  export { basicE };
2
2
  export const VowShape: import("@endo/patterns").Matcher;
3
3
  export function isVow(specimen: any): boolean;
4
- export function getVowPayload<T>(specimen: any): import("./types").VowPayload<T> | undefined;
4
+ export function getVowPayload<T>(specimen: any): VowPayload<T> | undefined;
5
5
  import { E as basicE } from '@endo/eventual-send';
6
+ import type { VowPayload } from './types';
6
7
  //# sourceMappingURL=vow-utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"vow-utils.d.ts","sourceRoot":"","sources":["vow-utils.js"],"names":[],"mappings":";AAOA,wDAKE;AAEK,8CAC8C;AAc9C,8BAFmC,CAAC,YADhC,GAAG,GACD,OAAO,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,SAAS,CAWvD;4BArC2B,qBAAqB"}
1
+ {"version":3,"file":"vow-utils.d.ts","sourceRoot":"","sources":["vow-utils.js"],"names":[],"mappings":";AASA,wDAKE;AAEK,8CAC8C;AAc9C,8BAFiB,CAAC,YADd,GAAG,6BAUb;4BArC2B,qBAAqB;gCAId,SAAS"}
package/src/vow-utils.js CHANGED
@@ -3,6 +3,8 @@ import { E as basicE } from '@endo/eventual-send';
3
3
  import { isPassable } from '@endo/pass-style';
4
4
  import { M, matches } from '@endo/patterns';
5
5
 
6
+ /** @import {VowPayload, Vow} from './types' */
7
+
6
8
  export { basicE };
7
9
 
8
10
  export const VowShape = M.tagged(
@@ -25,16 +27,14 @@ harden(isVow);
25
27
  *
26
28
  * @template T
27
29
  * @param {any} specimen any value to verify as a vow
28
- * @returns {import('./types').VowPayload<T> | undefined} undefined if specimen is not a vow, otherwise the vow's payload.
30
+ * @returns {VowPayload<T> | undefined} undefined if specimen is not a vow, otherwise the vow's payload.
29
31
  */
30
32
  export const getVowPayload = specimen => {
31
33
  if (!isVow(specimen)) {
32
34
  return undefined;
33
35
  }
34
36
 
35
- const vow = /** @type {import('./types').Vow<T>} */ (
36
- /** @type {unknown} */ (specimen)
37
- );
37
+ const vow = /** @type {Vow<T>} */ (/** @type {unknown} */ (specimen));
38
38
  return vow.payload;
39
39
  };
40
40
  harden(getVowPayload);
package/src/vow.d.ts CHANGED
@@ -1,3 +1,6 @@
1
- export function prepareVowKit(zone: import("@agoric/base-zone").Zone): <T>() => import("./types.js").VowKit<T>;
2
- export type VowEphemera = Partial<import("@endo/promise-kit").PromiseKit<any>> & Pick<import("@endo/promise-kit").PromiseKit<any>, "promise">;
1
+ export function prepareVowKit(zone: Zone): <T>() => VowKit<T>;
2
+ export type VowEphemera = Partial<PromiseKit<any>> & Pick<PromiseKit<any>, "promise">;
3
+ import type { Zone } from '@agoric/base-zone';
4
+ import type { VowKit } from './types.js';
5
+ import type { PromiseKit } from '@endo/promise-kit';
3
6
  //# sourceMappingURL=vow.d.ts.map
package/src/vow.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"vow.d.ts","sourceRoot":"","sources":["vow.js"],"names":[],"mappings":"AAiBO,oCAFI,OAAO,mBAAmB,EAAE,IAAI,IA8GA,CAAC,OAA7B,OAAO,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC,CAS5C;0BA5HY,OAAO,CAAC,OAAO,mBAAmB,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,GAChE,IAAQ,CAAC,OAAO,mBAAmB,EAAE,UAAU,CAAC,GAAG,CAAC,EAAE,SAAS,CAAC"}
1
+ {"version":3,"file":"vow.d.ts","sourceRoot":"","sources":["vow.js"],"names":[],"mappings":"AAuBO,4CA4Ge,CAAC,iBAStB;;0BApIsB,mBAAmB;4BACJ,YAAY;gCAFrB,mBAAmB"}
package/src/vow.js CHANGED
@@ -4,25 +4,31 @@ import { M } from '@endo/patterns';
4
4
  import { makeTagged } from '@endo/pass-style';
5
5
  import { PromiseWatcherI } from '@agoric/base-zone';
6
6
 
7
+ /**
8
+ * @import {PromiseKit} from '@endo/promise-kit'
9
+ * @import {Zone} from '@agoric/base-zone'
10
+ * @import {VowResolver, VowKit} from './types.js'
11
+ */
12
+
7
13
  const sink = () => {};
8
14
  harden(sink);
9
15
 
10
16
  /**
11
- * @typedef {Partial<import('@endo/promise-kit').PromiseKit<any>> &
12
- * Pick<import('@endo/promise-kit').PromiseKit<any>, 'promise'>} VowEphemera
17
+ * @typedef {Partial<PromiseKit<any>> &
18
+ * Pick<PromiseKit<any>, 'promise'>} VowEphemera
13
19
  */
14
20
 
15
21
  /**
16
- * @param {import('@agoric/base-zone').Zone} zone
22
+ * @param {Zone} zone
17
23
  */
18
24
  export const prepareVowKit = zone => {
19
- /** @type {WeakMap<import('./types.js').VowResolver, VowEphemera>} */
25
+ /** @type {WeakMap<VowResolver, VowEphemera>} */
20
26
  const resolverToEphemera = new WeakMap();
21
27
 
22
28
  /**
23
29
  * Get the current incarnation's promise kit associated with a vowV0.
24
30
  *
25
- * @param {import('./types.js').VowResolver} resolver
31
+ * @param {VowResolver} resolver
26
32
  */
27
33
  const provideCurrentKit = resolver => {
28
34
  let pk = resolverToEphemera.get(resolver);
@@ -37,7 +43,7 @@ export const prepareVowKit = zone => {
37
43
  };
38
44
 
39
45
  /**
40
- * @param {import('./types.js').VowResolver} resolver
46
+ * @param {VowResolver} resolver
41
47
  */
42
48
  const getPromiseKitForResolution = resolver => {
43
49
  const kit = provideCurrentKit(resolver);
@@ -123,7 +129,7 @@ export const prepareVowKit = zone => {
123
129
 
124
130
  /**
125
131
  * @template T
126
- * @returns {import('./types.js').VowKit<T>}
132
+ * @returns {VowKit<T>}
127
133
  */
128
134
  const makeVowKit = () => {
129
135
  const { resolver, vowV0 } = makeVowInternalsKit();
@@ -1,8 +1,11 @@
1
- export function prepareWatchUtils(zone: import("@agoric/base-zone").Zone, watch: import("./watch.js").Watch, makeVowKit: () => import("./types.js").VowKit<any>): () => import("@endo/exo").Guarded<{
1
+ export function prepareWatchUtils(zone: Zone, watch: <T = unknown, TResult1 = T, TResult2 = T, C = unknown>(specimenP: import("./types.js").ERef<T | import("./types.js").Vow<T>>, watcher?: import("./types.js").Watcher<T, TResult1, TResult2> | undefined, watcherContext?: C | undefined) => import("./types.js").Vow<TResult1 | TResult2>, makeVowKit: () => VowKit<any>): () => import("@endo/exo").Guarded<{
2
2
  /**
3
3
  * @template [T=any]
4
- * @param {import('./types.js').Specimen<T>[]} vows
4
+ * @param {Specimen<T>[]} vows
5
5
  */
6
- all<T = any>(vows: import("./types.js").Specimen<T>[]): import("./types.js").Vow<any>;
6
+ all<T_1 = any>(vows: Specimen<T_1>[]): import("./types.js").Vow<any>;
7
7
  }>;
8
+ import type { Zone } from '@agoric/base-zone';
9
+ import type { VowKit } from './types.js';
10
+ import type { Specimen } from './types.js';
8
11
  //# sourceMappingURL=watch-utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"watch-utils.d.ts","sourceRoot":"","sources":["watch-utils.js"],"names":[],"mappings":"AAkBO,wCAJI,OAAO,mBAAmB,EAAE,IAAI,SAChC,OAAO,YAAY,EAAE,KAAK,cAC1B,MAAM,OAAO,YAAY,EAAE,MAAM,CAAC,GAAG,CAAC;IAgCzC;;;OAGG;QADsC,CAAC,cAA/B,OAAO,YAAY,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE;GA8EpD"}
1
+ {"version":3,"file":"watch-utils.d.ts","sourceRoot":"","sources":["watch-utils.js"],"names":[],"mappings":"AAuBO;IA8BC;;;OAGG;QADiB,GAAC;GA8E5B;0BA/HwB,mBAAmB;4BAET,YAAY;8BAAZ,YAAY"}
@@ -2,7 +2,12 @@
2
2
 
3
3
  import { M } from '@endo/patterns';
4
4
 
5
- /** @import {MapStore} from '@agoric/store/src/types.js' */
5
+ /**
6
+ * @import {MapStore} from '@agoric/store/src/types.js'
7
+ * @import { Zone } from '@agoric/base-zone'
8
+ * @import { Watch } from './watch.js'
9
+ * @import {Specimen, VowKit} from './types.js'
10
+ */
6
11
 
7
12
  const VowShape = M.tagged(
8
13
  'Vow',
@@ -12,9 +17,9 @@ const VowShape = M.tagged(
12
17
  );
13
18
 
14
19
  /**
15
- * @param {import('@agoric/base-zone').Zone} zone
16
- * @param {import('./watch.js').Watch} watch
17
- * @param {() => import('./types.js').VowKit<any>} makeVowKit
20
+ * @param {Zone} zone
21
+ * @param {Watch} watch
22
+ * @param {() => VowKit<any>} makeVowKit
18
23
  */
19
24
  export const prepareWatchUtils = (zone, watch, makeVowKit) => {
20
25
  const detached = zone.detached();
@@ -34,7 +39,7 @@ export const prepareWatchUtils = (zone, watch, makeVowKit) => {
34
39
  * @typedef {object} VowState
35
40
  * @property {number} remaining
36
41
  * @property {MapStore<number, any>} resultsMap
37
- * @property {import('./types.js').VowKit['resolver']} resolver
42
+ * @property {VowKit['resolver']} resolver
38
43
  */
39
44
  /** @type {MapStore<bigint, VowState>} */
40
45
  const idToVowState = detached.mapStore('idToVowState');
@@ -48,7 +53,7 @@ export const prepareWatchUtils = (zone, watch, makeVowKit) => {
48
53
  utils: {
49
54
  /**
50
55
  * @template [T=any]
51
- * @param {import('./types.js').Specimen<T>[]} vows
56
+ * @param {Specimen<T>[]} vows
52
57
  */
53
58
  all(vows) {
54
59
  const { nextId: id, idToVowState } = this.state;
package/src/watch.d.ts CHANGED
@@ -1,3 +1,8 @@
1
- export function prepareWatch(zone: import("@agoric/base-zone").Zone, makeVowKit: () => import("./types.js").VowKit<any>, isRetryableReason?: ((reason: any) => boolean) | undefined): <T = unknown, TResult1 = T, TResult2 = T, C = unknown>(specimenP: import("./types.js").ERef<T | import("./types.js").Vow<T>>, watcher?: import("./types.js").Watcher<T, TResult1, TResult2, any> | undefined, watcherContext?: C | undefined) => import("./types.js").Vow<TResult1 | TResult2>;
1
+ export function prepareWatch(zone: Zone, makeVowKit: () => VowKit<any>, isRetryableReason?: ((reason: any) => boolean) | undefined): <T = unknown, TResult1 = T, TResult2 = T, C = unknown>(specimenP: ERef<T | Vow<T>>, watcher?: Watcher<T, TResult1, TResult2> | undefined, watcherContext?: C | undefined) => Vow<TResult1 | TResult2>;
2
2
  export type Watch = ReturnType<typeof prepareWatch>;
3
+ import type { Zone } from '@agoric/base-zone';
4
+ import type { VowKit } from './types.js';
5
+ import type { Vow } from './types.js';
6
+ import type { ERef } from './types.js';
7
+ import type { Watcher } from './types.js';
3
8
  //# sourceMappingURL=watch.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"watch.d.ts","sourceRoot":"","sources":["watch.js"],"names":[],"mappings":"AAoHO,mCAJI,OAAO,mBAAmB,EAAE,IAAI,cAChC,MAAM,OAAO,YAAY,EAAE,MAAM,CAAC,GAAG,CAAC,gCAC7B,GAAG,KAAK,OAAO,iBAmBiC,CAAC,gEAAxD,OAAO,YAAY,EAAE,IAAI,CAA8B,CAAC,AAA7B,GAAG,OAAO,YAAY,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,mKAwBtE;oBAIa,UAAU,CAAC,OAAO,YAAY,CAAC"}
1
+ {"version":3,"file":"watch.d.ts","sourceRoot":"","sources":["watch.js"],"names":[],"mappings":"AAyHO,sGAFa,GAAG,KAAK,OAAO,iBAmBT,CAAC,oMAwB1B;oBAIa,UAAU,CAAC,OAAO,YAAY,CAAC;0BA/JJ,mBAAmB;4BACA,YAAY;yBAAZ,YAAY;0BAAZ,YAAY;6BAAZ,YAAY"}
package/src/watch.js CHANGED
@@ -5,7 +5,12 @@ import { getVowPayload, basicE } from './vow-utils.js';
5
5
  const { apply } = Reflect;
6
6
 
7
7
  /**
8
- * @param {import('@agoric/base-zone').Zone} zone
8
+ * @import { PromiseWatcher, Zone } from '@agoric/base-zone';
9
+ * @import { ERef, Vow, VowKit, VowResolver, Watcher } from './types.js';
10
+ */
11
+
12
+ /**
13
+ * @param {Zone} zone
9
14
  */
10
15
  const makeWatchNextStep =
11
16
  zone =>
@@ -15,7 +20,7 @@ const makeWatchNextStep =
15
20
  * (usually durable) watcher object with the promise.
16
21
  *
17
22
  * @param {any} specimen
18
- * @param {import('@agoric/base-zone').PromiseWatcher} promiseWatcher
23
+ * @param {PromiseWatcher} promiseWatcher
19
24
  */
20
25
  (specimen, promiseWatcher) => {
21
26
  let promise;
@@ -29,9 +34,9 @@ const makeWatchNextStep =
29
34
  };
30
35
 
31
36
  /**
32
- * @param {import('./types.js').VowResolver | undefined} resolver
33
- * @param {import('./types.js').Watcher<unknown, unknown, unknown> | undefined} watcher
34
- * @param {keyof Required<import('./types.js').Watcher>} wcb
37
+ * @param {VowResolver | undefined} resolver
38
+ * @param {Watcher<unknown, unknown, unknown> | undefined} watcher
39
+ * @param {keyof Required<Watcher>} wcb
35
40
  * @param {unknown} value
36
41
  * @param {unknown} [watcherContext]
37
42
  */
@@ -56,7 +61,7 @@ const settle = (resolver, watcher, wcb, value, watcherContext) => {
56
61
  };
57
62
 
58
63
  /**
59
- * @param {import('@agoric/base-zone').Zone} zone
64
+ * @param {Zone} zone
60
65
  * @param {(reason: any) => boolean} isRetryableReason
61
66
  * @param {ReturnType<typeof makeWatchNextStep>} watchNextStep
62
67
  */
@@ -68,8 +73,8 @@ const preparePromiseWatcher = (zone, isRetryableReason, watchNextStep) =>
68
73
  * @template [T=any]
69
74
  * @template [TResult1=T]
70
75
  * @template [TResult2=never]
71
- * @param {import('./types.js').VowResolver<TResult1 | TResult2>} resolver
72
- * @param {import('./types.js').Watcher<T, TResult1, TResult2>} [watcher]
76
+ * @param {VowResolver<TResult1 | TResult2>} resolver
77
+ * @param {Watcher<T, TResult1, TResult2>} [watcher]
73
78
  * @param {unknown} [watcherContext]
74
79
  */
75
80
  (resolver, watcher, watcherContext) => {
@@ -82,7 +87,7 @@ const preparePromiseWatcher = (zone, isRetryableReason, watchNextStep) =>
82
87
  return /** @type {Partial<typeof state>} */ (state);
83
88
  },
84
89
  {
85
- /** @type {Required<import('@agoric/base-zone').PromiseWatcher>['onFulfilled']} */
90
+ /** @type {Required<PromiseWatcher>['onFulfilled']} */
86
91
  onFulfilled(value) {
87
92
  const { watcher, watcherContext, resolver } = this.state;
88
93
  if (getVowPayload(value)) {
@@ -95,7 +100,7 @@ const preparePromiseWatcher = (zone, isRetryableReason, watchNextStep) =>
95
100
  this.state.resolver = undefined;
96
101
  settle(resolver, watcher, 'onFulfilled', value, watcherContext);
97
102
  },
98
- /** @type {Required<import('@agoric/base-zone').PromiseWatcher>['onRejected']} */
103
+ /** @type {Required<PromiseWatcher>['onRejected']} */
99
104
  onRejected(reason) {
100
105
  const { vow, watcher, watcherContext, resolver } = this.state;
101
106
  if (vow && isRetryableReason(reason)) {
@@ -110,8 +115,8 @@ const preparePromiseWatcher = (zone, isRetryableReason, watchNextStep) =>
110
115
  );
111
116
 
112
117
  /**
113
- * @param {import('@agoric/base-zone').Zone} zone
114
- * @param {() => import('./types.js').VowKit<any>} makeVowKit
118
+ * @param {Zone} zone
119
+ * @param {() => VowKit<any>} makeVowKit
115
120
  * @param {(reason: any) => boolean} [isRetryableReason]
116
121
  */
117
122
  export const prepareWatch = (
@@ -131,12 +136,12 @@ export const prepareWatch = (
131
136
  * @template [TResult1=T]
132
137
  * @template [TResult2=T]
133
138
  * @template [C=unknown] watcher context
134
- * @param {import('./types.js').ERef<T | import('./types.js').Vow<T>>} specimenP
135
- * @param {import('./types.js').Watcher<T, TResult1, TResult2>} [watcher]
139
+ * @param {ERef<T | Vow<T>>} specimenP
140
+ * @param {Watcher<T, TResult1, TResult2>} [watcher]
136
141
  * @param {C} [watcherContext]
137
142
  */
138
143
  const watch = (specimenP, watcher, watcherContext) => {
139
- /** @type {import('./types.js').VowKit<TResult1 | TResult2>} */
144
+ /** @type {VowKit<TResult1 | TResult2>} */
140
145
  const { resolver, vow } = makeVowKit();
141
146
 
142
147
  // Create a promise watcher to track vows, retrying upon rejection as
package/src/when.d.ts CHANGED
@@ -1,3 +1,4 @@
1
- export function makeWhen(isRetryableReason?: ((reason: any) => boolean) | undefined): <T, TResult1 = import("./types.js").Unwrap<T>, TResult2 = never>(specimenP: T, onFulfilled?: ((value: import("./types.js").Unwrap<T>) => TResult1 | PromiseLike<TResult1>) | undefined, onRejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined) => Promise<TResult1 | TResult2>;
1
+ export function makeWhen(isRetryableReason?: ((reason: any) => boolean) | undefined): <T, TResult1 = Unwrap<T>, TResult2 = never>(specimenP: T, onFulfilled?: ((value: Unwrap<T>) => TResult1 | PromiseLike<TResult1>) | undefined, onRejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined) => Promise<TResult1 | TResult2>;
2
2
  export type When = ReturnType<typeof makeWhen>;
3
+ import type { Unwrap } from './types.js';
3
4
  //# sourceMappingURL=when.d.ts.map
package/src/when.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"when.d.ts","sourceRoot":"","sources":["when.js"],"names":[],"mappings":"AAMO,uDAFa,GAAG,KAAK,OAAO,iBAUc,CAAC,EAE3B,QAAQ,mCAAG,QAAQ,qBAFO,CAAC,AADpC,yBACO,OAAO,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC,KAE5B,QAAQ,AAFiC,GAAG,WAAW,CAEvD,QAAQ,AAFwD,CAAC,sCAClE,GAAG,KACS,QAAQ,AADJ,GAAG,WAAW,CAClB,QAAQ,AADmB,CAAC,kBAC/C,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC,CAkC1C;mBAIa,UAAU,CAAC,OAAO,QAAQ,CAAC"}
1
+ {"version":3,"file":"when.d.ts","sourceRoot":"","sources":["when.js"],"names":[],"mappings":"AAQO,uDAFa,GAAG,KAAK,OAAO,iBAUP,CAAC,EAEN,QAAQ,cAAG,QAAQ,qBAFd,CAAC,AADf,uCAGS,QAAQ,AAFY,GAAG,WAAW,CAElC,QAAQ,AAFmC,CAAC,sCAC7C,GAAG,KACS,QAAQ,AADJ,GAAG,WAAW,CAClB,QAAQ,AADmB,CAAC,kBAC/C,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC,CAkC1C;mBAIa,UAAU,CAAC,OAAO,QAAQ,CAAC;4BArDb,YAAY"}
package/src/when.js CHANGED
@@ -1,6 +1,8 @@
1
1
  // @ts-check
2
2
  import { getVowPayload, basicE } from './vow-utils.js';
3
3
 
4
+ /** @import { Unwrap } from './types.js' */
5
+
4
6
  /**
5
7
  * @param {(reason: any) => boolean} [isRetryableReason]
6
8
  */
@@ -9,10 +11,10 @@ export const makeWhen = (isRetryableReason = () => false) => {
9
11
  * Shorten `specimenP` until we achieve a final result.
10
12
  *
11
13
  * @template T
12
- * @template [TResult1=import('./types.js').Unwrap<T>]
14
+ * @template [TResult1=Unwrap<T>]
13
15
  * @template [TResult2=never]
14
16
  * @param {T} specimenP value to unwrap
15
- * @param {(value: import('./types.js').Unwrap<T>) => TResult1 | PromiseLike<TResult1>} [onFulfilled]
17
+ * @param {(value: Unwrap<T>) => TResult1 | PromiseLike<TResult1>} [onFulfilled]
16
18
  * @param {(reason: any) => TResult2 | PromiseLike<TResult2>} [onRejected]
17
19
  * @returns {Promise<TResult1 | TResult2>}
18
20
  */
@@ -37,7 +39,7 @@ export const makeWhen = (isRetryableReason = () => false) => {
37
39
  payload = getVowPayload(result);
38
40
  }
39
41
 
40
- const unwrapped = /** @type {import('./types.js').Unwrap<T>} */ (result);
42
+ const unwrapped = /** @type {Unwrap<T>} */ (result);
41
43
 
42
44
  // We've extracted the final result.
43
45
  if (onFulfilled == null && onRejected == null) {