import type { ApolloClient, DefaultContext, DocumentNode, ErrorPolicy, OperationVariables, RefetchWritePolicy, TypedDocumentNode, WatchQueryFetchPolicy } from "@apollo/client";
import type { SubscribeToMoreFunction } from "@apollo/client";
import type { FetchMoreFunction, QueryRef, RefetchFunction } from "@apollo/client/react/internal";
import type { DeepPartial, NoInfer } from "@apollo/client/utilities";
import type { SkipToken } from "./constants.js";
export declare namespace useBackgroundQuery {
    type FetchPolicy = Extract<WatchQueryFetchPolicy, "cache-first" | "network-only" | "no-cache" | "cache-and-network">;
    interface Options<TVariables extends OperationVariables = OperationVariables> {
        /**
        * The instance of `ApolloClient` to use to execute the query.
        * 
        * By default, the instance that's passed down via context is used, but you can provide a different instance here.
        * 
        * @docGroup
        * 
        * 1. Operation options
        */
        client?: ApolloClient;
        /**
        * Specifies whether a `NetworkStatus.refetch` operation should merge incoming field data with existing data, or overwrite the existing data. Overwriting is probably preferable, but merging is currently the default behavior, for backwards compatibility with Apollo Client 3.x.
        * 
        * @docGroup
        * 
        * 3. Caching options
        */
        refetchWritePolicy?: RefetchWritePolicy;
        /**
        * An object containing all of the GraphQL variables your query requires to execute.
        * 
        * Each key in the object corresponds to a variable name, and that key's value corresponds to the variable value.
        * 
        * @docGroup
        * 
        * 1. Operation options
        */
        variables?: TVariables;
        /**
        * Specifies how the query handles a response that returns both GraphQL errors and partial results.
        * 
        * For details, see [GraphQL error policies](https://www.apollographql.com/docs/react/data/error-handling/#graphql-error-policies).
        * 
        * The default value is `none`, meaning that the query result includes error details but not partial results.
        * 
        * @docGroup
        * 
        * 1. Operation options
        */
        errorPolicy?: ErrorPolicy;
        /**
        * If you're using [Apollo Link](https://www.apollographql.com/docs/react/api/link/introduction/), this object is the initial value of the `context` object that's passed along your link chain.
        * 
        * @docGroup
        * 
        * 2. Networking options
        */
        context?: DefaultContext;
        /**
        * If `true`, the query can return partial results from the cache if the cache doesn't contain results for all queried fields.
        * 
        * The default value is `false`.
        * 
        * @docGroup
        * 
        * 3. Caching options
        */
        returnPartialData?: boolean;
        /**
        * Specifies how the query interacts with the Apollo Client cache during execution (for example, whether it checks the cache for results before sending a request to the server).
        * 
        * For details, see [Setting a fetch policy](https://www.apollographql.com/docs/react/data/queries/#setting-a-fetch-policy).
        * 
        * The default value is `cache-first`.
        * 
        * @docGroup
        * 
        * 3. Caching options
        */
        fetchPolicy?: FetchPolicy;
        /**
        * A unique identifier for the query. Each item in the array must be a stable identifier to prevent infinite fetches.
        * 
        * This is useful when using the same query and variables combination in more than one component, otherwise the components may clobber each other. This can also be used to force the query to re-evaluate fresh.
        * 
        * @docGroup
        * 
        * 1. Operation options
        */
        queryKey?: string | number | any[];
        /**
        * If `true`, the query is not executed. The default value is `false`.
        * 
        * @deprecated
        * 
        * We recommend using `skipToken` in place of the `skip` option as it is more type-safe.
        * 
        * This option is deprecated and only supported to ease the migration from useQuery. It will be removed in a future release.
        * 
        * @docGroup
        * 
        * 1. Operation options
        * 
        *
        * @example Recommended usage of `skipToken`:
        * ```ts
        * import { skipToken, useBackgroundQuery } from '@apollo/client';
        *
        * const [queryRef] = useBackgroundQuery(query, id ? { variables: { id } } : skipToken);
        * ```
        */
        skip?: boolean;
    }
    type Result<TData = unknown, TVariables extends OperationVariables = OperationVariables> = {
        /**
        * A function that enables you to execute a [subscription](https://www.apollographql.com/docs/react/data/subscriptions/), usually to subscribe to specific fields that were included in the query.
        * 
        * This function returns _another_ function that you can call to terminate the subscription.
        */
        subscribeToMore: SubscribeToMoreFunction<TData, TVariables>;
        /**
        * A function that helps you fetch the next set of results for a [paginated list field](https://www.apollographql.com/docs/react/pagination/core-api/).
        */
        fetchMore: FetchMoreFunction<TData, TVariables>;
        /**
        * Update the variables of this observable query, and fetch the new results. This method should be preferred over `setVariables` in most use cases.
        * 
        * @param variables - The new set of variables. If there are missing variables, the previous values of those variables will be used.
        */
        refetch: RefetchFunction<TData, TVariables>;
    };
}
export declare function useBackgroundQuery<TData, TVariables extends OperationVariables, TOptions extends Omit<useBackgroundQuery.Options, "variables">>(query: DocumentNode | TypedDocumentNode<TData, TVariables>, options?: useBackgroundQuery.Options<NoInfer<TVariables>> & TOptions): [
    (QueryRef<TOptions["errorPolicy"] extends "ignore" | "all" ? TOptions["returnPartialData"] extends true ? DeepPartial<TData> | undefined : TData | undefined : TOptions["returnPartialData"] extends true ? DeepPartial<TData> : TData, TVariables> | (TOptions["skip"] extends boolean ? undefined : never)),
    useBackgroundQuery.Result<TData, TVariables>
];
export declare function useBackgroundQuery<TData = unknown, TVariables extends OperationVariables = OperationVariables>(query: DocumentNode | TypedDocumentNode<TData, TVariables>, options: useBackgroundQuery.Options<NoInfer<TVariables>> & {
    returnPartialData: true;
    errorPolicy: "ignore" | "all";
}): [
    QueryRef<DeepPartial<TData> | undefined, TVariables>,
    useBackgroundQuery.Result<TData, TVariables>
];
export declare function useBackgroundQuery<TData = unknown, TVariables extends OperationVariables = OperationVariables>(query: DocumentNode | TypedDocumentNode<TData, TVariables>, options: useBackgroundQuery.Options<NoInfer<TVariables>> & {
    errorPolicy: "ignore" | "all";
}): [
    QueryRef<TData | undefined, TVariables>,
    useBackgroundQuery.Result<TData, TVariables>
];
export declare function useBackgroundQuery<TData = unknown, TVariables extends OperationVariables = OperationVariables>(query: DocumentNode | TypedDocumentNode<TData, TVariables>, options: useBackgroundQuery.Options<NoInfer<TVariables>> & {
    skip: boolean;
    returnPartialData: true;
}): [
    QueryRef<DeepPartial<TData>, TVariables> | undefined,
    useBackgroundQuery.Result<TData, TVariables>
];
export declare function useBackgroundQuery<TData = unknown, TVariables extends OperationVariables = OperationVariables>(query: DocumentNode | TypedDocumentNode<TData, TVariables>, options: useBackgroundQuery.Options<NoInfer<TVariables>> & {
    returnPartialData: true;
}): [
    QueryRef<DeepPartial<TData>, TVariables>,
    useBackgroundQuery.Result<TData, TVariables>
];
export declare function useBackgroundQuery<TData = unknown, TVariables extends OperationVariables = OperationVariables>(query: DocumentNode | TypedDocumentNode<TData, TVariables>, options: useBackgroundQuery.Options<NoInfer<TVariables>> & {
    skip: boolean;
}): [
    QueryRef<TData, TVariables> | undefined,
    useBackgroundQuery.Result<TData, TVariables>
];
export declare function useBackgroundQuery<TData = unknown, TVariables extends OperationVariables = OperationVariables>(query: DocumentNode | TypedDocumentNode<TData, TVariables>, options?: useBackgroundQuery.Options<NoInfer<TVariables>>): [QueryRef<TData, TVariables>, useBackgroundQuery.Result<TData, TVariables>];
export declare function useBackgroundQuery<TData = unknown, TVariables extends OperationVariables = OperationVariables>(query: DocumentNode | TypedDocumentNode<TData, TVariables>, options: SkipToken): [undefined, useBackgroundQuery.Result<TData, TVariables>];
export declare function useBackgroundQuery<TData = unknown, TVariables extends OperationVariables = OperationVariables>(query: DocumentNode | TypedDocumentNode<TData, TVariables>, options: SkipToken | (useBackgroundQuery.Options<NoInfer<TVariables>> & {
    returnPartialData: true;
})): [
    QueryRef<DeepPartial<TData>, TVariables> | undefined,
    useBackgroundQuery.Result<TData, TVariables>
];
export declare function useBackgroundQuery<TData = unknown, TVariables extends OperationVariables = OperationVariables>(query: DocumentNode | TypedDocumentNode<TData, TVariables>, options?: SkipToken | useBackgroundQuery.Options<NoInfer<TVariables>>): [
    QueryRef<TData, TVariables> | undefined,
    useBackgroundQuery.Result<TData, TVariables>
];
//# sourceMappingURL=useBackgroundQuery.d.ts.map
