@partex/one-core 2.0.108 → 2.0.109

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,26 +1,15 @@
1
- import { DebouncedFunc } from 'lodash';
2
- /// <reference types="lodash" />
1
+ import type { DebouncedFunc } from 'lodash';
3
2
  import type { Fn } from '../interface';
3
+ interface IDebounceAction {
4
+ run: DebouncedFunc<Fn<any, any>>;
5
+ cancel: () => void;
6
+ flush: () => void;
7
+ }
4
8
  /**
5
9
  * 防抖函数
6
10
  * @param fn
7
11
  * @param delay
8
12
  * @returns
9
13
  */
10
- export declare function useDebounceFn(fn: Fn, wait?: number): {
11
- /**
12
- * Invode and pass parameters to fn.
13
- * `(...args: any[]) => any`
14
- */
15
- run: DebouncedFunc<Fn<any, any>>;
16
- /**
17
- * Cancel the invocation of currently debounced function.
18
- * `() => void`
19
- */
20
- cancel: () => void;
21
- /**
22
- * Immediately invoke currently debounced function.
23
- * `() => void`
24
- */
25
- flush: () => any;
26
- };
14
+ export declare function useDebounceFn(fn: Fn, wait?: number): IDebounceAction;
15
+ export {};
@@ -1,14 +1,15 @@
1
- import { DebouncedFunc } from 'lodash';
2
- /// <reference types="lodash" />
1
+ import type { DebouncedFunc } from 'lodash';
3
2
  import type { Fn } from '../interface';
3
+ interface IThrottleAction {
4
+ run: DebouncedFunc<Fn<any, any>>;
5
+ cancel: () => void;
6
+ flush: () => void;
7
+ }
4
8
  /**
5
9
  * 节流函数
6
10
  * @param fn
7
11
  * @param delay
8
12
  * @returns
9
13
  */
10
- export declare function useThrottleFn(fn: Fn, wait?: number): {
11
- run: DebouncedFunc<(...args: Parameters<Fn>) => ReturnType<Fn>>;
12
- cancel: () => void;
13
- flush: () => any;
14
- };
14
+ export declare function useThrottleFn(fn: Fn, wait?: number): IThrottleAction;
15
+ export {};