UNPKG

@tanstack/db

Version:

A reactive client store for building super fast apps on sync

25 lines (24 loc) 1.15 kB
declare const PARENT_CONTEXT: unique symbol; type ParentContext = { [PARENT_CONTEXT]: true; value: Record<string, unknown>; identity: unknown; }; export type ValueIdentity = { equality: (value: unknown) => unknown; exact: (value: unknown) => unknown; serializeEquality: (value: unknown) => string; }; export declare function createValueIdentity(): ValueIdentity; /** Preserve the value relation used by equality predicates in keyed state. */ export declare function getEqualityValueIdentity(value: unknown): unknown; /** Keep compiler identity outside the namespace that holds user aliases. */ export declare function createParentContext(value: Record<string, unknown>, identity: unknown): ParentContext; export declare function getParentContextValue(context: unknown): Record<string, unknown> | undefined; /** * The envelope is structural D2 state, but its value keeps the user's alias * namespace separate from compiler identity. A later insert or retract can * therefore rebuild the same route without reserving a user-visible key. */ export declare function getParentContextIdentity(context: unknown): unknown; export {};