import { Ref, WatchSource } from 'vue-demi'; export declare type noop = (...args: any[]) => void; export declare type Service = (...args: P) => Promise; export declare type RequestService = string | { [key: string]: any; }; export declare type CombineService = RequestService | ((...args: P) => RequestService) | Service; export interface UseRequestResult { loading: Ref; data: Ref; error: Ref; params: Ref

; lastSuccessParams: Ref

; cancel: () => void; refresh: () => Promise; run: (...args: P) => Promise; } export interface BaseUseRequestOptions { manual: boolean; onSuccess: (data: R, params: P) => void; onError: (e: Error, params: P) => void; onFinally: () => void; defaultLoading: boolean; loadingDelay: number; defaultParams: P; pollingInterval: number; pollingWhenHidden: boolean; pollingSinceLastFinished: boolean; debounceInterval: number; loadingWhenDebounceStart: boolean; throttleInterval: number; requestMethod: (service: any) => Promise; ready: Ref; throwOnError: boolean; refreshDeps: Array; refreshOnWindowFocus: boolean; } export interface UseRequestOptionsWithFormatResult extends Partial> { formatResult: (res: SR) => R; } export interface UseRequestOptionsWithInitialData extends Partial> { initialData: R; } export declare type UseRequestOptions = BaseUseRequestOptions & UseRequestOptionsWithFormatResult & UseRequestOptionsWithInitialData;