import type { AnyFunc } from "./basic.js"; export type DebounceOptions = { /** * The wait time in milliseconds before the debounced function can be invoked again. * * @defaultValue 0 milliseconds */ wait?: number; /** * Determines whether the function should be invoked immediately at the leading edge of the timeout. * * @defaultValue false */ leading?: boolean; /** * Determines whether the function should be invoked after the wait time as passed at the trailing edge. * * @defaultValue true */ trailing?: boolean; /** * The maximum time in milliseconds the function can be delayed before it's invoked. * * @defaultValue 0 (no maximum delay) * * @since 1.10.0 */ maxWait?: number; }; export type DebouncedFn = { /** * The debounced function. */ (this: ThisParameterType, ...args: Parameters): ReturnType | undefined; /** * Cancels the debounced function. * * @deprecated Use `debounced.cancel()` instead. */ clear: () => void; /** * Cancels the debounced function. */ cancel: () => void; /** * Invokes the debounced function immediately. */ flush: () => ReturnType | undefined; }; /** * Creates a debounced function that delays invoking the provided function until after `wait` milliseconds have elapsed since the last time the debounced function was invoked. * * @from lodash/debounce */ export declare function debounce(fn: T, options?: DebounceOptions): DebouncedFn;