import type { RPC } from "./rpc";
import type { NestedPrettify } from "../utils/type";
import type { ApiRouterHandler } from "../http/ApiRouter";
import type { UnwrapPromise } from "../utils/type";
import type { UrlParser } from "./types";
interface Config<T> {
    fallbackData?: T;
    keepPreviousData?: boolean;
    retryIntervalOnError?: number;
    refreshInterval?: number;
    debug?: boolean;
    lazy?: boolean;
    refetchUntil?: (data: T, duration: number) => number;
}
type GetRPC = {
    [K in keyof RPC as K extends `GET:${infer P}` ? P : never]: RPC[K];
};
type Data<T extends keyof GetRPC> = GetRPC[T] extends ApiRouterHandler<any, infer Data, any> ? UnwrapPromise<Data> : never;
type Error = Record<string, unknown>;
export type QueryResult<T extends keyof GetRPC> = NestedPrettify<Data<T> & {}>;
export declare function useQuery<T extends keyof GetRPC>(url: T, ...args: [
    options?: {
        search?: Record<string, string | number | boolean | null>;
        params?: Partial<UrlParser<`${T & string}`>>;
    },
    config?: Config<Data<T>>
]): {
    data: NestedPrettify<Data<T>>;
    loading: boolean;
    error: Error;
    mutate: {
        (fn?: Partial<NestedPrettify<Data<T>>>): void;
        (fn?: (data: NestedPrettify<Data<T>>) => Partial<NestedPrettify<Data<T>>>): void;
    };
    trigger: () => void;
    prefetch: () => void;
    version: number;
};
export {};
//# sourceMappingURL=useQuery.d.ts.map