/** * GlossaristModel — abstract base for every domain model. * * Subclasses implement `toJSON()` (wire shape) and `identity()` * (stable string key for diff/dedupe). `equals()` and `clone()` * default to comparing via JSON serialization; subclasses may * override for performance. */ /** * Any value that can be the output of `JSON.stringify`. Used as the * return type of {@link GlossaristModel.toJSON} so subclasses with * non-object JSON output (e.g. `NonVerbalReference.toJSON()` returns * a bare string for the no-display case) can override without * breaking variance. The object case accepts any object to avoid * forcing `Json` interfaces to declare explicit string index * signatures (TS interfaces don't have implicit index signatures). */ export type JsonValue = string | number | boolean | null | JsonValue[] | object; export declare abstract class GlossaristModel { /** Wire-shape serialization. Subclasses MUST override. */ toJSON(): JsonValue; /** Stable identity string for diff, dedupe, registry keys. */ identity(): string; /** Default: structural equality via JSON. Override for semantic equality. */ equals(other: this): boolean; /** Deep clone via JSON round-trip. Subclasses with non-JSON-safe * fields must override. */ clone(): this; /** * Subclasses MUST override. Declared on the abstract base so callers * who only have `typeof GlossaristModel` get a typed call site * (rather than the static disappearing under `abstract`). */ static fromJSON(_data: unknown): GlossaristModel; /** * Lazily wrap a raw array (plain hashes) into model instances. * Used by Concept's lazy `figures`/`tables`/`formulas` getters so * the wrap cost is only paid on first access. * * `cacheKey` and `rawKey` are private field names on `this`. The * bracket access here is the only legitimate reflective pattern in * the codebase (lazy field init). It is bracket-typed through a * local alias rather than the public surface. * * Underscore-prefixed (not `protected`) so JS subclasses during the * TS migration transition can call it without TS4094 on anonymous * class expressions. Once all subclasses are .ts this can move to * `protected`. */ _lazy(cacheKey: string, rawKey: string, wrapFn: (raw: unknown) => TItem): TItem[]; /** * Helper for `toJSON()`: serialize a lazy-or-raw array under * `jsonKey` only when it has items. Model instances go through * `toJSON()`; primitives pass through. */ _serialize(obj: Record, jsonKey: string, cacheKey: string, rawKey: string): void; } //# sourceMappingURL=base.d.ts.map