/*! * Mode Data — TypeScript Definitions * MIT License — Copyright (c) 2025 Silvio Corigliano */ /** A single row/field cell — speaks the atom protocol and is writable. */ export interface Cell { get(): T; sub(fn: (v: T) => void, runNow?: boolean): () => void; set(v: T): void; } /** Columnar payload: parallel `fields` (column names) and `values` (rows). */ export interface ColumnarPayload { fields: string[]; values: unknown[][]; } /** * Columnar store for high-frequency feeds. Triple diff filter * (global → row → cell) with granular per-row notifications; `cell()` bridges * a single field to the atom protocol so it binds directly with µ. */ export declare class DataStore { constructor(pk?: string); /** Per-row subscription; the callback receives only the changed fields. */ subscribe(id: string | number, callback: (changes: Record) => void): () => void; /** Local write; granular and immediate. */ patch(id: string | number, changes: Record): void; /** Ingest a columnar payload (API/socket). */ update(data: ColumnarPayload): void; /** Current value of a field, or null if absent. */ getValue(id: string | number, field: string): unknown; /** The atom-protocol bridge for one field of one row (cached). */ cell(id: string | number, field: string): Cell; } export default DataStore;