What is the Parameters utility type?
Answer
Parameters<T> is a built-in utility type that extracts the parameter types of a function type T as a tuple. Implementation: type Parameters<T extends (...args: any) => any> = T extends (...args: infer P) => any ? P : never. Example: function createUser(name: string, age: number, admin: boolean): User { ... } type CreateUserArgs = Parameters<typeof createUser>; — CreateUserArgs is [name: string, age: number, admin: boolean]. Useful for: wrapper functions that need the same parameters as another function, currying helpers, memoization wrappers. Access individual parameters: type FirstArg = Parameters<typeof createUser>[0]; — gives string. Related: ConstructorParameters<T> does the same for class constructor parameters, returning the types as a tuple. These types help you stay DRY — define parameter types once in the function and derive them everywhere else.