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