interface DebounceSettings { /** * If `true`, the function will be invoked on the leading edge of the timeout. * @default false */ leading?: boolean | undefined; /** * The maximum time `func` is allowed to be delayed before it's invoked. * @default Infinity */ maxWait?: number | undefined; /** * If `true`, the function will be invoked on the trailing edge of the timeout. * @default true */ trailing?: boolean | undefined; } interface DebounceSettingsLeading extends DebounceSettings { leading: true; } export interface DebouncedFunc any> { /** * Call the original function, but applying the debounce rules. */ (...args: Parameters): ReturnType | undefined; /** * Throw away any pending invocation of the debounced function. */ cancel(): void; /** * If there is a pending invocation of the debounced function, invoke it * immediately and return its return value. */ flush(): ReturnType | undefined; } export interface DebouncedFuncLeading any> extends DebouncedFunc { (...args: Parameters): ReturnType; flush(): ReturnType; } /** * Creates a debounced function that delays invoking `func` until after * `debounceMs` milliseconds have elapsed since the last time it was invoked. * * Lodash-compatible wrapper (es-toolkit `src/compat/function/debounce.ts`), * supporting `leading`, `trailing`, and `maxWait` options. */ export declare function debounce any>(func: T, wait: number | undefined, options: DebounceSettingsLeading): DebouncedFuncLeading; export declare function debounce any>(func: T, wait?: number, options?: DebounceSettings): DebouncedFunc; export {}; //# sourceMappingURL=debounce.d.ts.map