20 lines
850 B
TypeScript
20 lines
850 B
TypeScript
/**
|
|
* Lodash (Custom Build) <https://lodash.com/>
|
|
* Build: `lodash modularize exports="es" include="debounce" -p -o ./`
|
|
* Copyright JS Foundation and other contributors <https://js.foundation/>
|
|
* Released under MIT license <https://lodash.com/license>
|
|
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
*/
|
|
export type DebounceOptions = {
|
|
leading?: boolean;
|
|
maxWait?: number;
|
|
trailing?: boolean;
|
|
};
|
|
export type DebouncedFunction<T extends (...args: any[]) => any> = {
|
|
(...args: Parameters<T>): ReturnType<T> | undefined;
|
|
cancel: () => void;
|
|
flush: () => ReturnType<T> | undefined;
|
|
};
|
|
export declare function debounce<T extends (...args: any[]) => any>(func: T, wait: number, options?: DebounceOptions): DebouncedFunction<T>;
|