Typescript now has the ConstructorParameters
builtin, similar to the Parameters
builtin. Make sure you pass the class type, not the instance:
ConstructorParameters<typeof SomeClass>
More Related Contents:
- Is there a `valueof` similar to `keyof` in TypeScript?
- How does interfaces with construct signatures work?
- How to check the object type on runtime in TypeScript?
- Typescript, merge object types?
- How to exclude getter only properties from type in typescript
- How do I declare object value type without declaring key type?
- Typescript: Check “typeof” against custom type
- Constructor overload in TypeScript
- Specify method’s type without converting the method to property
- How to declare a Fixed length Array in TypeScript
- Is it possible to restrict number to a certain range
- Is there a way to define type for array with unique items in typescript?
- TypeScript: Accept all Object keys that map to a specific type
- How to undestand relations between types any, unknown, {} and between them and other types?
- Difference between extending and intersecting interfaces in TypeScript?
- Class constructor type in typescript?
- TypeScript keyof returning specific type
- Typescript narrowing of keys in objects when passed to function
- What is the purpose of bivarianceHack in TypeScript types?
- typescript difference between placement of generics arguments
- Mapped Types: removing optional modifier
- Why can I avoid excess property check in typescript just by passing a reference to an object to a function rather than the object in its literal form?
- Typescript interface default values
- How to configure custom global interfaces (.d.ts files) for TypeScript?
- How to selectively assign from one Partial to another in typescript
- Experimental decorators warning in TypeScript compilation
- A TypeScript GUID class? [closed]
- What does “homomorphic mapped type” mean?
- What does “all legal JavaScript is legal TypeScript” mean?
- Empty interface allow any object?