UNPKG

@tanstack/db

Version:

A reactive client store for building super fast apps on sync

29 lines (28 loc) • 1.53 kB
declare const PARENT_CONTEXT: unique symbol; type ParentContext = { [PARENT_CONTEXT]: true; value: Record<string, unknown>; projectedBindings: Record<string, unknown>; identity: unknown; }; export declare const PARENT_PROJECTION_NOT_FOUND: unique symbol; 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, projectedBindings?: Record<string, unknown>): ParentContext; export declare function getParentContextProjectedBindings(context: unknown): Record<string, unknown> | undefined; export declare function getParentContextProjectedValue(context: unknown, bindingKey: string): unknown; 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 {};