Function: method()
ts
function method<A, R>(opts?: MethodOptions): MethodDescriptor<A, R>;Defined in: src/batteries/isolation/types.ts:108
Declare a request/response method on an isolated service's spec — the host gets a (...args) => Promise<R> facade method; the guest implementation returns (or resolves to) R directly (or throws/rejects, crossing back as a rejected promise on the host).
Type Parameters
| Type Parameter | Description |
|---|---|
A extends unknown[] | The method's argument tuple, e.g. [MyArgs] or [string, number]. |
R | The method's resolved result type. |
Parameters
| Parameter | Type | Description |
|---|---|---|
opts | MethodOptions | See MethodOptions. opts.signal opts this method into abort-signal plumbing. |
Returns
MethodDescriptor<A, R>