A lightweight JSON RPC client & server
Home > async-call-rpc > AsyncVersionOf
Make all functions in T becomes an async function and filter non-Functions out.
Signature:
export type AsyncVersionOf<T> = T extends Record<keyof T, (...args: any) => PromiseLike<any>> ? 'then' extends keyof T ? Omit<Readonly<T>, 'then'> : T : _AsyncVersionOf<T>;
Only generics signatures on function that returning an Promise
Method called then
are intentionally removed because it is very likely to be a foot gun in promise auto-unwrap.