type AsyncFn<T, P = undefined> = P extends undefined ? () => Promise<T> : (props: P) => Promise<T>;
type UseAsyncReturn<T> = {
    data: T | undefined;
    isLoading: boolean;
    error: Error | undefined;
    refetch: () => void;
};
export type ApiOptions<T> = {
    enabled?: boolean;
    staleTimeout?: number;
    onSuccess?(data: T): void;
    onError?(error: unknown): void;
};
type Props<T, P> = ApiOptions<T> & {
    queryFn: AsyncFn<T, P>;
    queryProps?: P;
};
export declare function useAPI<T, P extends Record<PropertyKey, unknown> | undefined>({ queryFn, queryProps, enabled, staleTimeout, onSuccess, onError, }: Props<T, P>): UseAsyncReturn<T>;
export {};
//# sourceMappingURL=useAPI.d.ts.map