import * as React from 'react'; import ErrorResult from 'bicycle/types/ErrorResult'; import { BaseRootQuery } from 'bicycle/typed-helpers/query'; import DeepPartial from './helpers/DeepPartial'; import DeepPartialUnion from './helpers/DeepPartialUnion'; import Query from 'bicycle/types/Query'; export interface SuccessResponse { loaded: true; loading: false; errored: false; result: TResult; } export interface ErrorResponse { loaded: false; loading: false; errored: true; result: DeepPartialUnion; errors: ReadonlyArray; errorDetails: ReadonlyArray; render: () => React.ReactElement; } export interface LoadingResponse { loaded: false; loading: true; errored: false; result: DeepPartial; loadingDuration: number; render: () => React.ReactElement; } export declare type Response = SuccessResponse | ErrorResponse | LoadingResponse; /** * Subscribe to the results of a bicycle query * * @param query The query to subscribe to */ export default function useQuery(query: Query | BaseRootQuery): Response;