/**
 * Tool Throttle
 *
 * Throttles tool phase updates to prevent overwhelming
 * the UI with too many updates. Default throttle is 80ms.
 */
import type { ToolPhaseEvent } from './tool-phases.js';
/**
 * Throttle configuration
 */
export interface ThrottleConfig {
    /** Throttle interval in milliseconds */
    intervalMs: number;
    /** Whether to emit the first event immediately */
    leading: boolean;
    /** Whether to emit the last event after interval */
    trailing: boolean;
    /** Maximum queue size for pending events */
    maxQueueSize: number;
}
/**
 * Default throttle configuration
 */
export declare const DEFAULT_THROTTLE_CONFIG: ThrottleConfig;
/**
 * Create a throttled function
 */
export declare function throttle<T extends (...args: unknown[]) => void>(fn: T, config?: Partial<ThrottleConfig>): T & {
    cancel: () => void;
    flush: () => void;
};
/**
 * Throttles tool phase events by tool call ID
 */
export declare class ToolPhaseThrottler {
    private config;
    private queues;
    private lastEmit;
    private timers;
    private callback;
    constructor(config?: Partial<ThrottleConfig>);
    /**
     * Set the callback for throttled events
     */
    setCallback(callback: (event: ToolPhaseEvent) => void): void;
    /**
     * Push an event to the throttler
     */
    push(event: ToolPhaseEvent): void;
    /**
     * Queue an event for later emission
     */
    private queueEvent;
    /**
     * Flush queued events for a tool call
     */
    private flushQueue;
    /**
     * Clear queue for a tool call
     */
    private clearQueue;
    /**
     * Emit an event via callback
     */
    private emitEvent;
    /**
     * Flush all pending events
     */
    flushAll(): void;
    /**
     * Cancel all pending events
     */
    cancelAll(): void;
    /**
     * Get throttle interval
     */
    getInterval(): number;
    /**
     * Set throttle interval
     */
    setInterval(intervalMs: number): void;
    /**
     * Dispose
     */
    dispose(): void;
}
/**
 * Get or create the ToolPhaseThrottler singleton
 */
export declare function getToolPhaseThrottler(config?: Partial<ThrottleConfig>): ToolPhaseThrottler;
/**
 * Reset the ToolPhaseThrottler singleton
 */
export declare function resetToolPhaseThrottler(): void;
