UNPKG

@orpc/client

Version:

<div align="center"> <image align="center" src="https://orpc.unnoq.com/logo.webp" width=280 alt="oRPC logo" /> </div>

34 lines (30 loc) 1.63 kB
import { StandardRequest, StandardLazyResponse } from '@orpc/standard-server'; import { ToFetchRequestOptions } from '@orpc/standard-server-fetch'; import { b as ClientContext, c as ClientOptions } from '../../shared/client.BOYsZIRq.mjs'; import { f as StandardLinkClient } from '../../shared/client.Bwgm6dgk.mjs'; import { f as StandardRPCLinkOptions, g as StandardRPCLink } from '../../shared/client.Ycwr4Tuo.mjs'; import '@orpc/shared'; interface LinkFetchClientOptions<T extends ClientContext> extends ToFetchRequestOptions { fetch?: (request: Request, init: { redirect?: Request['redirect']; }, options: ClientOptions<T>, path: readonly string[], input: unknown) => Promise<Response>; } declare class LinkFetchClient<T extends ClientContext> implements StandardLinkClient<T> { private readonly fetch; private readonly toFetchRequestOptions; constructor(options: LinkFetchClientOptions<T>); call(request: StandardRequest, options: ClientOptions<T>, path: readonly string[], input: unknown): Promise<StandardLazyResponse>; } interface RPCLinkOptions<T extends ClientContext> extends StandardRPCLinkOptions<T>, LinkFetchClientOptions<T> { } /** * The RPC Link communicates with the server using the RPC protocol. * * @see {@link https://orpc.unnoq.com/docs/client/rpc-link RPC Link Docs} * @see {@link https://orpc.unnoq.com/docs/advanced/rpc-protocol RPC Protocol Docs} */ declare class RPCLink<T extends ClientContext> extends StandardRPCLink<T> { constructor(options: RPCLinkOptions<T>); } export { LinkFetchClient, RPCLink }; export type { LinkFetchClientOptions, RPCLinkOptions };