1 | import { DataProxy } from './DataProxy';
|
2 | import { Modifier, Modifiers } from './common';
|
3 | import { ApolloCache } from '../cache';
|
4 | export declare namespace Cache {
|
5 | type WatchCallback<TData = any> = (diff: Cache.DiffResult<TData>, lastDiff?: Cache.DiffResult<TData>) => void;
|
6 | interface ReadOptions<TVariables = any, TData = any> extends DataProxy.Query<TVariables, TData> {
|
7 | rootId?: string;
|
8 | previousResult?: any;
|
9 | optimistic: boolean;
|
10 | returnPartialData?: boolean;
|
11 | canonizeResults?: boolean;
|
12 | }
|
13 | interface WriteOptions<TResult = any, TVariables = any> extends Omit<DataProxy.Query<TVariables, TResult>, "id">, Omit<DataProxy.WriteOptions<TResult>, "data"> {
|
14 | dataId?: string;
|
15 | result: TResult;
|
16 | }
|
17 | interface DiffOptions<TData = any, TVariables = any> extends Omit<ReadOptions<TVariables, TData>, "rootId"> {
|
18 | }
|
19 | interface WatchOptions<TData = any, TVariables = any> extends DiffOptions<TData, TVariables> {
|
20 | watcher?: object;
|
21 | immediate?: boolean;
|
22 | callback: WatchCallback<TData>;
|
23 | lastDiff?: DiffResult<TData>;
|
24 | }
|
25 | interface EvictOptions {
|
26 | id?: string;
|
27 | fieldName?: string;
|
28 | args?: Record<string, any>;
|
29 | broadcast?: boolean;
|
30 | }
|
31 | interface ResetOptions {
|
32 | discardWatches?: boolean;
|
33 | }
|
34 | interface ModifyOptions {
|
35 | id?: string;
|
36 | fields: Modifiers | Modifier<any>;
|
37 | optimistic?: boolean;
|
38 | broadcast?: boolean;
|
39 | }
|
40 | interface BatchOptions<TCache extends ApolloCache<any>, TUpdateResult = void> {
|
41 | update(cache: TCache): TUpdateResult;
|
42 | optimistic?: string | boolean;
|
43 | removeOptimistic?: string;
|
44 | onWatchUpdated?: (this: TCache, watch: Cache.WatchOptions, diff: Cache.DiffResult<any>, lastDiff: Cache.DiffResult<any> | undefined) => any;
|
45 | }
|
46 | export import DiffResult = DataProxy.DiffResult;
|
47 | export import ReadQueryOptions = DataProxy.ReadQueryOptions;
|
48 | export import ReadFragmentOptions = DataProxy.ReadFragmentOptions;
|
49 | export import WriteQueryOptions = DataProxy.WriteQueryOptions;
|
50 | export import WriteFragmentOptions = DataProxy.WriteFragmentOptions;
|
51 | export import UpdateQueryOptions = DataProxy.UpdateQueryOptions;
|
52 | export import UpdateFragmentOptions = DataProxy.UpdateFragmentOptions;
|
53 | export import Fragment = DataProxy.Fragment;
|
54 | }
|
55 |
|
\ | No newline at end of file |