@agoric/vow 0.1.1-dev-4202f3e.0 → 0.1.1-dev-cc2bf0b.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 +4 -4
- package/src/index.d.ts +1 -0
- package/src/index.js +3 -0
- package/src/types.d.ts +2 -15
- package/src/types.d.ts.map +1 -1
- package/src/types.js +2 -35
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/vow",
|
|
3
|
-
"version": "0.1.1-dev-
|
|
3
|
+
"version": "0.1.1-dev-cc2bf0b.0+cc2bf0b",
|
|
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-
|
|
24
|
-
"@agoric/internal": "0.3.3-dev-
|
|
23
|
+
"@agoric/base-zone": "0.1.1-dev-cc2bf0b.0+cc2bf0b",
|
|
24
|
+
"@agoric/internal": "0.3.3-dev-cc2bf0b.0+cc2bf0b",
|
|
25
25
|
"@endo/env-options": "^1.1.4",
|
|
26
26
|
"@endo/eventual-send": "^1.2.2",
|
|
27
27
|
"@endo/pass-style": "^1.4.0",
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
"typeCoverage": {
|
|
55
55
|
"atLeast": 89.6
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "cc2bf0bb431aa64c601628f53cf191fcc84c5750"
|
|
58
58
|
}
|
package/src/index.d.ts
CHANGED
package/src/index.js
CHANGED
package/src/types.d.ts
CHANGED
|
@@ -1,29 +1,14 @@
|
|
|
1
|
-
export type Callable = (...args: any[]) => any;
|
|
2
1
|
/**
|
|
3
2
|
* Return type of a function that may
|
|
4
3
|
* return a promise or a vow.
|
|
5
4
|
*/
|
|
6
5
|
export type PromiseVow<T> = Promise<T | Vow<T>>;
|
|
7
6
|
export type ERef<T> = T | PromiseLike<T>;
|
|
8
|
-
/**
|
|
9
|
-
* Whether T is a primitive type.
|
|
10
|
-
*/
|
|
11
|
-
export type IsPrimitive<T> = (T extends bigint ? true : T extends boolean ? true : T extends null ? true : T extends number ? true : T extends string ? true : T extends symbol ? true : T extends undefined ? true : false);
|
|
12
|
-
/**
|
|
13
|
-
* Recursively extract the non-callable properties of T.
|
|
14
|
-
*/
|
|
15
|
-
export type DataOnly<T> = (IsPrimitive<T> extends true ? T : T extends Callable ? never : { [P in keyof T as T[P] extends Callable ? never : P]: DataOnly<T[P]>; });
|
|
16
7
|
/**
|
|
17
8
|
* Follow the chain of vow shortening to the end, returning the final value.
|
|
18
9
|
* This is used within E, so we must narrow the type to its remote form.
|
|
19
10
|
*/
|
|
20
11
|
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
|
-
/**
|
|
22
|
-
* A type that
|
|
23
|
-
* doesn't assume its parameter is local, but is satisfied with both local
|
|
24
|
-
* and remote references.
|
|
25
|
-
*/
|
|
26
|
-
export type Remote<Primary, Local = DataOnly<Primary>> = Primary | RemotableBrand<Local, Primary>;
|
|
27
12
|
/**
|
|
28
13
|
* The first version of the vow implementation
|
|
29
14
|
* object. CAVEAT: These methods must never be changed or added to, to provide
|
|
@@ -69,6 +54,8 @@ export type VowTools = {
|
|
|
69
54
|
makeVowKit: <T_2>() => VowKit<T_2>;
|
|
70
55
|
allVows: (vows: any) => Vow<any>;
|
|
71
56
|
};
|
|
57
|
+
import type { IsPrimitive } from '@agoric/internal';
|
|
72
58
|
import type { RemotableBrand } from '@endo/eventual-send';
|
|
73
59
|
import type { RemotableObject } from '@endo/pass-style';
|
|
60
|
+
import type { Remote } from '@agoric/internal';
|
|
74
61
|
//# sourceMappingURL=types.d.ts.map
|
package/src/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.js"],"names":[],"mappings":";;;;uBAc6B,CAAC,IAAjB,OAAO,CAAS,CAAC,AAAR,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;iBAMH,CAAC,IAAD,CAAC,AAAhB,GAAG,WAAW,CAAC,CAAC,CAAC;;;;;mBAY9B,CAAK;;;;;;;kBAWsB,CAAC;;;;;;;aAAf,MAAM,OAAO,CAAC,CAAC,CAAC;;uBASe,CAAC;;;gBAKJ,CAAC;;;mBAOhB,CAAC,UAFf;IACZ,GAAO,EAAE,GAAG,CACc,CAAC,AADb,CAAC,CAAC;IAChB,QAAY,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC;CAC1B;0BAQkB,CAAC,UAHV;IACZ,GAAO,EAAE,GAAG,CAES,CAAC,AAFR,CAAC,CAAC;IAChB,QAAY,EAAE,WAAW,CACJ,CAAC,AADK,CAAC,CAAC;IAC7B,OAAW,EAAE,OAAO,CAAC,CAAC,CAAC,CAAA;CACpB;wBAK0C,CAAC;oDAAI,IAAI;oBAAkB,GAAG,GAAG,IAAI;;oBAS7D,CAAC,QAAyD,QAAQ,MAClB,QAAQ,MAD3C,CAAC;2BAAd,CAAC,YAAY,CAAC;2BACb,GAAG;;qBAKA,CAAC,UAAd,IAAI,CAAS,CAAC,AAAR,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;;iEAhFuB,CAAA;;;;;iCAPd,kBAAkB;oCAHvB,qBAAqB;qCAEpB,kBAAkB;4BACd,kBAAkB"}
|
package/src/types.js
CHANGED
|
@@ -5,10 +5,10 @@ export {};
|
|
|
5
5
|
* @import {RemotableBrand} from '@endo/eventual-send'
|
|
6
6
|
* @import {CopyTagged} from '@endo/pass-style'
|
|
7
7
|
* @import {RemotableObject} from '@endo/pass-style';
|
|
8
|
-
* @import {
|
|
8
|
+
* @import {IsPrimitive, Remote} from '@agoric/internal';
|
|
9
|
+
* @import {PromiseVow} from '@agoric/vow';
|
|
9
10
|
* @import {prepareVowTools} from './tools.js'
|
|
10
11
|
*/
|
|
11
|
-
/** @typedef {(...args: any[]) => any} Callable */
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* @template T
|
|
@@ -21,29 +21,6 @@ export {};
|
|
|
21
21
|
* @typedef {T | PromiseLike<T>} ERef
|
|
22
22
|
*/
|
|
23
23
|
|
|
24
|
-
/**
|
|
25
|
-
* @template T
|
|
26
|
-
* @typedef {(
|
|
27
|
-
* T extends bigint ? true :
|
|
28
|
-
* T extends boolean ? true :
|
|
29
|
-
* T extends null ? true :
|
|
30
|
-
* T extends number ? true :
|
|
31
|
-
* T extends string ? true :
|
|
32
|
-
* T extends symbol ? true :
|
|
33
|
-
* T extends undefined ? true :
|
|
34
|
-
* false
|
|
35
|
-
* )} IsPrimitive Whether T is a primitive type.
|
|
36
|
-
*/
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* @template T
|
|
40
|
-
* @typedef {(
|
|
41
|
-
* IsPrimitive<T> extends true ? T :
|
|
42
|
-
* T extends Callable ? never :
|
|
43
|
-
* { [P in keyof T as T[P] extends Callable ? never : P]: DataOnly<T[P]> }
|
|
44
|
-
* )} DataOnly Recursively extract the non-callable properties of T.
|
|
45
|
-
*/
|
|
46
|
-
|
|
47
24
|
/**
|
|
48
25
|
* Follow the chain of vow shortening to the end, returning the final value.
|
|
49
26
|
* This is used within E, so we must narrow the type to its remote form.
|
|
@@ -57,16 +34,6 @@ export {};
|
|
|
57
34
|
* )} Unwrap
|
|
58
35
|
*/
|
|
59
36
|
|
|
60
|
-
/**
|
|
61
|
-
* A type that accepts both near and marshalled references that were
|
|
62
|
-
* returned from `Remotable` or `Far`.
|
|
63
|
-
* @template Primary The type of the primary reference.
|
|
64
|
-
* @template [Local=DataOnly<Primary>] The local properties of the object.
|
|
65
|
-
* @typedef {Primary | RemotableBrand<Local, Primary>} Remote A type that
|
|
66
|
-
* doesn't assume its parameter is local, but is satisfied with both local
|
|
67
|
-
* and remote references.
|
|
68
|
-
*/
|
|
69
|
-
|
|
70
37
|
/**
|
|
71
38
|
* @template [T=any]
|
|
72
39
|
* @typedef {object} VowV0 The first version of the vow implementation
|