import { type ClientConfig, type RequestOptions } from "./types.js"; /** * Base HTTP client with configurable baseUrl and API key (Bearer auth). * Provides methods for GET, POST, PUT, DELETE requests with JSON serialization, * error handling, and SSE streaming support. */ export declare class BaseClient { protected readonly baseUrl: string; protected readonly apiKey: string; protected readonly defaultHeaders: Record; constructor(config: ClientConfig); /** * Serialize a record of query parameters into a URL query string. * Undefined and null values are omitted. */ protected buildQueryString(params?: Record): string; /** * Build merged headers for a request, combining defaults with per-request overrides. */ private mergeHeaders; /** * Perform a fetch request and handle errors. * Returns the raw Response object. */ protected fetchRaw(url: string, init: RequestInit, options?: RequestOptions): Promise; /** * Perform a request and parse the JSON response body. */ protected request(method: string, path: string, options?: RequestOptions & { body?: unknown; query?: Record; }): Promise; /** Perform a GET request. */ protected _get(path: string, query?: Record, options?: RequestOptions): Promise; /** Perform a POST request. */ protected _post(path: string, body?: unknown, options?: RequestOptions & { query?: Record; }): Promise; /** Perform a PUT request. */ protected _put(path: string, body?: unknown, options?: RequestOptions): Promise; /** Perform a PATCH request. */ protected _patch(path: string, body?: unknown, options?: RequestOptions): Promise; /** Perform a DELETE request. */ protected _delete(path: string, options?: RequestOptions & { query?: Record; }): Promise; /** * Perform a POST request that returns a Server-Sent Events (SSE) stream. * Yields parsed data objects of type T for each SSE "data:" line. * The stream ends when a "data: [DONE]" message is received or the * response body is exhausted. */ protected _stream(path: string, body?: unknown, options?: RequestOptions & { query?: Record; }): AsyncGenerator; }