# `ConstructorParameters<Type>`

> The `ConstructorParameters<Type>` utility type in TypeScript extracts the parameter types of a constructor function type.

## How do I get the constructor parameter types of a class in TypeScript?

The utility type that constructs a tuple type from the types of the parameters of a constructor function type. Useful for creating factory functions that accept the same arguments as a class.

- Topic: Utility Types
- Type: utility type

## Example

Wrong:

```ts
function make(...args: any[]) {
  return new User(...args);
}
```

Right:

```ts
function make(...args: ConstructorParameters<typeof User>) {
  return new User(...args);
}
```

The factory's arguments are now checked against the `User` constructor instead of accepting anything.

## Common mistakes

- Passing the instance type, `ConstructorParameters<User>`, and getting a constraint error.

## Key points

- The class is passed with `typeof`, as `ConstructorParameters<typeof User>`, not `ConstructorParameters<User>`.
- Factory functions spread the result as `...args: ConstructorParameters<typeof User>`.

## Interview questions

### How do I get the type of one constructor argument?

Index the tuple: `ConstructorParameters<typeof User>[0]` is the type of the first argument.

### Does ConstructorParameters work with abstract classes?

Yes, its constraint accepts abstract constructor types, so `ConstructorParameters<typeof Shape>` works for an abstract `Shape`.

## Related cards

- [`Parameters<T>`](https://wonderium.dev/ts/parameters.md)
- [`InstanceType<T>`](https://wonderium.dev/ts/instancetype.md)
- [typeof](https://wonderium.dev/ts/typeof.md)
- [class](https://wonderium.dev/ts/class.md)
- [`ReturnType<T>`](https://wonderium.dev/ts/returntype.md)

---

- Level: [TypeScript](https://wonderium.dev/ts.md)
- HTML version: https://wonderium.dev/ts/constructorparameters
- Last updated: 2026-11-25
