@endo/eventual-send 1.2.6 → 1.2.8
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 +5 -5
- package/src/E.d.ts +17 -16
- package/src/E.d.ts.map +1 -1
- package/src/E.js +26 -22
- package/src/postponed.d.ts +1 -1
- package/src/postponed.d.ts.map +1 -1
- package/src/postponed.js +3 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@endo/eventual-send",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.8",
|
|
4
4
|
"description": "Extend a Promise class to implement the eventual-send API",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/no-shim.js",
|
|
@@ -36,14 +36,14 @@
|
|
|
36
36
|
},
|
|
37
37
|
"homepage": "https://github.com/endojs/endo#readme",
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@endo/env-options": "^1.1.
|
|
39
|
+
"@endo/env-options": "^1.1.8"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@endo/lockdown": "^1.0.
|
|
42
|
+
"@endo/lockdown": "^1.0.13",
|
|
43
43
|
"ava": "^6.1.3",
|
|
44
44
|
"c8": "^7.14.0",
|
|
45
45
|
"tsd": "^0.31.2",
|
|
46
|
-
"typescript": "~5.6.
|
|
46
|
+
"typescript": "~5.6.3"
|
|
47
47
|
},
|
|
48
48
|
"keywords": [
|
|
49
49
|
"eventual send",
|
|
@@ -77,5 +77,5 @@
|
|
|
77
77
|
"typeCoverage": {
|
|
78
78
|
"atLeast": 77.81
|
|
79
79
|
},
|
|
80
|
-
"gitHead": "
|
|
80
|
+
"gitHead": "5486ed1f238104716b6a8321b977fbc508ef80e1"
|
|
81
81
|
}
|
package/src/E.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export default makeE;
|
|
2
|
-
export type EProxy = ReturnType<(HandledPromise:
|
|
2
|
+
export type EProxy = ReturnType<(HandledPromise: HandledPromiseConstructor) => (<T>(x: T) => ECallableOrMethods<RemoteFunctions<T>>) & {
|
|
3
3
|
/**
|
|
4
4
|
* E.get(x) returns a proxy on which you can get arbitrary properties.
|
|
5
5
|
* Each of these properties returns a promise for the property. The promise
|
|
@@ -54,20 +54,20 @@ export type EProxy = ReturnType<(HandledPromise: import("./types").HandledPromis
|
|
|
54
54
|
* Creates a type that accepts both near and marshalled references that were
|
|
55
55
|
* returned from `Remotable` or `Far`, and also promises for such references.
|
|
56
56
|
*/
|
|
57
|
-
export type FarRef<Primary, Local = DataOnly<Primary>> = ERef<Local & import("./types").RemotableBrand<Local, Primary>>;
|
|
57
|
+
export type FarRef<Primary, Local = DataOnly<Primary>> = ERef<Local & import("./types.js").RemotableBrand<Local, Primary>>;
|
|
58
58
|
/**
|
|
59
59
|
* `DataOnly<T>` means to return a record type `T2` consisting only of
|
|
60
60
|
* properties that are *not* functions.
|
|
61
61
|
*/
|
|
62
|
-
export type DataOnly<T> = Omit<T, FilteredKeys<T, import("./types").Callable>>;
|
|
62
|
+
export type DataOnly<T> = Omit<T, FilteredKeys<T, import("./types.js").Callable>>;
|
|
63
63
|
export type ERef<T> = PromiseLike<T> | T;
|
|
64
|
-
export type ECallable<T extends import("./types").Callable> = (ReturnType<T> extends PromiseLike<infer U> ? T : (...args: Parameters<T>) => Promise<Awaited<ReturnType<T>>>);
|
|
65
|
-
export type EMethods<T> = { readonly [P in keyof T]: T[P] extends import("./types").Callable ? ECallable<T[P]> : never; };
|
|
64
|
+
export type ECallable<T extends import("./types.js").Callable> = (ReturnType<T> extends PromiseLike<infer U> ? T : (...args: Parameters<T>) => Promise<Awaited<ReturnType<T>>>);
|
|
65
|
+
export type EMethods<T> = { readonly [P in keyof T]: T[P] extends import("./types.js").Callable ? ECallable<T[P]> : never; };
|
|
66
66
|
export type EGetters<T> = { readonly [P in keyof T]: T[P] extends PromiseLike<infer U> ? T[P] : Promise<Awaited<T[P]>>; };
|
|
67
|
-
export type ESendOnlyCallable<T extends import("./types").Callable> = (...args: Parameters<T>) => Promise<void>;
|
|
68
|
-
export type ESendOnlyMethods<T> = { readonly [P in keyof T]: T[P] extends import("./types").Callable ? ESendOnlyCallable<T[P]> : never; };
|
|
69
|
-
export type ESendOnlyCallableOrMethods<T> = (T extends import("./types").Callable ? ESendOnlyCallable<T> & ESendOnlyMethods<Required<T>> : ESendOnlyMethods<Required<T>>);
|
|
70
|
-
export type ECallableOrMethods<T> = (T extends import("./types").Callable ? ECallable<T> & EMethods<Required<T>> : EMethods<Required<T>>);
|
|
67
|
+
export type ESendOnlyCallable<T extends import("./types.js").Callable> = (...args: Parameters<T>) => Promise<void>;
|
|
68
|
+
export type ESendOnlyMethods<T> = { readonly [P in keyof T]: T[P] extends import("./types.js").Callable ? ESendOnlyCallable<T[P]> : never; };
|
|
69
|
+
export type ESendOnlyCallableOrMethods<T> = (T extends import("./types.js").Callable ? ESendOnlyCallable<T> & ESendOnlyMethods<Required<T>> : ESendOnlyMethods<Required<T>>);
|
|
70
|
+
export type ECallableOrMethods<T> = (T extends import("./types.js").Callable ? ECallable<T> & EMethods<Required<T>> : EMethods<Required<T>>);
|
|
71
71
|
/**
|
|
72
72
|
* Return a union of property names/symbols/numbers P for which the record element T[P]'s type extends U.
|
|
73
73
|
*
|
|
@@ -83,25 +83,25 @@ export type FilteredKeys<T, U> = { [P in keyof T]: T[P] extends U ? P : never; }
|
|
|
83
83
|
* `PickCallable<T>` means to return a single root callable or a record type
|
|
84
84
|
* consisting only of properties that are functions.
|
|
85
85
|
*/
|
|
86
|
-
export type PickCallable<T> = (T extends import("./types").Callable ? (...args: Parameters<T>) => ReturnType<T> : Pick<T, FilteredKeys<T, import("./types").Callable>>);
|
|
86
|
+
export type PickCallable<T> = (T extends import("./types.js").Callable ? (...args: Parameters<T>) => ReturnType<T> : Pick<T, FilteredKeys<T, import("./types.js").Callable>>);
|
|
87
87
|
/**
|
|
88
88
|
* `RemoteFunctions<T>` means to return the functions and properties that are remotely callable.
|
|
89
89
|
*/
|
|
90
|
-
export type RemoteFunctions<T> = (T extends import("./types").RemotableBrand<infer L, infer R> ? PickCallable<R> : Awaited<T> extends import("./types").RemotableBrand<infer L, infer R> ? PickCallable<R> : T extends PromiseLike<infer U> ? Awaited<T> : T);
|
|
91
|
-
export type LocalRecord<T> = (T extends import("./types").RemotableBrand<infer L, infer R> ? L : Awaited<T> extends import("./types").RemotableBrand<infer L, infer R> ? L : T extends PromiseLike<infer U> ? Awaited<T> : T);
|
|
90
|
+
export type RemoteFunctions<T> = (T extends import("./types.js").RemotableBrand<infer L, infer R> ? PickCallable<R> : Awaited<T> extends import("./types.js").RemotableBrand<infer L, infer R> ? PickCallable<R> : T extends PromiseLike<infer U> ? Awaited<T> : T);
|
|
91
|
+
export type LocalRecord<T> = (T extends import("./types.js").RemotableBrand<infer L, infer R> ? L : Awaited<T> extends import("./types.js").RemotableBrand<infer L, infer R> ? L : T extends PromiseLike<infer U> ? Awaited<T> : T);
|
|
92
92
|
export type EPromiseKit<R = unknown> = {
|
|
93
93
|
promise: Promise<R>;
|
|
94
|
-
settler: import("./types").Settler<R>;
|
|
94
|
+
settler: import("./types.js").Settler<R>;
|
|
95
95
|
};
|
|
96
96
|
/**
|
|
97
97
|
* Type for an object that must only be invoked with E. It supports a given
|
|
98
98
|
* interface but declares all the functions as asyncable.
|
|
99
99
|
*/
|
|
100
|
-
export type EOnly<T> = (T extends import("./types").Callable ? (...args: Parameters<T>) => ERef<Awaited<EOnly<ReturnType<T>>>> : T extends Record<PropertyKey, import("./types").Callable> ? { [K in keyof T]: T[K] extends import("./types").Callable ? (...args: Parameters<T[K]>) => ERef<Awaited<EOnly<ReturnType<T[K]>>>> : T[K]; } : T);
|
|
100
|
+
export type EOnly<T> = (T extends import("./types.js").Callable ? (...args: Parameters<T>) => ERef<Awaited<EOnly<ReturnType<T>>>> : T extends Record<PropertyKey, import("./types.js").Callable> ? { [K in keyof T]: T[K] extends import("./types.js").Callable ? (...args: Parameters<T[K]>) => ERef<Awaited<EOnly<ReturnType<T[K]>>>> : T[K]; } : T);
|
|
101
101
|
/**
|
|
102
|
-
* @param {
|
|
102
|
+
* @param {HandledPromiseConstructor} HandledPromise
|
|
103
103
|
*/
|
|
104
|
-
declare function makeE(HandledPromise:
|
|
104
|
+
declare function makeE(HandledPromise: HandledPromiseConstructor): (<T>(x: T) => ECallableOrMethods<RemoteFunctions<T>>) & {
|
|
105
105
|
/**
|
|
106
106
|
* E.get(x) returns a proxy on which you can get arbitrary properties.
|
|
107
107
|
* Each of these properties returns a promise for the property. The promise
|
|
@@ -152,4 +152,5 @@ declare function makeE(HandledPromise: import("./types").HandledPromiseConstruct
|
|
|
152
152
|
*/
|
|
153
153
|
readonly when: <T, U = T>(x: T | PromiseLike<T>, onfulfilled?: ((value: T) => ERef<U>) | undefined, onrejected?: ((reason: any) => ERef<U>) | undefined) => Promise<U>;
|
|
154
154
|
};
|
|
155
|
+
import type { HandledPromiseConstructor } from './types.js';
|
|
155
156
|
//# 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":";
|
|
1
|
+
{"version":3,"file":"E.d.ts","sourceRoot":"","sources":["E.js"],"names":[],"mappings":";qBA6Pc,UAAU,kBAnFb,yBAAyB,OAUjB,CAAC,KACH,CAAC,KACC,kBAAkB,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;IAKjD;;;;;;;;;;OAUG;mBAJU,CAAC,KACH,CAAC,KACC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IASrC;;;;;;;;OAQG;;;;;;IAGH;;;;;;;;OAQG;wBAJU,CAAC,KACH,CAAC,KACC,0BAA0B,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;IAS3D;;;;;;;;;;;OAWG;oBAPU,CAAC,EACA,CAAC,SACJ,CAAC,GAAC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AAyB,KAUjB,CAAC,KACH,CAAC,KACC,kBAAkB,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;IAKjD;;;;;;;;;;OAUG;mBAJU,CAAC,KACH,CAAC,KACC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IASrC;;;;;;;;OAQG;;;;;;IAGH;;;;;;;;OAQG;wBAJU,CAAC,KACH,CAAC,KACC,0BAA0B,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;IAS3D;;;;;;;;;;;OAWG;oBAPU,CAAC,EACA,CAAC,SACJ,CAAC,GAAC,WAAW,CAAC,CAAC,CAAC,yBACR,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,sCACZ,GAAG,KAAK,IAAI,CAAC,CAAC,CAAC,kBACtB,OAAO,CAAC,CAAC,CAAC;EAU9B;+CAlP6C,YAAY"}
|
package/src/E.js
CHANGED
|
@@ -4,6 +4,10 @@ import { makeMessageBreakpointTester } from './message-breakpoints.js';
|
|
|
4
4
|
const { details: X, quote: q, Fail, error: makeError } = assert;
|
|
5
5
|
const { assign, create } = Object;
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* @import { HandledPromiseConstructor } from './types.js';
|
|
9
|
+
*/
|
|
10
|
+
|
|
7
11
|
const onSend = makeMessageBreakpointTester('ENDO_SEND_BREAKPOINTS');
|
|
8
12
|
|
|
9
13
|
/** @type {ProxyHandler<any>} */
|
|
@@ -35,7 +39,7 @@ const baseFreezableProxyHandler = {
|
|
|
35
39
|
* A Proxy handler for E(x).
|
|
36
40
|
*
|
|
37
41
|
* @param {any} recipient Any value passed to E(x)
|
|
38
|
-
* @param {
|
|
42
|
+
* @param {HandledPromiseConstructor} HandledPromise
|
|
39
43
|
* @returns {ProxyHandler<unknown>} the Proxy handler
|
|
40
44
|
*/
|
|
41
45
|
const makeEProxyHandler = (recipient, HandledPromise) =>
|
|
@@ -96,7 +100,7 @@ const makeEProxyHandler = (recipient, HandledPromise) =>
|
|
|
96
100
|
* It is a variant on the E(x) Proxy handler.
|
|
97
101
|
*
|
|
98
102
|
* @param {any} recipient Any value passed to E.sendOnly(x)
|
|
99
|
-
* @param {
|
|
103
|
+
* @param {HandledPromiseConstructor} HandledPromise
|
|
100
104
|
* @returns {ProxyHandler<unknown>} the Proxy handler
|
|
101
105
|
*/
|
|
102
106
|
const makeESendOnlyProxyHandler = (recipient, HandledPromise) =>
|
|
@@ -153,7 +157,7 @@ const makeESendOnlyProxyHandler = (recipient, HandledPromise) =>
|
|
|
153
157
|
* It is a variant on the E(x) Proxy handler.
|
|
154
158
|
*
|
|
155
159
|
* @param {any} x Any value passed to E.get(x)
|
|
156
|
-
* @param {
|
|
160
|
+
* @param {HandledPromiseConstructor} HandledPromise
|
|
157
161
|
* @returns {ProxyHandler<unknown>} the Proxy handler
|
|
158
162
|
*/
|
|
159
163
|
const makeEGetProxyHandler = (x, HandledPromise) =>
|
|
@@ -164,7 +168,7 @@ const makeEGetProxyHandler = (x, HandledPromise) =>
|
|
|
164
168
|
});
|
|
165
169
|
|
|
166
170
|
/**
|
|
167
|
-
* @param {
|
|
171
|
+
* @param {HandledPromiseConstructor} HandledPromise
|
|
168
172
|
*/
|
|
169
173
|
const makeE = HandledPromise => {
|
|
170
174
|
return harden(
|
|
@@ -255,7 +259,7 @@ export default makeE;
|
|
|
255
259
|
*
|
|
256
260
|
* @template Primary The type of the primary reference.
|
|
257
261
|
* @template [Local=DataOnly<Primary>] The local properties of the object.
|
|
258
|
-
* @typedef {ERef<Local & import('./types').RemotableBrand<Local, Primary>>} FarRef
|
|
262
|
+
* @typedef {ERef<Local & import('./types.js').RemotableBrand<Local, Primary>>} FarRef
|
|
259
263
|
*/
|
|
260
264
|
|
|
261
265
|
/**
|
|
@@ -263,7 +267,7 @@ export default makeE;
|
|
|
263
267
|
* properties that are *not* functions.
|
|
264
268
|
*
|
|
265
269
|
* @template T The type to be filtered.
|
|
266
|
-
* @typedef {Omit<T, FilteredKeys<T, import('./types').Callable>>} DataOnly
|
|
270
|
+
* @typedef {Omit<T, FilteredKeys<T, import('./types.js').Callable>>} DataOnly
|
|
267
271
|
*/
|
|
268
272
|
|
|
269
273
|
/**
|
|
@@ -273,7 +277,7 @@ export default makeE;
|
|
|
273
277
|
*/
|
|
274
278
|
|
|
275
279
|
/**
|
|
276
|
-
* @template {import('./types').Callable} T
|
|
280
|
+
* @template {import('./types.js').Callable} T
|
|
277
281
|
* @typedef {(
|
|
278
282
|
* ReturnType<T> extends PromiseLike<infer U> // if function returns a promise
|
|
279
283
|
* ? T // return the function
|
|
@@ -284,7 +288,7 @@ export default makeE;
|
|
|
284
288
|
/**
|
|
285
289
|
* @template T
|
|
286
290
|
* @typedef {{
|
|
287
|
-
* readonly [P in keyof T]: T[P] extends import('./types').Callable
|
|
291
|
+
* readonly [P in keyof T]: T[P] extends import('./types.js').Callable
|
|
288
292
|
* ? ECallable<T[P]>
|
|
289
293
|
* : never;
|
|
290
294
|
* }} EMethods
|
|
@@ -300,14 +304,14 @@ export default makeE;
|
|
|
300
304
|
*/
|
|
301
305
|
|
|
302
306
|
/**
|
|
303
|
-
* @template {import('./types').Callable} T
|
|
307
|
+
* @template {import('./types.js').Callable} T
|
|
304
308
|
* @typedef {(...args: Parameters<T>) => Promise<void>} ESendOnlyCallable
|
|
305
309
|
*/
|
|
306
310
|
|
|
307
311
|
/**
|
|
308
312
|
* @template T
|
|
309
313
|
* @typedef {{
|
|
310
|
-
* readonly [P in keyof T]: T[P] extends import('./types').Callable
|
|
314
|
+
* readonly [P in keyof T]: T[P] extends import('./types.js').Callable
|
|
311
315
|
* ? ESendOnlyCallable<T[P]>
|
|
312
316
|
* : never;
|
|
313
317
|
* }} ESendOnlyMethods
|
|
@@ -316,7 +320,7 @@ export default makeE;
|
|
|
316
320
|
/**
|
|
317
321
|
* @template T
|
|
318
322
|
* @typedef {(
|
|
319
|
-
* T extends import('./types').Callable
|
|
323
|
+
* T extends import('./types.js').Callable
|
|
320
324
|
* ? ESendOnlyCallable<T> & ESendOnlyMethods<Required<T>>
|
|
321
325
|
* : ESendOnlyMethods<Required<T>>
|
|
322
326
|
* )} ESendOnlyCallableOrMethods
|
|
@@ -325,7 +329,7 @@ export default makeE;
|
|
|
325
329
|
/**
|
|
326
330
|
* @template T
|
|
327
331
|
* @typedef {(
|
|
328
|
-
* T extends import('./types').Callable
|
|
332
|
+
* T extends import('./types.js').Callable
|
|
329
333
|
* ? ECallable<T> & EMethods<Required<T>>
|
|
330
334
|
* : EMethods<Required<T>>
|
|
331
335
|
* )} ECallableOrMethods
|
|
@@ -352,9 +356,9 @@ export default makeE;
|
|
|
352
356
|
*
|
|
353
357
|
* @template T
|
|
354
358
|
* @typedef {(
|
|
355
|
-
* T extends import('./types').Callable
|
|
359
|
+
* T extends import('./types.js').Callable
|
|
356
360
|
* ? (...args: Parameters<T>) => ReturnType<T> // a root callable, no methods
|
|
357
|
-
* : Pick<T, FilteredKeys<T, import('./types').Callable>> // any callable methods
|
|
361
|
+
* : Pick<T, FilteredKeys<T, import('./types.js').Callable>> // any callable methods
|
|
358
362
|
* )} PickCallable
|
|
359
363
|
*/
|
|
360
364
|
|
|
@@ -363,9 +367,9 @@ export default makeE;
|
|
|
363
367
|
*
|
|
364
368
|
* @template T
|
|
365
369
|
* @typedef {(
|
|
366
|
-
* T extends import('./types').RemotableBrand<infer L, infer R> // if a given T is some remote interface R
|
|
370
|
+
* T extends import('./types.js').RemotableBrand<infer L, infer R> // if a given T is some remote interface R
|
|
367
371
|
* ? PickCallable<R> // then return the callable properties of R
|
|
368
|
-
* : Awaited<T> extends import('./types').RemotableBrand<infer L, infer R> // otherwise, if the final resolution of T is some remote interface R
|
|
372
|
+
* : Awaited<T> extends import('./types.js').RemotableBrand<infer L, infer R> // otherwise, if the final resolution of T is some remote interface R
|
|
369
373
|
* ? PickCallable<R> // then return the callable properties of R
|
|
370
374
|
* : T extends PromiseLike<infer U> // otherwise, if T is a promise
|
|
371
375
|
* ? Awaited<T> // then return resolved value T
|
|
@@ -376,9 +380,9 @@ export default makeE;
|
|
|
376
380
|
/**
|
|
377
381
|
* @template T
|
|
378
382
|
* @typedef {(
|
|
379
|
-
* T extends import('./types').RemotableBrand<infer L, infer R>
|
|
383
|
+
* T extends import('./types.js').RemotableBrand<infer L, infer R>
|
|
380
384
|
* ? L
|
|
381
|
-
* : Awaited<T> extends import('./types').RemotableBrand<infer L, infer R>
|
|
385
|
+
* : Awaited<T> extends import('./types.js').RemotableBrand<infer L, infer R>
|
|
382
386
|
* ? L
|
|
383
387
|
* : T extends PromiseLike<infer U>
|
|
384
388
|
* ? Awaited<T>
|
|
@@ -390,7 +394,7 @@ export default makeE;
|
|
|
390
394
|
* @template [R = unknown]
|
|
391
395
|
* @typedef {{
|
|
392
396
|
* promise: Promise<R>;
|
|
393
|
-
* settler: import('./types').Settler<R>;
|
|
397
|
+
* settler: import('./types.js').Settler<R>;
|
|
394
398
|
* }} EPromiseKit
|
|
395
399
|
*/
|
|
396
400
|
|
|
@@ -400,11 +404,11 @@ export default makeE;
|
|
|
400
404
|
*
|
|
401
405
|
* @template T
|
|
402
406
|
* @typedef {(
|
|
403
|
-
* T extends import('./types').Callable
|
|
407
|
+
* T extends import('./types.js').Callable
|
|
404
408
|
* ? (...args: Parameters<T>) => ERef<Awaited<EOnly<ReturnType<T>>>>
|
|
405
|
-
* : T extends Record<PropertyKey, import('./types').Callable>
|
|
409
|
+
* : T extends Record<PropertyKey, import('./types.js').Callable>
|
|
406
410
|
* ? {
|
|
407
|
-
* [K in keyof T]: T[K] extends import('./types').Callable
|
|
411
|
+
* [K in keyof T]: T[K] extends import('./types.js').Callable
|
|
408
412
|
* ? (...args: Parameters<T[K]>) => ERef<Awaited<EOnly<ReturnType<T[K]>>>>
|
|
409
413
|
* : T[K];
|
|
410
414
|
* }
|
package/src/postponed.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export function makePostponedHandler(HandledPromise: import("./types").HandledPromiseConstructor): [Required<import("./types").Handler<any>>, () => void];
|
|
1
|
+
export function makePostponedHandler(HandledPromise: import("./types.js").HandledPromiseConstructor): [Required<import("./types.js").Handler<any>>, () => void];
|
|
2
2
|
//# sourceMappingURL=postponed.d.ts.map
|
package/src/postponed.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postponed.d.ts","sourceRoot":"","sources":["postponed.js"],"names":[],"mappings":"AASO,qDAHI,OAAO,
|
|
1
|
+
{"version":3,"file":"postponed.d.ts","sourceRoot":"","sources":["postponed.js"],"names":[],"mappings":"AASO,qDAHI,OAAO,YAAY,EAAE,yBAAyB,GAC5C,CAAC,QAAQ,CAAC,OAAO,YAAY,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,IAAI,CAAC,CAsCrE"}
|
package/src/postponed.js
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* Create a simple postponedHandler that just postpones until donePostponing is
|
|
5
5
|
* called.
|
|
6
6
|
*
|
|
7
|
-
* @param {import('./types').HandledPromiseConstructor} HandledPromise
|
|
8
|
-
* @returns {[Required<import('./types').Handler<any>>, () => void]} postponedHandler and donePostponing callback.
|
|
7
|
+
* @param {import('./types.js').HandledPromiseConstructor} HandledPromise
|
|
8
|
+
* @returns {[Required<import('./types.js').Handler<any>>, () => void]} postponedHandler and donePostponing callback.
|
|
9
9
|
*/
|
|
10
10
|
export const makePostponedHandler = HandledPromise => {
|
|
11
11
|
/** @type {() => void} */
|
|
@@ -29,7 +29,7 @@ export const makePostponedHandler = HandledPromise => {
|
|
|
29
29
|
};
|
|
30
30
|
};
|
|
31
31
|
|
|
32
|
-
/** @type {Required<import('./types').Handler<any>>} */
|
|
32
|
+
/** @type {Required<import('./types.js').Handler<any>>} */
|
|
33
33
|
const postponedHandler = {
|
|
34
34
|
get: makePostponedOperation('get'),
|
|
35
35
|
getSendOnly: makePostponedOperation('getSendOnly'),
|