import { Ref } from "vue";
import { OptionsType, Service, StateType } from "./type";
export declare function useAsync<TData = unknown, TParams extends unknown[] = any>(service: Service<TData, TParams>, options?: OptionsType<TData, TParams>): {
    data: import("@vue/shared").IfAny<TData, Ref<TData>, [TData] extends [Ref<any>] ? TData : Ref<TData>>;
    loading: Ref<boolean>;
    error: Ref<Error | null>;
    fetches: {
        [x: string]: {
            data: unknown;
            loading: boolean;
            error: {
                name: string;
                message: string;
                stack?: string | undefined;
            } | null;
            params: unknown;
        };
    };
    lastSuccessParams: Ref<TParams>;
    run: (...args: TParams) => Promise<void>;
    mutate: (newData: StateType<TData>["data"]) => void;
    refresh: () => Promise<void>;
    cancel: () => void;
    setCache: (key: string | number, cacheTime: number, data: unknown, params: unknown, staleTime?: number, loading?: boolean) => void;
    getCache: (key: string | number) => {
        loading: boolean;
        data?: unknown;
        params?: unknown;
        timer?: NodeJS.Timeout | undefined;
        time?: number | undefined;
        staleTime?: number | undefined;
    } | undefined;
    clearCache: (key?: string | string[] | undefined) => void;
};
