import { UseAsyncMeta, UseAsyncActions, AsyncState } from '../useAsync/useAsync'; export interface UseAsyncAbortableActions extends UseAsyncActions { /** * Abort currently running async. */ abort: () => void; /** * Abort currently running async and reset state to initial, when async function haven't been executed. */ reset: () => void; } export interface UseAsyncAbortableMeta extends UseAsyncMeta { /** * Current abort controller. New one created each async execution. */ abortController: AbortController | undefined; } export declare type ArgsWithAbortSignal = [AbortSignal, ...Args]; export declare function useAsyncAbortable(asyncFn: (...params: ArgsWithAbortSignal) => Promise, initialValue: Result): [ AsyncState, UseAsyncAbortableActions, UseAsyncAbortableMeta ]; export declare function useAsyncAbortable(asyncFn: (...params: ArgsWithAbortSignal) => Promise, initialValue?: Result): [ AsyncState, UseAsyncAbortableActions, UseAsyncAbortableMeta ];