/**
 * useRateLimiting Hook
 *
 * Unified hook for throttling and debouncing function calls.
 * Replaces separate useThrottle and useDebounce hooks with a single,
 * more flexible implementation.
 *
 * @since v1.35.0
 */
/**
 * Rate limiting mode
 */
export type RateLimitMode = 'throttle' | 'debounce';
/**
 * Options for useRateLimiting
 */
export interface UseRateLimitingOptions {
    /** Rate limiting mode */
    mode: RateLimitMode;
    /** Wait time in milliseconds */
    wait: number;
    /** Execute on leading edge (default: true for throttle, false for debounce) */
    leading?: boolean;
    /** Execute on trailing edge (default: false for throttle, true for debounce) */
    trailing?: boolean;
    /** Maximum wait time before forcing execution (debounce only) */
    maxWait?: number;
}
/**
 * Return type for useRateLimiting
 */
export interface UseRateLimitingReturn<T extends (...args: unknown[]) => unknown> {
    /** The rate-limited function */
    fn: (...args: Parameters<T>) => ReturnType<T> | undefined;
    /** Whether there's a pending call */
    isPending: boolean;
    /** Cancel any pending call */
    cancel: () => void;
    /** Immediately execute any pending call */
    flush: () => void;
}
/**
 * Unified rate limiting hook for throttle and debounce
 *
 * @param callback - Function to rate limit
 * @param options - Rate limiting options
 * @returns Rate-limited function and control methods
 *
 * @example
 * ```typescript
 * // Throttle: execute immediately, then at most once per 500ms
 * const { fn: throttledScan } = useRateLimiting(scanServers, {
 *   mode: 'throttle',
 *   wait: 500,
 * });
 *
 * // Debounce: wait 300ms after last call before executing
 * const { fn: debouncedSearch, isPending } = useRateLimiting(search, {
 *   mode: 'debounce',
 *   wait: 300,
 * });
 *
 * // Debounce with max wait: execute after 1000ms even if still typing
 * const { fn: debouncedSave } = useRateLimiting(save, {
 *   mode: 'debounce',
 *   wait: 300,
 *   maxWait: 1000,
 * });
 * ```
 */
export declare function useRateLimiting<T extends (...args: unknown[]) => unknown>(callback: T, options: UseRateLimitingOptions): UseRateLimitingReturn<T>;
/**
 * Convenience hook for throttling
 */
export declare function useThrottle<T extends (...args: unknown[]) => unknown>(callback: T, wait: number, options?: {
    leading?: boolean;
    trailing?: boolean;
}): UseRateLimitingReturn<T>;
/**
 * Convenience hook for debouncing
 */
export declare function useDebounce<T extends (...args: unknown[]) => unknown>(callback: T, wait: number, options?: {
    leading?: boolean;
    trailing?: boolean;
    maxWait?: number;
}): UseRateLimitingReturn<T>;
/**
 * Hook for debouncing a value
 */
export declare function useDebouncedValue<T>(value: T, wait: number): T;
/**
 * Simple throttle that just returns the function (backward compatible)
 */
export declare function useThrottleFn<T extends (...args: unknown[]) => unknown>(callback: T, wait: number, options?: {
    leading?: boolean;
    trailing?: boolean;
}): (...args: Parameters<T>) => ReturnType<T> | undefined;
/**
 * Simple debounce that just returns the function (backward compatible)
 */
export declare function useDebounceFn<T extends (...args: unknown[]) => unknown>(callback: T, wait: number, options?: {
    leading?: boolean;
    trailing?: boolean;
    maxWait?: number;
}): (...args: Parameters<T>) => ReturnType<T> | undefined;
export default useRateLimiting;
//# sourceMappingURL=useRateLimiting.d.ts.map