We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 0abc04d + f2841c2 commit 2dd902aCopy full SHA for 2dd902a
index.d.ts
@@ -1,3 +1,5 @@
1
-type AsyncFunction<T> = (...args: any[]) => Promise<T>;
+type AsyncFunction<S extends any[], T> = (...args: S) => Promise<T>;
2
3
-export default function greenlet<T extends AsyncFunction<U>, U>(fn: T): T;
+type MaybeAsyncFunction<S extends any[], T> = (...args: S) => (T | Promise<T>);
4
+
5
+export default function greenlet<S extends any[], T>(fn: MaybeAsyncFunction<S, T>): AsyncFunction<S, T>;
0 commit comments