1 | import type { DocumentNode, OperationVariables, TypedDocumentNode } from "../../core/index.js";
|
2 | import type { QueryRef } from "../internal/index.js";
|
3 | import type { BackgroundQueryHookOptions, NoInfer } from "../types/types.js";
|
4 | import type { FetchMoreFunction, RefetchFunction, SubscribeToMoreFunction } from "./useSuspenseQuery.js";
|
5 | import type { DeepPartial } from "../../utilities/index.js";
|
6 | import type { SkipToken } from "./constants.js";
|
7 | export type UseBackgroundQueryResult<TData = unknown, TVariables extends OperationVariables = OperationVariables> = {
|
8 | |
9 |
|
10 |
|
11 |
|
12 |
|
13 | subscribeToMore: SubscribeToMoreFunction<TData, TVariables>;
|
14 | |
15 |
|
16 |
|
17 | fetchMore: FetchMoreFunction<TData, TVariables>;
|
18 | |
19 |
|
20 |
|
21 |
|
22 |
|
23 | refetch: RefetchFunction<TData, TVariables>;
|
24 | };
|
25 | type BackgroundQueryHookOptionsNoInfer<TData, TVariables extends OperationVariables> = BackgroundQueryHookOptions<NoInfer<TData>, NoInfer<TVariables>>;
|
26 | export declare function useBackgroundQuery<TData, TVariables extends OperationVariables, TOptions extends Omit<BackgroundQueryHookOptions<TData>, "variables">>(query: DocumentNode | TypedDocumentNode<TData, TVariables>, options?: BackgroundQueryHookOptionsNoInfer<TData, TVariables> & TOptions): [
|
27 | (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)),
|
28 | UseBackgroundQueryResult<TData, TVariables>
|
29 | ];
|
30 | export declare function useBackgroundQuery<TData = unknown, TVariables extends OperationVariables = OperationVariables>(query: DocumentNode | TypedDocumentNode<TData, TVariables>, options: BackgroundQueryHookOptionsNoInfer<TData, TVariables> & {
|
31 | returnPartialData: true;
|
32 | errorPolicy: "ignore" | "all";
|
33 | }): [
|
34 | QueryRef<DeepPartial<TData> | undefined, TVariables>,
|
35 | UseBackgroundQueryResult<TData, TVariables>
|
36 | ];
|
37 | export declare function useBackgroundQuery<TData = unknown, TVariables extends OperationVariables = OperationVariables>(query: DocumentNode | TypedDocumentNode<TData, TVariables>, options: BackgroundQueryHookOptionsNoInfer<TData, TVariables> & {
|
38 | errorPolicy: "ignore" | "all";
|
39 | }): [
|
40 | QueryRef<TData | undefined, TVariables>,
|
41 | UseBackgroundQueryResult<TData, TVariables>
|
42 | ];
|
43 | export declare function useBackgroundQuery<TData = unknown, TVariables extends OperationVariables = OperationVariables>(query: DocumentNode | TypedDocumentNode<TData, TVariables>, options: BackgroundQueryHookOptionsNoInfer<TData, TVariables> & {
|
44 | skip: boolean;
|
45 | returnPartialData: true;
|
46 | }): [
|
47 | QueryRef<DeepPartial<TData>, TVariables> | undefined,
|
48 | UseBackgroundQueryResult<TData, TVariables>
|
49 | ];
|
50 | export declare function useBackgroundQuery<TData = unknown, TVariables extends OperationVariables = OperationVariables>(query: DocumentNode | TypedDocumentNode<TData, TVariables>, options: BackgroundQueryHookOptionsNoInfer<TData, TVariables> & {
|
51 | returnPartialData: true;
|
52 | }): [
|
53 | QueryRef<DeepPartial<TData>, TVariables>,
|
54 | UseBackgroundQueryResult<TData, TVariables>
|
55 | ];
|
56 | export declare function useBackgroundQuery<TData = unknown, TVariables extends OperationVariables = OperationVariables>(query: DocumentNode | TypedDocumentNode<TData, TVariables>, options: BackgroundQueryHookOptionsNoInfer<TData, TVariables> & {
|
57 | skip: boolean;
|
58 | }): [
|
59 | QueryRef<TData, TVariables> | undefined,
|
60 | UseBackgroundQueryResult<TData, TVariables>
|
61 | ];
|
62 | export declare function useBackgroundQuery<TData = unknown, TVariables extends OperationVariables = OperationVariables>(query: DocumentNode | TypedDocumentNode<TData, TVariables>, options?: BackgroundQueryHookOptionsNoInfer<TData, TVariables>): [QueryRef<TData, TVariables>, UseBackgroundQueryResult<TData, TVariables>];
|
63 | export declare function useBackgroundQuery<TData = unknown, TVariables extends OperationVariables = OperationVariables>(query: DocumentNode | TypedDocumentNode<TData, TVariables>, options: SkipToken): [undefined, UseBackgroundQueryResult<TData, TVariables>];
|
64 | export declare function useBackgroundQuery<TData = unknown, TVariables extends OperationVariables = OperationVariables>(query: DocumentNode | TypedDocumentNode<TData, TVariables>, options: SkipToken | (BackgroundQueryHookOptionsNoInfer<TData, TVariables> & {
|
65 | returnPartialData: true;
|
66 | })): [
|
67 | QueryRef<DeepPartial<TData>, TVariables> | undefined,
|
68 | UseBackgroundQueryResult<TData, TVariables>
|
69 | ];
|
70 | export declare function useBackgroundQuery<TData = unknown, TVariables extends OperationVariables = OperationVariables>(query: DocumentNode | TypedDocumentNode<TData, TVariables>, options?: SkipToken | BackgroundQueryHookOptionsNoInfer<TData, TVariables>): [
|
71 | QueryRef<TData, TVariables> | undefined,
|
72 | UseBackgroundQueryResult<TData, TVariables>
|
73 | ];
|
74 | export {};
|
75 |
|
\ | No newline at end of file |