import type { AbortSignalWithReason, TaskResult } from './types'; /** * Synchronously raises {@link TaskAbortError} if the task tied to the input `signal` has been cancelled. * @param signal * @param reason * @see {TaskAbortError} */ export declare const validateActive: (signal: AbortSignal) => void; /** * Returns a promise that will reject {@link TaskAbortError} if the task is cancelled. * @param signal * @returns */ export declare const promisifyAbortSignal: (signal: AbortSignalWithReason) => Promise; /** * Runs a task and returns promise that resolves to {@link TaskResult}. * * Second argument is an optional `cleanUp` function that always runs after task. * @returns */ export declare const runTask: (task: () => Promise, cleanUp?: (() => void) | undefined) => Promise>; /** * Given an input `AbortSignal` and a promise returns another promise that resolves * as soon the input promise is provided or rejects as soon as * `AbortSignal.abort` is `true`. * @param signal * @returns */ export declare const createPause: (signal: AbortSignal) => (promise: Promise) => Promise; /** * Given an input `AbortSignal` and `timeoutMs` returns a promise that resolves * after `timeoutMs` or rejects as soon as `AbortSignal.abort` is `true`. * @param signal * @returns */ export declare const createDelay: (signal: AbortSignal) => (timeoutMs: number) => Promise;