Files
NapCatQQ/.pnpm-store/v3/files/47/59c02ceecc7994f877cc9e2b540c5d2ef4c29d3f52e27eb58de1629570298b5061f0f2cca9f3c1b7ec1b110efec44199d6d80fd19a0683ba199df27716d321
TanTan e311ca3275
Build NapCat Artifacts / Windows Loader Test (push) Canceled after 0s
Build NapCat Artifacts / Type Check & Test (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Framework (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Shell (push) Canceled after 0s
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

24 lines
757 B
Plaintext

export type AsyncFunction<Args extends any[] = any[], Result = void> = (...args: Args) => Promise<Result>;
/**
* Check if value is an async function
*
* 校验是否为异步函数
*
* @example
* ```js
* import { isAsyncFunction } from 'is-what-type';
*
* isAsyncFunction(async () => { }); // true
* isAsyncFunction(() => { }); // false
* isAsyncFunction(function() { }); // false
* isAsyncFunction(async function() { }); // true
* isAsyncFunction(123); // false
* isAsyncFunction('string'); // false
* isAsyncFunction({}); // false
* ```
*
* @param value - The value to check
* @returns `true` if `value` is an async function, `false` otherwise
*/
export declare function isAsyncFunction<T = AsyncFunction>(value: unknown): value is T;