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 return type
This commit is contained in:
parent
f436b151aa
commit
2c2bcb4de7
1 changed files with 6 additions and 0 deletions
6
src/utils/types/constructor-return-type.ts
Normal file
6
src/utils/types/constructor-return-type.ts
Normal file
|
@ -0,0 +1,6 @@
|
|||
/**
|
||||
* Obtains the return type of a constructor function.
|
||||
*
|
||||
* @template T - The constructor function.
|
||||
*/
|
||||
export type ConstructorReturnType<T extends new (...args: unknown[]) => unknown> = T extends new () => infer R ? R : never;
|
Loading…
Reference in a new issue