@agoric/internal 0.3.3-dev-9288d84.0.9288d84 → 0.3.3-dev-9b2a827.0.9b2a827

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/internal",
3
- "version": "0.3.3-dev-9288d84.0.9288d84",
3
+ "version": "0.3.3-dev-9b2a827.0.9b2a827",
4
4
  "description": "Externally unsupported utilities internal to agoric-sdk",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -9,8 +9,8 @@
9
9
  },
10
10
  "scripts": {
11
11
  "build": "exit 0",
12
- "prepack": "yarn run -T tsc --build tsconfig.build.json",
13
- "postpack": "git clean -f '*.d.*ts*' '*.tsbuildinfo'",
12
+ "prepack": "yarn run -T prepack-package",
13
+ "postpack": "yarn run -T postpack-package",
14
14
  "test": "ava",
15
15
  "test:nyc": "exit 0",
16
16
  "test:xs": "exit 0",
@@ -20,7 +20,7 @@
20
20
  "lint:types": "yarn run -T tsc"
21
21
  },
22
22
  "dependencies": {
23
- "@agoric/base-zone": "0.1.1-dev-9288d84.0.9288d84",
23
+ "@agoric/base-zone": "0.1.1-dev-9b2a827.0.9b2a827",
24
24
  "@endo/cache-map": "^1.1.0",
25
25
  "@endo/common": "^1.2.13",
26
26
  "@endo/compartment-mapper": "^1.6.3",
@@ -39,7 +39,7 @@
39
39
  "jessie.js": "^0.3.4"
40
40
  },
41
41
  "devDependencies": {
42
- "@agoric/cosmic-proto": "0.4.1-dev-9288d84.0.9288d84",
42
+ "@agoric/cosmic-proto": "0.4.1-dev-9b2a827.0.9b2a827",
43
43
  "@endo/exo": "^1.5.12",
44
44
  "@endo/init": "^1.1.12",
45
45
  "@endo/ses-ava": "^1.3.2",
@@ -67,5 +67,5 @@
67
67
  "typeCoverage": {
68
68
  "atLeast": 92.33
69
69
  },
70
- "gitHead": "9288d84e2de10401f8211183329034ee0e7ffc43"
70
+ "gitHead": "9b2a827cdf1c3203c1a73637ed80dcd5b13edb8a"
71
71
  }
@@ -1,9 +1,9 @@
1
1
  /* eslint-disable max-classes-per-file */
2
- import type { ERef, RemotableBrand } from '@endo/eventual-send';
3
- import type { Primitive, RemotableObject } from '@endo/pass-style';
2
+
3
+
4
4
  // eslint-disable-next-line @typescript-eslint/no-unused-vars -- used in JSDoc
5
- import type { mustMatch as endoMustMatch, Pattern } from '@endo/patterns';
6
- import type { Callable } from './ses-utils.js';
5
+
6
+
7
7
 
8
8
  /**
9
9
  * A mapping of a tuple type (as from `Parameters<...>`) into a corresponding
@@ -15,21 +15,21 @@ import type { Callable } from './ses-utils.js';
15
15
  * //=> { denom: string, amount: bigint }
16
16
  * ```
17
17
  */
18
- export type RecordFromTuple<
19
- Types extends readonly unknown[],
20
- Names extends Record<Exclude<keyof Types, keyof unknown[]>, string>,
21
- > = { [K in Exclude<keyof Types, keyof any[]> as Names[K]]: Types[K] };
18
+
19
+
20
+
21
+
22
22
 
23
23
  /**
24
24
  * A map corresponding with a total function such that `get(key)` is assumed to
25
25
  * always succeed.
26
26
  */
27
- export type TotalMap<K, V> = Omit<Map<K, V>, 'get'> & {
28
- /** Returns the element associated with the specified key in the TotalMap. */
29
- get: (key: K) => V;
30
- };
31
- export type TotalMapFrom<M extends Map<any, any>> =
32
- M extends Map<infer K, infer V> ? TotalMap<K, V> : never;
27
+
28
+
29
+
30
+
31
+
32
+
33
33
 
34
34
  /**
35
35
  * A permit is either `true` or a string (both meaning no attenuation, with a
@@ -37,40 +37,40 @@ export type TotalMapFrom<M extends Map<any, any>> =
37
37
  * generation), or an object whose keys identify child properties and whose
38
38
  * corresponding values are theirselves (recursive) Permits.
39
39
  */
40
- export type Permit<T> =
41
- | true
42
- | string
43
- | Partial<{ [K in keyof T]: K extends string ? Permit<T[K]> : never }>;
40
+
41
+
42
+
43
+
44
44
 
45
- export type Attenuated<T, P extends Permit<T>> = P extends object
46
- ? {
47
- [K in keyof P]: K extends keyof T
48
- ? P[K] extends Permit<T[K]>
49
- ? Attenuated<T[K], P[K]>
50
- : never
51
- : never;
52
- }
53
- : T;
45
+
46
+
47
+
48
+
49
+
50
+
51
+
52
+
53
+
54
54
 
55
- export declare class Callback<I extends (...args: any[]) => any> {
56
- private iface: I;
55
+
56
+
57
57
 
58
- public target: any;
58
+
59
59
 
60
- public methodName?: PropertyKey;
60
+
61
61
 
62
- public bound: unknown[];
62
+
63
63
 
64
- public isSync: boolean;
65
- }
64
+
65
+
66
66
 
67
- export declare class SyncCallback<
68
- I extends (...args: unknown[]) => any,
69
- > extends Callback<I> {
70
- private syncIface: I;
67
+
68
+
69
+
70
+
71
71
 
72
- public isSync: true;
73
- }
72
+
73
+
74
74
 
75
75
  /**
76
76
  * Returns a boolean for whether the given type is a primitive value or
@@ -87,40 +87,40 @@ export declare class SyncCallback<
87
87
  * IsPrimitive<Object>
88
88
  * //=> false
89
89
  */
90
- export type IsPrimitive<T> = [T] extends [Primitive] ? true : false;
90
+
91
91
 
92
92
  // XXX https://github.com/endojs/endo/issues/2979
93
- export type IsRemotable<T> = T extends RemotableObject
94
- ? true
95
- : T extends RemotableBrand<any, any>
96
- ? true
97
- : false;
93
+
94
+
95
+
96
+
97
+
98
98
 
99
99
  /** Recursively extract the non-callable properties of T */
100
- export type DataOnly<T> =
101
- IsPrimitive<T> extends true
102
- ? T
103
- : T extends Callable
104
- ? never
105
- : { [P in keyof T as T[P] extends Callable ? never : P]: DataOnly<T[P]> };
100
+
101
+
102
+
103
+
104
+
105
+
106
106
 
107
107
  /**
108
108
  * A type that doesn't assume its parameter is local, but is satisfied with both
109
109
  * local and remote references. It accepts both near and marshalled references
110
110
  * that were returned from `Remotable` or `Far`.
111
111
  */
112
- export type Remote<Primary, Local = DataOnly<Primary>> =
113
- | Primary
114
- | RemotableBrand<Local, Primary>;
112
+
113
+
114
+
115
115
 
116
116
  // TODO: Add type tests for Remote and ERemote.
117
117
  /**
118
118
  * A type that accepts either resolved or promised references that may be either
119
119
  * near or marshalled. @see {ERef} and @see {Remote}.
120
120
  */
121
- export type ERemote<Primary, Local = DataOnly<Primary>> = ERef<
122
- Remote<Primary, Local>
123
- >;
121
+
122
+
123
+
124
124
 
125
125
  /*
126
126
  * Stop-gap until https://github.com/Agoric/agoric-sdk/issues/6160
@@ -144,15 +144,15 @@ export type ERemote<Primary, Local = DataOnly<Primary>> = ERef<
144
144
  * type annotation may unblock declaration emit.
145
145
  */
146
146
  // declare const validatedType: unique symbol;
147
- declare const validatedType: 'Symbol(validatedType)';
147
+
148
148
 
149
149
  /**
150
150
  * Tag a pattern with the static type it represents.
151
151
  */
152
- export type TypedPattern<T> = Pattern & { [validatedType]?: T };
152
+
153
153
 
154
- export declare type PatternType<TM extends TypedPattern<any>> =
155
- TM extends TypedPattern<infer T> ? T : never;
154
+
155
+
156
156
 
157
157
  // TODO make Endo's mustMatch do this
158
158
  /**
@@ -163,10 +163,10 @@ export declare type PatternType<TM extends TypedPattern<any>> =
163
163
  *
164
164
  * @see {endoMustMatch} for the implementation. This one has a type annotation to narrow if the pattern is a TypedPattern.
165
165
  */
166
- export declare type MustMatch = <P extends Pattern>(
167
- specimen: unknown,
168
- pattern: P,
169
- label?: string | number,
170
- ) => asserts specimen is P extends TypedPattern<any> ? PatternType<P> : unknown;
166
+
167
+
168
+
169
+
170
+
171
171
 
172
- export type { TraceLogger } from './debug.js';
172
+