import { CustomHook } from './hooks/custom-hook.js'; import { Request } from './transport/request.js'; import { CursorPaginatedHttpResponse, HttpResponse, PaginatedHttpResponse, SdkConfig } from './types.js'; /** * Core HTTP client for making API requests. * Manages request/response handling through a chain of handlers for validation, retry, hooks, and more. */ export declare class HttpClient { private config; /** Chain of request handlers that process requests in sequence */ private readonly requestHandlerChain; /** * Creates a new HTTP client with configured request handlers. * @param config - SDK configuration including base URL and authentication * @param hook - Optional custom hook for request/response interception */ constructor(config: SdkConfig, hook?: CustomHook); /** * Executes a standard HTTP request. * @template T - The expected response data type * @param request - The HTTP request to execute * @returns A promise that resolves to the HTTP response */ call(request: Request): Promise>; /** * Executes a streaming HTTP request that yields responses incrementally. * @template T - The expected response data type for each chunk * @param request - The HTTP request to execute * @returns An async generator that yields HTTP responses */ stream(request: Request): AsyncGenerator>; /** * Executes a paginated HTTP request and extracts the page data from the response. * @template FullResponse - The complete response type from the API * @template Page - The type of a single page of data * @param request - The paginated HTTP request to execute * @returns A promise that resolves to the paginated HTTP response * @throws Error if the response contains no data to paginate through */ callPaginated(request: Request): Promise>; /** * Executes a cursor-paginated HTTP request and extracts both page data and the next cursor. * @template FullResponse - The complete response type from the API * @template Page - The type of a single page of data * @param request - The cursor-paginated HTTP request to execute * @returns A promise that resolves to the cursor-paginated HTTP response with next cursor * @throws Error if the response contains no data to paginate through */ callCursorPaginated(request: Request): Promise>; /** * Updates the base URL for all subsequent requests. * @param url - The new base URL to use */ setBaseUrl(url: string): void; /** * Updates the SDK configuration. * @param config - The new SDK configuration */ setConfig(config: SdkConfig): void; /** * Extracts page data from a full API response using the configured pagination path. * @template FullResponse - The complete response type from the API * @template Page - The type of a single page of data * @param request - The request containing pagination configuration * @param data - The full response data to extract the page from * @returns The extracted and parsed page data * @throws Error if pagination is not configured or page extraction fails */ private getPage; /** * Extracts the next cursor from a full API response for cursor-based pagination. * @template FullResponse - The complete response type from the API * @template Page - The type of a single page of data * @param request - The request containing cursor pagination configuration * @param data - The full response data to extract the cursor from * @returns The next cursor string, null if no more pages, or undefined if not cursor pagination */ private getNextCursor; } //# sourceMappingURL=client.d.ts.map