import type { DocumentNode, OperationVariables, TypedDocumentNode } from "../../core/index.js"; import type { QueryRef } from "../internal/index.js"; import type { BackgroundQueryHookOptions, NoInfer } from "../types/types.js"; import type { FetchMoreFunction, RefetchFunction, SubscribeToMoreFunction } from "./useSuspenseQuery.js"; import type { DeepPartial } from "../../utilities/index.js"; import type { SkipToken } from "./constants.js"; export type UseBackgroundQueryResult = { /** * 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; /** * 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; /** * 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; }; type BackgroundQueryHookOptionsNoInfer = BackgroundQueryHookOptions, NoInfer>; export declare function useBackgroundQuery, "variables">>(query: DocumentNode | TypedDocumentNode, options?: BackgroundQueryHookOptionsNoInfer & TOptions): [ (QueryRef | undefined : TData | undefined : TOptions["returnPartialData"] extends true ? DeepPartial : TData, TVariables> | (TOptions["skip"] extends boolean ? undefined : never)), UseBackgroundQueryResult ]; export declare function useBackgroundQuery(query: DocumentNode | TypedDocumentNode, options: BackgroundQueryHookOptionsNoInfer & { returnPartialData: true; errorPolicy: "ignore" | "all"; }): [ QueryRef | undefined, TVariables>, UseBackgroundQueryResult ]; export declare function useBackgroundQuery(query: DocumentNode | TypedDocumentNode, options: BackgroundQueryHookOptionsNoInfer & { errorPolicy: "ignore" | "all"; }): [ QueryRef, UseBackgroundQueryResult ]; export declare function useBackgroundQuery(query: DocumentNode | TypedDocumentNode, options: BackgroundQueryHookOptionsNoInfer & { skip: boolean; returnPartialData: true; }): [ QueryRef, TVariables> | undefined, UseBackgroundQueryResult ]; export declare function useBackgroundQuery(query: DocumentNode | TypedDocumentNode, options: BackgroundQueryHookOptionsNoInfer & { returnPartialData: true; }): [ QueryRef, TVariables>, UseBackgroundQueryResult ]; export declare function useBackgroundQuery(query: DocumentNode | TypedDocumentNode, options: BackgroundQueryHookOptionsNoInfer & { skip: boolean; }): [ QueryRef | undefined, UseBackgroundQueryResult ]; export declare function useBackgroundQuery(query: DocumentNode | TypedDocumentNode, options?: BackgroundQueryHookOptionsNoInfer): [QueryRef, UseBackgroundQueryResult]; export declare function useBackgroundQuery(query: DocumentNode | TypedDocumentNode, options: SkipToken): [undefined, UseBackgroundQueryResult]; export declare function useBackgroundQuery(query: DocumentNode | TypedDocumentNode, options: SkipToken | (BackgroundQueryHookOptionsNoInfer & { returnPartialData: true; })): [ QueryRef, TVariables> | undefined, UseBackgroundQueryResult ]; export declare function useBackgroundQuery(query: DocumentNode | TypedDocumentNode, options?: SkipToken | BackgroundQueryHookOptionsNoInfer): [ QueryRef | undefined, UseBackgroundQueryResult ]; export {}; //# sourceMappingURL=useBackgroundQuery.d.ts.map