style: simplify AnyFunction

This commit is contained in:
Ifiok Jr 2019-04-16 16:10:22 +01:00
parent 52edc85c57
commit e27732021e
No known key found for this signature in database
GPG Key ID: 8EF46CD5738DCC1B

View File

@ -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;