export declare const enum ResultState {
    loading = "loading",
    error = "error",
    success = "success"
}
type ResultBase = {
    state: ResultState;
};
type LoadingResult = ResultBase & {
    state: ResultState.loading;
};
type ErrorResult = ResultBase & {
    state: ResultState.error;
    error: any;
};
type SuccessResult<T> = ResultBase & {
    state: ResultState.success;
    data: T;
};
export type PromiseResult<Success = any> = LoadingResult | ErrorResult | SuccessResult<Success>;
export declare function usePromise<T>(promiseTask?: () => Promise<T>): {
    result: import("vue").Ref<{
        state: ResultState.loading;
    } | {
        state: ResultState.error;
        error: any;
    } | {
        state: ResultState.success;
        data: import("vue").UnwrapRef<T>;
    }, PromiseResult<T> | {
        state: ResultState.loading;
    } | {
        state: ResultState.error;
        error: any;
    } | {
        state: ResultState.success;
        data: import("vue").UnwrapRef<T>;
    }>;
    execute: (task?: () => Promise<T>) => Promise<void>;
};
export {};
