fuc-new/doc/node_modules/ts-debounce/dist/src/index.d.ts
hellcat 6adbc04d4b 1
2025-10-03 17:17:08 +08:00

14 lines
634 B
TypeScript

export declare type Options<Result> = {
isImmediate?: boolean;
maxWait?: number;
callback?: (data: Result) => void;
};
export interface DebouncedFunction<Args extends any[], F extends (...args: Args) => any> {
(this: ThisParameterType<F>, ...args: Args): Promise<ReturnType<F>>;
cancel: (reason?: any) => void;
}
export declare function debounce<Args extends any[], F extends (...args: Args) => any>(func: F, waitMilliseconds?: number, options?: Options<ReturnType<F>>): {
(this: ThisParameterType<F>, ...args: Parameters<F> & Args): Promise<ReturnType<F>>;
cancel: (reason?: any) => void;
};