Classes

@system-inc/base-foundation · 515c140 · 4 symbols

An RPC client driver that uses a Fetcher to send requests. A Fetcher is an interface from Cloudflare that implements the fetch method.

extends RpcClientDriver

Members

  • fetcher: Fetcher

  • buildRequest(rpc: RpcCall, options: RpcCallOptions & RpcClientOptions): RequestInit

  • handleResponse(rpc: RpcCall, response: Response): Promise<RpcClientResult<RpcResult>>

  • sendRequest(request: RequestInit): Promise<Response>

View source ↗

Binding for a Cloudflare service binding (RPC). The name matches the binding declared in wrangler.toml. Used with @InjectRpcClient(...).

The RpcInterface parameter is the RPC type exposed by the target service; the decorator return type threads it through as RpcClient<RpcInterface>.

extends TypedBinding

Members

  • name: string

  • toString(): string

View source ↗

Creates a RemoteProcedureClient for the given service name.

Members

  • createClient(serviceName: string): RpcClient<RpcInterface>

    Creates a client for the given remote procedure service.

  • createClientFromSettings(rpcSettings: RpcClientSettings, environment: string): RpcClient<RpcInterface>

    Creates a client from the given RPC settings.

View source ↗

An RPC client driver that forwards RPCs to a WebSocket as WebSocketEvents.

extends RpcClientDriver

Members

  • buildRequest(rpc: RpcCall, options: RpcCallOptions & RpcClientOptions): RequestInit

  • handleResponse(rpc: RpcCall, response: Response): Promise<RpcClientResult<RpcResult>>

  • sendRequest(request: RequestInit): Promise<Response>

View source ↗

Classes • Documentation • Base