import type { AsyncResult } from '../../../mod.js'; import type { ResultConstructor } from './interface.js'; declare function _async_result(fn: () => Promise): AsyncResult; /** ## `result` : 从函数中生成`Result`类型数据 + 将一个可能throw的普通语句/代码/函数 转化为Result<(return value),(throw value)>类型 */ export declare const result: ResultConstructor; /** ## async_result : {@link result}的异步版本 @deprecated 使用`result()`or`result.async()`替代 @description 将一个可能throw的普通`异步` 语句/代码/函数 转化为Result<(return value),(throw value)>类型 @example ```ts const res = result(() => { if (Math.random() > 0.5) { return 1 } else { throw new Error('test error') } }) res.match_ok(val => { console.log(val) // 1 }) ``` @category TypeClass */ export declare const async_result: typeof _async_result; export {}; //# sourceMappingURL=helper.d.ts.map