UNPKG

1.89 kBTypeScriptView Raw
1import type { DocumentNode, SelectionSetNode } from "graphql";
2import type { NormalizedCache, InMemoryCacheConfig } from "./types.js";
3import type { KeyFieldsContext } from "./policies.js";
4import type { FragmentRegistryAPI } from "./fragmentRegistry.js";
5import type { Reference, StoreValue, StoreObject, FragmentMap, FragmentMapFunction } from "../../utilities/index.js";
6import { DeepMerger, isArray } from "../../utilities/index.js";
7export declare const hasOwn: (v: PropertyKey) => boolean;
8export declare function isNullish(value: any): value is null | undefined;
9export { isArray };
10export declare function defaultDataIdFromObject({ __typename, id, _id }: Readonly<StoreObject>, context?: KeyFieldsContext): string | undefined;
11export declare function normalizeConfig(config: InMemoryCacheConfig): {
12 dataIdFromObject: typeof defaultDataIdFromObject;
13 addTypename: boolean;
14 resultCaching: boolean;
15 canonizeResults: boolean;
16} & InMemoryCacheConfig;
17export declare function shouldCanonizeResults(config: Pick<InMemoryCacheConfig, "canonizeResults">): boolean;
18export declare function getTypenameFromStoreObject(store: NormalizedCache, objectOrReference: StoreObject | Reference): string | undefined;
19export declare const TypeOrFieldNameRegExp: RegExp;
20export declare function fieldNameFromStoreName(storeFieldName: string): string;
21export declare function selectionSetMatchesResult(selectionSet: SelectionSetNode, result: Record<string, any>, variables?: Record<string, any>): boolean;
22export declare function storeValueIsStoreObject(value: StoreValue): value is StoreObject;
23export declare function makeProcessedFieldsMerger(): DeepMerger<any[]>;
24export declare function extractFragmentContext(document: DocumentNode, fragments?: FragmentRegistryAPI): {
25 fragmentMap: FragmentMap;
26 lookupFragment: FragmentMapFunction;
27};
28//# sourceMappingURL=helpers.d.ts.map
\No newline at end of file