import type { DescMessage, DescMethod, DescMethodUnary, DescService, MessageValidType } from "@bufbuild/protobuf"; import type { CallOptions } from "@connectrpc/connect"; import type { Options, RequestOptions } from "@cerbos/core"; import type { Optional } from "@cerbos/core/~internal"; import type { Credentials } from "./credentials.js"; import type { MessageInitShape } from "./protobuf.js"; /** * Options for connecting to Cerbos Hub. */ export interface ClientOptions extends Pick { /** * Client credentials to authenticate with Cerbos Hub. */ credentials: Credentials; /** * Base URL of the Cerbos Hub server. * * @defaultValue `"https://api.cerbos.cloud"` */ baseUrl?: string | undefined; } interface InternalClientOptions extends Optional { createError?: ((error: unknown) => Error) | undefined; } /** @internal */ export type Client = { [P in keyof Desc["method"]]: Method; }; type Method = M extends DescMethodUnary ? MethodUnary : never; type MethodUnary = (request: MessageInitShape, options: CallOptions) => Promise>; /** @internal */ export declare function createClient(service: T, { credentials, createError, ...options }?: InternalClientOptions): Client; export declare function callOptions({ headers, signal, }?: RequestOptions): CallOptions; export {}; //# sourceMappingURL=client.d.ts.map