/** * A ponyfill for requestIdleCallback that falls back to setTimeout. * Uses the native requestIdleCallback when available. * * @param callback - The function to call when the browser is idle. * @param options - Options object that may contain a timeout property. * @returns An ID that can be used to cancel the callback. * @public */ export declare function requestIdleCallback(callback: (deadline: IdleDeadline) => void, options?: { timeout: number; }): ReturnType; /** * A ponyfill for cancelIdleCallback that falls back to clearTimeout. * Uses the native cancelIdleCallback when available. * * @param id - The ID of the callback to cancel. * @public */ export declare function cancelIdleCallback(id: ReturnType): void; /** * Waits for all custom element descendants of a target element to be connected. * * @param target - The target element to observe. * @param callback - The function to call when all custom element descendants are connected. * @param options - Options object that may contain a timeout property for the idle callback. * * @remarks * This function uses requestIdleCallback to periodically check if all custom element * descendants (elements with a hyphen in their tag name) are connected to the DOM. * Once all such elements are connected, the provided callback is invoked. * * The `timeout` option specifies the maximum time to wait for each idle callback before * rechecking, defaulting to 50 milliseconds. * * @public */ export declare function waitForConnectedDescendants(target: HTMLElement, callback: () => void, options?: { /** * Whether to only check direct children of the target element, rather than all descendants. * @defaultValue `false` */ shallow?: boolean; /** * The maximum time to wait for each idle callback before rechecking for connected descendants, in milliseconds. * @defaultValue `50` */ timeout?: number; /** * Whether to call the callback on the next idle period after descendants are connected, rather than immediately. * This can be used to defer work until after the browser has had a chance to perform any necessary updates * following the connection of the descendants. * @defaultValue `false` */ idleCallback?: boolean; }): void;