/**
 * Idle Scheduler - Defer non-critical work to browser idle periods.
 *
 * Uses requestIdleCallback where available, with fallback to setTimeout.
 * This allows the main thread to remain responsive during startup.
 */
/**
 * IdleDeadline-compatible interface for fallback.
 */
interface IdleDeadlineLike {
    didTimeout: boolean;
    timeRemaining(): number;
}
/**
 * Schedule work to run during browser idle time.
 * Falls back to setTimeout(0) if requestIdleCallback is not available.
 *
 * @param callback - Work to run when idle
 * @param options - Optional timeout configuration
 * @returns Handle for cancellation
 */
export declare function scheduleIdle(callback: (deadline: IdleDeadlineLike) => void, options?: {
    timeout?: number;
}): number;
/**
 * Cancel a scheduled idle callback.
 */
export declare function cancelIdle(handle: number): void;
/**
 * Deferred work queue that runs tasks during idle periods.
 * Groups related work and processes in priority order.
 */
export declare class IdleQueue {
    private tasks;
    private scheduled;
    private handle;
    /**
     * Add a task to the queue.
     * @param fn - Function to execute
     * @param priority - Priority (lower = run sooner). Default 10.
     */
    add(fn: () => void, priority?: number): void;
    /**
     * Process tasks until we run out of time or tasks.
     */
    private process;
    /**
     * Cancel all pending tasks.
     */
    cancel(): void;
    /**
     * Check if the queue is empty.
     */
    get isEmpty(): boolean;
}
export {};
//# sourceMappingURL=idle-scheduler.d.ts.map