mirror of
https://github.com/Kir-Antipov/mc-publish.git
synced 2024-11-22 00:11:02 -05:00
Added a type that unwraps constructor parameters
This commit is contained in:
parent
e473e4b641
commit
1967a52df9
1 changed files with 6 additions and 0 deletions
6
src/utils/types/constructor-parameters.ts
Normal file
6
src/utils/types/constructor-parameters.ts
Normal file
|
@ -0,0 +1,6 @@
|
|||
/**
|
||||
* Obtains the parameters of a constructor function.
|
||||
*
|
||||
* @template T - The constructor function.
|
||||
*/
|
||||
export type ConstructorParameters<T extends new (...args: unknown[]) => unknown> = T extends new (...args: infer P) => unknown ? P : never;
|
Loading…
Reference in a new issue