/** * Interval Management Utilities * Utilities for managing setInterval/clearInterval operations with cleanup */ /** * Interval manager for tracking and cleaning up intervals */ export declare class IntervalManager { private intervals; /** * Create and track a new interval * * @param callback - Function to execute * @param delay - Delay between executions * @returns Interval ID */ setInterval(callback: () => void, delay: number): ReturnType; /** * Clear a specific interval * * @param id - Interval ID to clear */ clearInterval(id: ReturnType): void; /** * Clear all managed intervals */ clearAll(): void; /** * Get count of active intervals */ get count(): number; } /** * Create a managed interval that auto-cleans up * * @param callback - Function to execute * @param delay - Delay between executions * @returns Object with clear method * * @example * ```typescript * const timer = createManagedInterval(() => { * console.log('tick'); * }, 1000); * * // Later: clean up * timer.clear(); * ``` */ export declare function createManagedInterval(callback: () => void, delay: number): { clear: () => void; id: ReturnType; }; /** * Create an interval that automatically stops after a maximum number of executions * * @param callback - Function to execute * @param delay - Delay between executions * @param maxExecutions - Maximum number of times to execute * @returns Object with clear method * * @example * ```typescript * const timer = createLimitedInterval(() => { * console.log('tick'); * }, 1000, 5); // Will execute 5 times then stop * ``` */ export declare function createLimitedInterval(callback: () => void, delay: number, maxExecutions: number): { clear: () => void; id: ReturnType; }; /** * Create an interval that stops when a condition becomes true * * @param callback - Function to execute * @param delay - Delay between executions * @param stopCondition - Function that returns true when interval should stop * @returns Object with clear method * * @example * ```typescript * let counter = 0; * const timer = createConditionalInterval(() => { * counter++; * console.log(`Count: ${counter}`); * }, 1000, () => counter >= 10); // Stops when counter reaches 10 * ``` */ export declare function createConditionalInterval(callback: () => void, delay: number, stopCondition: () => boolean): { clear: () => void; id: ReturnType; }; //# sourceMappingURL=interval-manager.d.ts.map