import { DocumentNode, FieldNode } from 'graphql'; import { Reference, StoreObject, StoreValue, isReference } from '../../../utilities'; import { StorageType } from '../../inmemory/policies'; export type SafeReadonly = T extends object ? Readonly : T; export type MissingTree = string | { readonly [key: string]: MissingTree; }; export declare class MissingFieldError extends Error { readonly message: string; readonly path: MissingTree | Array; readonly query: DocumentNode; readonly variables?: Record | undefined; constructor(message: string, path: MissingTree | Array, query: DocumentNode, variables?: Record | undefined); readonly missing: MissingTree; } export interface FieldSpecifier { typename?: string; fieldName: string; field?: FieldNode; args?: Record; variables?: Record; } export interface ReadFieldOptions extends FieldSpecifier { from?: StoreObject | Reference; } export interface ReadFieldFunction { (options: ReadFieldOptions): SafeReadonly | undefined; (fieldName: string, from?: StoreObject | Reference): SafeReadonly | undefined; } export type ToReferenceFunction = (objOrIdOrRef: StoreObject | string | Reference, mergeIntoStore?: boolean) => Reference | undefined; export type CanReadFunction = (value: StoreValue) => boolean; export type ModifierDetails = { DELETE: any; INVALIDATE: any; fieldName: string; storeFieldName: string; readField: ReadFieldFunction; canRead: CanReadFunction; isReference: typeof isReference; toReference: ToReferenceFunction; storage: StorageType; }; export type Modifier = (value: T, details: ModifierDetails) => T; export type Modifiers = { [fieldName: string]: Modifier; }; //# sourceMappingURL=common.d.ts.map