/** * Base API client with rate limiting and retry logic * * @module research/clients/base */ import { ClientConfig, RateLimitConfig, RetryConfig } from '../types.js'; /** * Token bucket rate limiter */ export declare class RateLimiter { private config; private tokens; private lastRefill; constructor(config: RateLimitConfig); /** * Refill tokens based on elapsed time */ private refill; /** * Acquire a token, waiting if necessary */ acquire(): Promise; private sleep; /** * Get current token count (for testing) */ getCurrentTokens(): number; } /** * Base API client with common functionality */ export declare abstract class BaseClient { protected config: ClientConfig; protected rateLimiter: RateLimiter; protected retryConfig: RetryConfig; constructor(config: ClientConfig); /** * Execute an HTTP request with rate limiting and retry logic */ protected request(url: string, options?: RequestInit): Promise; /** * Execute request with exponential backoff retry */ private executeWithRetry; /** * Handle HTTP error responses */ private handleHttpError; /** * Determine if an error is retriable */ private isRetriable; /** * Calculate exponential backoff delay */ private calculateBackoff; private sleep; /** * Build URL with query parameters */ protected buildUrl(path: string, params: Record): string; } //# sourceMappingURL=base.d.ts.map