diff --git a/src/utils/types/constructor-return-type.ts b/src/utils/types/constructor-return-type.ts new file mode 100644 index 0000000..0337288 --- /dev/null +++ b/src/utils/types/constructor-return-type.ts @@ -0,0 +1,6 @@ +/** + * Obtains the return type of a constructor function. + * + * @template T - The constructor function. + */ +export type ConstructorReturnType unknown> = T extends new () => infer R ? R : never;