import type { CasStore, Hash, HistoryEntry } from "./types.js"; import type { Variable } from "./variable.js"; /** * Internal record shape used by both Memory and Fs VarStore implementations. * Persistence-specific code lives in each factory; pure operations on this * shape live here so they aren't duplicated. */ export type VarRecord = { name: string; schema: Hash; value: Hash; created: number; updated: number; tags: Record; labels: string[]; history: HistoryEntry[]; }; /** Build the composite map key from `(name, schema)`. */ export declare function varKey(name: string, schema: Hash): string; /** Add `k` to the `byName[name]` index, creating the set if needed. */ export declare function addNameIndex(byName: Map>, name: string, k: string): void; /** Remove `k` from the `byName[name]` index, dropping empty sets. */ export declare function removeNameIndex(byName: Map>, name: string, k: string): void; /** Resolve `hash → schema` (the type field of the stored CAS node). */ export declare function extractSchema(cas: CasStore, hash: Hash): Hash; /** Reject `(tags, labels)` combinations where the same key appears in both. */ export declare function checkTagLabelConflict(tags: Record, labels: string[]): void; /** * Push a new value onto the variable's history. Returns true if the head * changed (i.e. a new value was set), false when the head was already `value`. */ export declare function pushHistory(rec: VarRecord, value: Hash, now: number): boolean; /** Convert a stored `VarRecord` to the public `Variable` shape (deep copy). */ export declare function cloneVarRecord(rec: VarRecord): Variable; //# sourceMappingURL=var-store-helpers.d.ts.map