Skip to content

Commit 12ea50b

Browse files
committed
feat: add ReturnType utility type to Utils namespace in utils.ts
1 parent 2be668c commit 12ea50b

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/utils.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ export const MINIMAL_LIB = `
4646
interface NewableFunction extends Function {}
4747
interface IArguments { }
4848
interface RegExp { }
49+
50+
declare namespace Utils {
51+
type ReturnType<T extends (...args: any) => any> = T extends (...args: any) => infer R ? R : any;
52+
}
53+
54+
import ReturnType = Utils.ReturnType;
4955
`;
5056

5157
/**

0 commit comments

Comments
 (0)