/** * Resolves after the browser has finished all pending microtasks, effects * and renders — i.e. once the current "work cycle" is fully idle. * * - Uses `requestIdleCallback` when available (Chromium, Firefox) so the * callback only runs when the main thread has no higher-priority work left. * - Falls back to `requestAnimationFrame` on browsers that don't support rIC * (Safari). A single rAF fires after all queued microtasks drain, which * covers the mates effectScheduler + globalScheduler flush cycle. * - In SSR (no window) the promise resolves on the next microtask so * server-side code can `await onceIdle()` without throwing. * * Accepts an optional `callback` that is invoked just before the promise * resolves, making both usage patterns work: * * @example * // await style — pause until idle, then continue * await onceIdle(); * console.log("all renders have settled"); * * // callback style — fire-and-forget * onceIdle(() => expensiveWork()); * * // callback + await — run work at the idle point, then continue * await onceIdle(() => expensiveWork()); */ export declare function onceIdle(callback?: () => void): Promise; //# sourceMappingURL=onceIdle.d.ts.map