export type AsyncStatus = 'loading' | 'success' | 'error' | 'not-executed';
export type AsyncState<Result> = {
    status: 'not-executed';
    error: undefined;
    result: Result;
} | {
    status: 'success';
    error: undefined;
    result: Result;
} | {
    status: 'error';
    error: Error;
    result: Result;
} | {
    status: AsyncStatus;
    error: Error | undefined;
    result: Result;
};
export type UseAsyncActions<Result, Args extends unknown[] = unknown[]> = {
    reset: () => void;
    execute: (...args: Args) => Promise<Result>;
};
export type UseAsyncMeta<Result, Args extends unknown[] = unknown[]> = {
    promise: Promise<Result> | undefined;
    lastArgs: Args | undefined;
};
export declare function useAsync<Result, Args extends unknown[] = unknown[]>(asyncFn: (...params: Args) => Promise<Result>, initialValue: Result): [AsyncState<Result>, UseAsyncActions<Result, Args>, UseAsyncMeta<Result, Args>];
export declare function useAsync<Result, Args extends unknown[] = unknown[]>(asyncFn: (...params: Args) => Promise<Result>, initialValue?: Result): [AsyncState<Result | undefined>, UseAsyncActions<Result, Args>, UseAsyncMeta<Result, Args>];
