mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-12-04 04:01:52 +00:00
use Parameters<T>
This commit is contained in:
Vendored
+1
-3
@@ -11,14 +11,12 @@ declare namespace debounce {
|
||||
}
|
||||
}
|
||||
|
||||
type ArgumentsType<T> = T extends (...args: infer A) => any ? A : never;
|
||||
|
||||
declare function debounce<T extends (...args: any[]) => any>(
|
||||
func: T,
|
||||
wait?: number,
|
||||
options?: debounce.DebounceOptions
|
||||
): (
|
||||
...args: ArgumentsType<T>
|
||||
...args: Parameters<T>
|
||||
) => ReturnType<T> extends Promise<any>
|
||||
? ReturnType<T>
|
||||
: Promise<ReturnType<T>>;
|
||||
|
||||
Reference in New Issue
Block a user