import type { ListenerTimer, Register, Unregister } from "../types"; /** * Calls `callback` at least every `duration` milliseconds. Returns a function that stops future calls of `callback`. * If the `duration` is `0`, it uses `requestAnimationFrame` if available. * * @param duration Minimum duration of each interval in milliseconds. * @param callback Called at the end of each interval. * @returns Function that cancels the interval. */ export declare function interval(duration: number, callback: ListenerTimer): Unregister; /** * Returns a function that registers a `callback` to be called at least every `duration` milliseconds. * If the `duration` is `0`, if uses `requestAnimationFrame` if available. * The interval is set during this call. * * @param duration Minimum duration of each interval in milliseconds. * @returns Function that registers a callback to call at each elapsed interval, and returns a function that unregisters it. If the latter function unregisters the last callback, it clears the interval. When registering a callback on a cleared interval, throws an `Error` exception. */ export declare function interval(duration: number): Register;