mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-01-31 05:57:33 +00:00
style: simplify AnyFunction
This commit is contained in:
parent
52edc85c57
commit
e27732021e
7
types/throttleit/index.d.ts
vendored
7
types/throttleit/index.d.ts
vendored
@ -4,7 +4,7 @@
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
type AnyFunction<R = any> = (...args: any[]) => R;
|
||||
type AnyFunction = (...args: any[]) => any;
|
||||
|
||||
/**
|
||||
* Returns a new function that, when invoked, invokes `func` at most once per `wait` milliseconds.
|
||||
@ -13,6 +13,9 @@ type AnyFunction<R = any> = (...args: any[]) => R;
|
||||
* @param wait Number of milliseconds that must elapse between `func` invocations.
|
||||
* @return A new function that wraps the `func` function passed in.
|
||||
*/
|
||||
declare function throttle<GFunction extends AnyFunction>(fn: GFunction, wait: number): GFunction;
|
||||
declare function throttle<GFunction extends AnyFunction>(
|
||||
fn: GFunction,
|
||||
wait: number,
|
||||
): GFunction;
|
||||
|
||||
export = throttle;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user