import type { Either, Fns, Option, Result, State } from '../../mod.js'; /** ## is_async_func : 运行时判断函是否是 async函数 @tips 只能判断 1. 一个函数是否带`async`关键字,不能判断函数是否返回Promise(函数返回只能在运行时判断) @example ```ts const sync = (x: number) => x + 1 const asyncfn = async (x: number) => new Promise(res => { setTimeout(() => { res(x + 1) }, 1000) }) assertEquals(is_async_func(asyncfn), true) assertEquals(is_async_func(sync), false) ``` @category Function */ export declare const is_async_func: (fn: Fns) => fn is () => Promise; /** ## is_number : 运行时判断数据是否是数字 + 包含两种情况判断为数字 : 1. 数字 : 1,2,3,4,5... <包括Infinity,-Infinity;不包括NaN> 2. 能转为数字的字符串: '1.1','2','114514'... @category Function */ export declare const is_number: (val: unknown) => boolean; /** ## is_result : 运行时判断是否Result类型 @example ```ts const res = result(() => { if (Math.random() > 0.5) { return 1 } else { throw new Error('test error') } }) console.log(is_result(res)) // true ``` @category Function */ export declare function is_result(val: unknown): val is Result; /** ## `is_option` : 运行时判断是否Option类型 @category Function */ export declare function is_option(val: unknown): val is Option; /** ## `is_either` : 运行时判断是否Either类型 */ export declare function is_either(val: unknown): val is Either; /** ## `is_state` : 运行时判断是否State类型 */ export declare function is_state(val: unknown): val is State; //# sourceMappingURL=is.d.ts.map