/** * Client: a reference to a capability (local, remote, or promised). * * Generated interface clients (e.g. `Calculator_Client`) wrap a Client and expose typed * methods. Lifetime is explicit: disposing a client releases its slot in the * connection's import table (sending a Release message). Both `dispose()` and * `Symbol.dispose` are provided; `using` works where the runtime supports it. */ import { Struct, StructCtor } from "../serialization/pointers/struct"; import { RemotePromise } from "./remote-promise"; import type { Answer, Conn, Question } from "./conn"; import type { Server } from "./server"; /** Metadata describing one interface method; emitted by codegen. */ export interface Method

{ interfaceId: bigint; interfaceName: string; methodId: number; methodName: string; ParamsClass: StructCtor

; ResultsClass: StructCtor; } /** * Params for a call: a builder callback or a plain-object shape (generated method * signatures narrow the shape to the param struct's X_Shape type). */ export type ParamsInit

= ((params: P) => void) | object; /** Apply a ParamsInit to a freshly allocated params struct. */ export declare function applyParams

(init: ParamsInit

| undefined, params: P): void; /** Generated RemotePromise subclasses must be constructible with no arguments. */ export type RemotePromiseCtor> = new () => A; /** Where calls on a Client go. Internal. */ export type Target = { answer: Answer; tag: "answer"; transform: number[]; } | { tag: "broken"; reason: string; } | { tag: "import"; conn: Conn; id: number; } | { tag: "local"; server: Server; } | { tag: "promised"; question: Question; transform: number[]; }; export declare class Client { _target: Target; constructor(target: Target); /** * Start a call on this capability. The Call message is sent (or dispatched locally) * before this returns; the returned RemotePromise resolves with the results. * Generated methods pass their pipelined RemotePromise subclass as `PromiseClass`. */ call

= RemotePromise>(method: Method, paramsFunc?: ParamsInit

, PromiseClass?: RemotePromiseCtor): A; dispose(): void; [Symbol.dispose](): void; }