generated from templates/typescript-types
add types for async functions
This commit is contained in:
parent
eb65701595
commit
64a6cac8f5
4
src/functions.d.ts
vendored
4
src/functions.d.ts
vendored
@ -1,6 +1,10 @@
|
||||
|
||||
export type Func<T extends any = any> = (...args: any[]) => T;
|
||||
|
||||
export type AsyncFunc<T extends any = any> = (...args: any[]) => PromiseLike<T>;
|
||||
|
||||
export type AsyncResult<T extends AsyncFunc> = Awaited<ReturnType<T>>;
|
||||
|
||||
export type Params<T extends Func> = T extends (...args: infer P) => any ? P : never;
|
||||
|
||||
export type FirstParam<T extends Func> = T extends (first: infer F, ...args: any[]) => any ? F : never;
|
||||
|
Loading…
x
Reference in New Issue
Block a user