UNPKG

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