import type { ListenerTimer, Register, Unregister } from "../types"; /** * Calls `callback` after at least `duration` milliseconds. Returns a function that cancels the future call of `callback`, if not already called. * If the `duration` is `0`, it uses `requestAnimationFrame` if available. * * @param duration Timeout duration in milliseconds. * @param callback Called after the `duration` elapsed. * @returns Function that cancels the call of `callback`. */ export declare function timeout(duration: number, callback: ListenerTimer): Unregister; /** * Returns a function that registers a `callback` to be called after at least `duration` milliseconds elapsed. * If the `duration` is `0`, if uses `requestAnimationFrame` if available. * The timer is set during this call. * * @param duration Timeout duration in milliseconds. * @returns Function that registers a callback to call after the `duration` elapsed, and returns a function that unregisters it. If the latter function unregisters the last callback, it clears the timeout. */ export declare function timeout(duration: number): Register;