capnweb 0.0.0-3d17ba1 → 0.0.0-409821

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.
@@ -22,12 +22,12 @@ interface RpcTargetBranded {
22
22
  // `any` into inference.
23
23
  type Stubable = RpcTargetBranded | ((...args: never[]) => unknown);
24
24
  type IsUnknown<T> = unknown extends T ? ([T] extends [unknown] ? true : false) : false; // Types that can be passed over RPC
25
- // The reason for using a generic type here is to build a serializable subset of structured
26
- // cloneable composite types. This allows types defined with the "interface" keyword to pass the
25
+ // The reason for using a generic type here is to build the serializable subset of RPC-compatible
26
+ // composite types. This allows types defined with the "interface" keyword to pass the
27
27
  // serializable check as well. Otherwise, only types defined with the "type" keyword would pass.
28
28
  type RpcCompatible<T> = // Allow `unknown` as a leaf so records/interfaces with `unknown` fields remain compatible.
29
- (IsUnknown<T> extends true ? unknown : never) // Structured cloneables
30
- | BaseType // Structured cloneable composites
29
+ (IsUnknown<T> extends true ? unknown : never) // RPC-compatible base values
30
+ | BaseType // RPC-compatible composites
31
31
  | Map<T extends Map<infer U, unknown> ? RpcCompatible<U> : never, T extends Map<unknown, infer U> ? RpcCompatible<U> : never> | Set<T extends Set<infer U> ? RpcCompatible<U> : never> | Array<T extends Array<infer U> ? RpcCompatible<U> : never> | ReadonlyArray<T extends ReadonlyArray<infer U> ? RpcCompatible<U> : never> | { [K in keyof T as K extends string | number ? K : never]: RpcCompatible<T[K]> } | Promise<T extends Promise<infer U> ? RpcCompatible<U> : never> // Special types
32
32
  | Stub<Stubable> // Serialized as stubs, see `Stubify`
33
33
  | Stubable;
@@ -22,12 +22,12 @@ interface RpcTargetBranded {
22
22
  // `any` into inference.
23
23
  type Stubable = RpcTargetBranded | ((...args: never[]) => unknown);
24
24
  type IsUnknown<T> = unknown extends T ? ([T] extends [unknown] ? true : false) : false; // Types that can be passed over RPC
25
- // The reason for using a generic type here is to build a serializable subset of structured
26
- // cloneable composite types. This allows types defined with the "interface" keyword to pass the
25
+ // The reason for using a generic type here is to build the serializable subset of RPC-compatible
26
+ // composite types. This allows types defined with the "interface" keyword to pass the
27
27
  // serializable check as well. Otherwise, only types defined with the "type" keyword would pass.
28
28
  type RpcCompatible<T> = // Allow `unknown` as a leaf so records/interfaces with `unknown` fields remain compatible.
29
- (IsUnknown<T> extends true ? unknown : never) // Structured cloneables
30
- | BaseType // Structured cloneable composites
29
+ (IsUnknown<T> extends true ? unknown : never) // RPC-compatible base values
30
+ | BaseType // RPC-compatible composites
31
31
  | Map<T extends Map<infer U, unknown> ? RpcCompatible<U> : never, T extends Map<unknown, infer U> ? RpcCompatible<U> : never> | Set<T extends Set<infer U> ? RpcCompatible<U> : never> | Array<T extends Array<infer U> ? RpcCompatible<U> : never> | ReadonlyArray<T extends ReadonlyArray<infer U> ? RpcCompatible<U> : never> | { [K in keyof T as K extends string | number ? K : never]: RpcCompatible<T[K]> } | Promise<T extends Promise<infer U> ? RpcCompatible<U> : never> // Special types
32
32
  | Stub<Stubable> // Serialized as stubs, see `Stubify`
33
33
  | Stubable;