Parameters<T>
The utility type that gives a function type's parameter list as a tuple, such as [orderId: string, priority: boolean].
In more detail
A wrapper typed (...args: Parameters<F>) => ReturnType<F> accepts exactly the same arguments as the function it wraps and keeps its auto-complete. Like ReturnType, it is built from a conditional type with infer.
Related terms
- ReturnType<T> — The utility type that gives the return type of a function type T.
- tuple — An ordered, fixed-length group of values in which each position can have its own meaning and type.
- rest parameter — A final function parameter written ...args that collects all remaining arguments into an array.
- wrapper function — A function that calls another function, adding behaviour before or after it, such as timing, retries or logging.
Taught in
- Function Utilities: ReturnType, Parameters And Constructor — Production TypeScript