export interface Func { /** * Returns the name of the function. Function names are read-only and can not be changed. */ readonly name: string; (...args: any[]): any | Promise; (this: any, ...args: any[]): any | Promise; } /** * ReturnType is any */ export type MethodType, TThis = any> = (this: TThis, ...input: ArgsType) => ReturnType; /** * ReturnType is unknown */ export type MethodTypeUnknown = (this: TThis, ...input: ArgsType) => ReturnType; /** * ReturnType is Promise */ export type AsyncMethodType = (this: TThis, ...input: ArgsType) => Promise; /** * Convert a function type to an async function type */ export type ToAsyncFunction any> = T extends (...args: infer A) => infer R ? (...args: A) => Promise : never;