/** * Wait until the first paint has happened and the main thread has had an idle * moment, then run `callback` exactly once. Returns a cancel function. * * Fast path: `requestAnimationFrame` → `requestIdleCallback` (with a timeout * so a busy main thread cannot starve it). Two safety nets keep the callback * reliable: browsers without `requestIdleCallback` fall back to a macrotask, * and a bounded timer covers hidden tabs where `requestAnimationFrame` never * fires. Never runs during SSR — React effects do not run on the server, and * the scheduler is a no-op without a `window`. */ export type ScheduleAfterPaintCancel = () => void; export declare function scheduleAfterPaint(callback: () => void): ScheduleAfterPaintCancel; export declare function useAfterPaint(): boolean; /** * `scheduleAfterPaint`, but never before the page is `STARTUP_SETTLE_MS` old. * Later in the page's life it is `scheduleAfterPaint` unchanged. */ export declare function scheduleAfterStartup(callback: () => void): ScheduleAfterPaintCancel; export declare function useAfterStartup(): boolean;