1 | import "./fixPolyfills.js";
|
2 | import type { DocumentNode } from "graphql";
|
3 | import { ApolloCache } from "../core/cache.js";
|
4 | import type { Cache } from "../core/types/Cache.js";
|
5 | import type { StoreObject, Reference } from "../../utilities/index.js";
|
6 | import type { InMemoryCacheConfig, NormalizedCacheObject } from "./types.js";
|
7 | import { makeVar } from "./reactiveVars.js";
|
8 | import { Policies } from "./policies.js";
|
9 | import type { OperationVariables } from "../../core/index.js";
|
10 | import { getInMemoryCacheMemoryInternals } from "../../utilities/caching/getMemoryInternals.js";
|
11 | type BroadcastOptions = Pick<Cache.BatchOptions<InMemoryCache>, "optimistic" | "onWatchUpdated">;
|
12 | export declare class InMemoryCache extends ApolloCache<NormalizedCacheObject> {
|
13 | private data;
|
14 | private optimisticData;
|
15 | protected config: InMemoryCacheConfig;
|
16 | private watches;
|
17 | private addTypename;
|
18 | private storeReader;
|
19 | private storeWriter;
|
20 | private addTypenameTransform;
|
21 | private maybeBroadcastWatch;
|
22 | readonly assumeImmutableResults = true;
|
23 | readonly policies: Policies;
|
24 | readonly makeVar: typeof makeVar;
|
25 | constructor(config?: InMemoryCacheConfig);
|
26 | private init;
|
27 | private resetResultCache;
|
28 | restore(data: NormalizedCacheObject): this;
|
29 | extract(optimistic?: boolean): NormalizedCacheObject;
|
30 | read<T>(options: Cache.ReadOptions): T | null;
|
31 | write(options: Cache.WriteOptions): Reference | undefined;
|
32 | modify<Entity extends Record<string, any> = Record<string, any>>(options: Cache.ModifyOptions<Entity>): boolean;
|
33 | diff<TData, TVariables extends OperationVariables = any>(options: Cache.DiffOptions<TData, TVariables>): Cache.DiffResult<TData>;
|
34 | watch<TData = any, TVariables = any>(watch: Cache.WatchOptions<TData, TVariables>): () => void;
|
35 | gc(options?: {
|
36 | resetResultCache?: boolean;
|
37 | resetResultIdentities?: boolean;
|
38 | }): string[];
|
39 | retain(rootId: string, optimistic?: boolean): number;
|
40 | release(rootId: string, optimistic?: boolean): number;
|
41 | identify(object: StoreObject | Reference): string | undefined;
|
42 | evict(options: Cache.EvictOptions): boolean;
|
43 | reset(options?: Cache.ResetOptions): Promise<void>;
|
44 | removeOptimistic(idToRemove: string): void;
|
45 | private txCount;
|
46 | batch<TUpdateResult>(options: Cache.BatchOptions<InMemoryCache, TUpdateResult>): TUpdateResult;
|
47 | performTransaction(update: (cache: InMemoryCache) => any, optimisticId?: string | null): any;
|
48 | transformDocument(document: DocumentNode): DocumentNode;
|
49 | protected broadcastWatches(options?: BroadcastOptions): void;
|
50 | private addFragmentsToDocument;
|
51 | private addTypenameToDocument;
|
52 | private broadcastWatch;
|
53 | /**
|
54 | * @experimental
|
55 | * @internal
|
56 | * This is not a stable API - it is used in development builds to expose
|
57 | * information to the DevTools.
|
58 | * Use at your own risk!
|
59 | */
|
60 | getMemoryInternals?: typeof getInMemoryCacheMemoryInternals;
|
61 | }
|
62 | export {};
|
63 |
|
\ | No newline at end of file |