import type { FrailMap } from 'frail-map'; import type { CacheNode, CacheObject } from '.'; export type NormalizedObjectShell = TData & { $set(value: TData): void; toJSON(): TData; }; export declare const isNormalizedObjectShell: (value: unknown) => value is NormalizedObjectShell; export type NormalizatioOptions = CacheNormalizationHandler & { store: FrailMap>; }; /** * Update the store with incoming data, merge or replace them depends on * provided handlers. */ export declare const normalizeObject: (data: TData, { identity, onConflict, store }: NormalizatioOptions) => NormalizedObjectShell | undefined; /** * Recursively replace normalize input objects with the provided store. */ export declare const deepNormalizeObject: (data: TData, options: NormalizatioOptions) => TData; export type CacheNormalizationHandler = { /** * To disable normalization for a particular object, return undefined. */ identity(value: CacheNode): string | undefined; onConflict?( /** Existing value */ sourceValue: object, /** Incoming value */ targetValue: object): object | undefined; schemaKeys?: Record; }; export declare const defaultNormalizationHandler: CacheNormalizationHandler; export declare const isSubsetOf: (a: CacheObject, b: CacheObject) => boolean;