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.
- package/dist/index-bun.cjs.map +1 -1
- package/dist/index-bun.d.cts +4 -4
- package/dist/index-bun.d.ts +4 -4
- package/dist/index-bun.js.map +1 -1
- package/dist/index-workers.cjs.map +1 -1
- package/dist/index-workers.d.cts +4 -4
- package/dist/index-workers.d.ts +4 -4
- package/dist/index-workers.js.map +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js.map +1 -1
- package/package.json +6 -3
package/dist/index-bun.d.cts
CHANGED
|
@@ -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
|
|
26
|
-
//
|
|
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) //
|
|
30
|
-
| BaseType //
|
|
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;
|
package/dist/index-bun.d.ts
CHANGED
|
@@ -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
|
|
26
|
-
//
|
|
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) //
|
|
30
|
-
| BaseType //
|
|
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;
|