rpc
Import
Section titled “Import”import * as api from "@fungi.computer/agar/rpc";Exports
Section titled “Exports”| Kind | Export | Description |
|---|---|---|
| constant | rpcVoid | A method that decodes and releases an empty RPC result. |
| function | rpcHandleSchema() | Cap’n Web stubs are callable proxies, not records. Select only owner methods and bind their receiver before the maintained function schemas wrap them. |
| function | rpcDataSchema() | Copy an owned data result through its domain decoder, then release the RPC envelope. Live resources use their own handle schemas instead. |
| function | rpcMethod() | Wrap an RPC method’s result schema into a Zod function schema: the decoded value resolves on success, and a malformed result is rethrown as a PROTOCOL AppError after releasing the raw RPC envelope. |
rpcVoidconstant
Section titled “rpcVoid”const rpcVoid: ZodFunction< $ZodFunctionArgs, ZodPromise<ZodPipe<ZodUnknown, ZodTransform<void, unknown>>>>;A method that decodes and releases an empty RPC result.
rpcHandleSchema()function
Section titled “rpcHandleSchema()”function rpcHandleSchema<S>( methods,): ZodPipe< ZodUnknown, ZodTransform< Awaited< $InferObjectOutput< { -readonly [P in string | number | symbol]: S[P] }, {} > & object >, unknown >>;Cap’n Web stubs are callable proxies, not records. Select only owner methods and bind their receiver before the maintained function schemas wrap them.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
S extends Readonly<{ [k: string]: $ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>; }> |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
methods |
S |
Returns
Section titled “Returns”ZodPipe<ZodUnknown, ZodTransform<Awaited<$InferObjectOutput<{
-readonly [P in string | number | symbol]: S[P] }, { }> & object>,
unknown>>
rpcDataSchema()function
Section titled “rpcDataSchema()”function rpcDataSchema<T>( result,): ZodPipe<ZodUnknown, ZodTransform<Awaited<T>, unknown>>;Copy an owned data result through its domain decoder, then release the RPC envelope. Live resources use their own handle schemas instead.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
T |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
result |
ZodType<T> |
Returns
Section titled “Returns”ZodPipe<ZodUnknown, ZodTransform<Awaited<T>, unknown>>
rpcMethod()function
Section titled “rpcMethod()”function rpcMethod<T>( result,): ZodFunction< $ZodFunctionArgs, ZodPromise<ZodPipe<ZodUnknown, ZodTransform<Awaited<T>, unknown>>>>;Wrap an RPC method’s result schema into a Zod function schema: the decoded value resolves on success, and a malformed result is rethrown as a PROTOCOL AppError after releasing the raw RPC envelope.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
T |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
result |
ZodType<T> |
Returns
Section titled “Returns”ZodFunction<$ZodFunctionArgs, ZodPromise<ZodPipe<ZodUnknown,
ZodTransform<Awaited<T>, unknown>>>>