/**
 * Request utilities for HTTP clients
 *
 * Provides reusable components for request deduplication, queuing, and logging
 */
/**
 * Request deduplication - prevents duplicate concurrent requests
 *
 * When multiple requests with the same key are made simultaneously,
 * only one request is executed and all callers receive the same result.
 *
 * @example
 * ```typescript
 * const deduplicator = new RequestDeduplicator();
 *
 * // Multiple calls with same key will share the same promise
 * const promise1 = deduplicator.deduplicate('user-123', () => fetchUser('123'));
 * const promise2 = deduplicator.deduplicate('user-123', () => fetchUser('123'));
 * // promise1 === promise2, only one API call is made
 * ```
 */
export declare class RequestDeduplicator {
    private pendingRequests;
    /**
     * Deduplicate a request by key
     * @param key Unique key for the request
     * @param requestFn Function that returns a promise
     * @returns Promise that will be shared if key already exists
     */
    deduplicate<T>(key: string, requestFn: () => Promise<T>): Promise<T>;
    /**
     * Clear all pending requests
     */
    clear(): void;
    /**
     * Get number of pending requests
     */
    size(): number;
}
/**
 * Request queue with concurrency control
 *
 * Limits the number of concurrent requests and queues excess requests.
 * Useful for rate limiting and preventing request flooding.
 *
 * @example
 * ```typescript
 * const queue = new RequestQueue(5, 100); // Max 5 concurrent, queue up to 100
 *
 * // All requests will be queued and processed with max 5 concurrent
 * await queue.enqueue(() => fetchUser('1'));
 * await queue.enqueue(() => fetchUser('2'));
 * // ...
 * ```
 */
export declare class RequestQueue {
    private queue;
    private running;
    private maxConcurrent;
    private maxQueueSize;
    /**
     * Create a new request queue
     * @param maxConcurrent Maximum number of concurrent requests (default: 10)
     * @param maxQueueSize Maximum queue size (default: 100)
     */
    constructor(maxConcurrent?: number, maxQueueSize?: number);
    /**
     * Enqueue a request
     * @param requestFn Function that returns a promise
     * @returns Promise that resolves when request completes
     */
    enqueue<T>(requestFn: () => Promise<T>): Promise<T>;
    /**
     * Process queued requests
     */
    private process;
    /**
     * Clear all queued requests
     */
    clear(): void;
    /**
     * Get queue size
     */
    size(): number;
    /**
     * Get number of currently running requests
     */
    runningCount(): number;
}
/**
 * Simple logger with level support
 *
 * Lightweight logger for HTTP clients and utilities.
 * For more advanced logging, use loggerUtils.ts
 *
 * @example
 * ```typescript
 * const logger = new SimpleLogger(true, 'debug');
 * logger.debug('Debug message');
 * logger.info('Info message');
 * logger.error('Error message');
 * ```
 */
export declare class SimpleLogger {
    private enabled;
    private level;
    private prefix;
    /**
     * Create a new simple logger
     * @param enabled Whether logging is enabled
     * @param level Minimum log level
     * @param prefix Prefix for log messages (default: '')
     */
    constructor(enabled?: boolean, level?: string, prefix?: string);
    private shouldLog;
    private formatMessage;
    error(...args: any[]): void;
    warn(...args: any[]): void;
    info(...args: any[]): void;
    debug(...args: any[]): void;
}
//# sourceMappingURL=requestUtils.d.ts.map