import { GQlessClient, prepass } from 'gqless'; import { OnErrorHandler } from '../common'; import { ReactClientOptionsWithDefaults } from '../utils'; export interface UseQueryPrepareHelpers { readonly prepass: typeof prepass; readonly query: GeneratedSchema['query']; } export interface UseQueryOptions { suspense?: boolean; staleWhileRevalidate?: boolean | object | number | string | null; onError?: OnErrorHandler; prepare?: (helpers: UseQueryPrepareHelpers) => void; } export interface UseQueryState { /** * Useful for `Non-Suspense` usage. */ readonly isLoading: boolean; } export declare type UseQueryReturnValue = GeneratedSchema['query'] & { $state: UseQueryState; }; export interface UseQuery { (options?: UseQueryOptions): UseQueryReturnValue; } export declare function createUseQuery(client: GQlessClient, opts: ReactClientOptionsWithDefaults): UseQuery;