1 | import type { DocumentNode, OperationVariables, TypedDocumentNode } from "../../core/index.js";
|
2 | import type { QueryRef } from "../internal/index.js";
|
3 | import type { LoadableQueryHookOptions } from "../types/types.js";
|
4 | import type { FetchMoreFunction, RefetchFunction, SubscribeToMoreFunction } from "./useSuspenseQuery.js";
|
5 | import type { DeepPartial, OnlyRequiredProperties } from "../../utilities/index.js";
|
6 | export type LoadQueryFunction<TVariables extends OperationVariables> = (...args: [TVariables] extends [never] ? [] : {} extends OnlyRequiredProperties<TVariables> ? [variables?: TVariables] : [variables: TVariables]) => void;
|
7 | type ResetFunction = () => void;
|
8 | export type UseLoadableQueryResult<TData = unknown, TVariables extends OperationVariables = OperationVariables> = [
|
9 | loadQuery: LoadQueryFunction<TVariables>,
|
10 | queryRef: QueryRef<TData, TVariables> | null,
|
11 | handlers: {
|
12 | |
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 | fetchMore: FetchMoreFunction<TData, TVariables>;
|
21 | |
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 | refetch: RefetchFunction<TData, TVariables>;
|
33 | |
34 |
|
35 |
|
36 |
|
37 |
|
38 | subscribeToMore: SubscribeToMoreFunction<TData, TVariables>;
|
39 | |
40 |
|
41 |
|
42 | reset: ResetFunction;
|
43 | }
|
44 | ];
|
45 | export declare function useLoadableQuery<TData, TVariables extends OperationVariables, TOptions extends LoadableQueryHookOptions>(query: DocumentNode | TypedDocumentNode<TData, TVariables>, options?: LoadableQueryHookOptions & TOptions): UseLoadableQueryResult<TOptions["errorPolicy"] extends "ignore" | "all" ? TOptions["returnPartialData"] extends true ? DeepPartial<TData> | undefined : TData | undefined : TOptions["returnPartialData"] extends true ? DeepPartial<TData> : TData, TVariables>;
|
46 | export declare function useLoadableQuery<TData = unknown, TVariables extends OperationVariables = OperationVariables>(query: DocumentNode | TypedDocumentNode<TData, TVariables>, options: LoadableQueryHookOptions & {
|
47 | returnPartialData: true;
|
48 | errorPolicy: "ignore" | "all";
|
49 | }): UseLoadableQueryResult<DeepPartial<TData> | undefined, TVariables>;
|
50 | export declare function useLoadableQuery<TData = unknown, TVariables extends OperationVariables = OperationVariables>(query: DocumentNode | TypedDocumentNode<TData, TVariables>, options: LoadableQueryHookOptions & {
|
51 | errorPolicy: "ignore" | "all";
|
52 | }): UseLoadableQueryResult<TData | undefined, TVariables>;
|
53 | export declare function useLoadableQuery<TData = unknown, TVariables extends OperationVariables = OperationVariables>(query: DocumentNode | TypedDocumentNode<TData, TVariables>, options: LoadableQueryHookOptions & {
|
54 | returnPartialData: true;
|
55 | }): UseLoadableQueryResult<DeepPartial<TData>, TVariables>;
|
56 |
|
57 |
|
58 |
|
59 |
|
60 |
|
61 |
|
62 |
|
63 |
|
64 |
|
65 |
|
66 |
|
67 |
|
68 |
|
69 |
|
70 |
|
71 |
|
72 |
|
73 |
|
74 |
|
75 |
|
76 |
|
77 |
|
78 |
|
79 |
|
80 |
|
81 |
|
82 |
|
83 |
|
84 |
|
85 |
|
86 |
|
87 |
|
88 |
|
89 |
|
90 |
|
91 |
|
92 |
|
93 |
|
94 |
|
95 |
|
96 |
|
97 |
|
98 |
|
99 |
|
100 |
|
101 | export declare function useLoadableQuery<TData = unknown, TVariables extends OperationVariables = OperationVariables>(query: DocumentNode | TypedDocumentNode<TData, TVariables>, options?: LoadableQueryHookOptions): UseLoadableQueryResult<TData, TVariables>;
|
102 | export {};
|
103 |
|
\ | No newline at end of file |