1 | import { AnyVariables, Client, OperationContext, OperationResult, RequestPolicy, TypedDocumentNode } from '@urql/core';
|
2 | import { Getter, WritableAtom } from 'jotai';
|
3 | type DeprecatedAtomWithQueryAction = {
|
4 | type: 'reexecute';
|
5 | opts?: Partial<OperationContext>;
|
6 | } | {
|
7 | type: 'refetch';
|
8 | opts?: Partial<OperationContext>;
|
9 | };
|
10 | type AtomWithQueryAction = {
|
11 | type: 'refetch';
|
12 | } | DeprecatedAtomWithQueryAction;
|
13 | type OperationResultWithData<Data, Variables extends AnyVariables> = Pick<OperationResult<Data, Variables>, Exclude<keyof OperationResult<Data, Variables>, 'data'>> & {
|
14 | data: Data;
|
15 | };
|
16 | type QueryArgs<Data, Variables extends AnyVariables> = {
|
17 | query: TypedDocumentNode<Data, Variables> | string;
|
18 | variables: Variables;
|
19 | requestPolicy?: RequestPolicy;
|
20 | context?: Partial<OperationContext>;
|
21 | };
|
22 | type QueryArgsWithPause<Data, Variables extends AnyVariables> = QueryArgs<Data, Variables> & {
|
23 | pause: boolean;
|
24 | };
|
25 |
|
26 |
|
27 |
|
28 | export declare function atomWithQuery<Data, Variables extends AnyVariables>(createQueryArgs: (get: Getter) => QueryArgs<Data, Variables>, getClient?: (get: Getter) => Client): WritableAtom<OperationResultWithData<Data, Variables>, AtomWithQueryAction>;
|
29 |
|
30 |
|
31 |
|
32 | export declare function atomWithQuery<Data, Variables extends AnyVariables>(createQueryArgs: (get: Getter) => QueryArgsWithPause<Data, Variables>, getClient?: (get: Getter) => Client): WritableAtom<OperationResultWithData<Data, Variables> | null, AtomWithQueryAction>;
|
33 | export {};
|
34 | declare type Awaited<T> = T extends Promise<infer V> ? V : T; |
\ | No newline at end of file |