import type { Fns, Positive, Result } from '@chzky/core'; import { AnyErrorMachine } from '@chzky/core'; /** ## `TimeOutError` : 超时错误 + 用于表示`Promise`超时的错误 @level `Error` @category Error */ export declare class TimeOutError extends AnyErrorMachine<'Error'> { } /** ## `deadline` : 最高期限函数 + 用于在一定时间内完成`Promise`操作,如果超时则返回`Err(TimeOutError)` @example Usage ```ts const seq = assert_sequence() const testime = async () => { await sleep(100) //被抛弃的race抛出异常不会被采纳 seq(1) } await deadline(testime, 50) seq(1) await sleep(50) ``` @example Usage - normal ```ts const seq = assert_sequence() const testime = async () => { await sleep(10) seq(1) } await deadline(testime, 50) assert_throw(() => { seq(1) }, AssertError) seq(2) await sleep(40) ``` @category async */ export declare function deadline(promise: Promise | Fns>, timeout: Positive): Promise>; //# sourceMappingURL=deadline.d.ts.map