import type { TokenBatch } from './inference-types.js'; import { type ChatInput, type EmbedOptions, type EmbeddingResult, type EndpointRef, type GenerationResult, type QueryInput, type QueryOptions, type GatewayEndpointOptions } from '../models/types.js'; /** Normalized gateway endpoint stored by the browser client. */ export interface GatewayEndpoint { readonly id: string; readonly target: string; readonly baseUrl: string; readonly routes: { readonly query: string; readonly chat: string; readonly embed: string; }; readonly authentication: { readonly kind: 'none' | 'bearer' | 'header'; readonly headerName?: string; readonly value?: string; readonly valueProvider?: () => string | Promise; }; readonly staticHeaders: Readonly>; readonly timeoutMs?: number; readonly protocolOptions: Readonly>; } /** Registry for browser gateway endpoints. */ export declare class GatewayEndpointRegistry { #private; prepare(id: string, options: GatewayEndpointOptions): GatewayEndpoint; commit(endpoint: GatewayEndpoint): EndpointRef; remove(id: string): boolean; get(endpoint: EndpointRef | undefined): GatewayEndpoint | null; } /** Run a browser query through a gateway endpoint. */ export declare function runGatewayQuery(endpoint: GatewayEndpoint, input: QueryInput, options: QueryOptions, tokenBatchSink: ((batch: TokenBatch) => void) | undefined, signal: AbortSignal): Promise; /** Run a browser chat request through a gateway endpoint. */ export declare function runGatewayChat(endpoint: GatewayEndpoint, input: ChatInput, options: QueryOptions, tokenBatchSink: ((batch: TokenBatch) => void) | undefined, signal: AbortSignal): Promise; /** Run a browser embedding request through a gateway endpoint. */ export declare function runGatewayEmbedding(endpoint: GatewayEndpoint, input: string, options: EmbedOptions, signal: AbortSignal): Promise;