import type { MemoModel, MemoElement } from '../model/semantic.js'; import type { CsvElement } from '../serializer/csv-io.js'; /** One field that changed between the existing element and the incoming CSV row */ export interface FieldChange { field: string; currentValue: string; incomingValue: string; } /** An element that already exists in the model but has incoming changes */ export interface ModifiedElement { current: MemoElement; incoming: CsvElement; changes: FieldChange[]; } /** * Structured diff between the current model and an incoming CSV batch. * * - `added` — elements in the CSV that don't exist in the model yet * - `modified` — elements that exist in both but have field differences * - `unchanged` — element IDs present in both with no differences * - `removed` — element IDs in the model that are NOT in the incoming CSV * (only populated if `detectRemovals` was true — callers opt in * because removal detection requires knowing the CSV represents * the full population, not a partial update) */ export interface ImportDiff { added: CsvElement[]; modified: ModifiedElement[]; unchanged: string[]; removed: string[]; /** Total count of incoming rows */ incomingCount: number; /** Total count of current model elements */ currentCount: number; } /** * Compute the diff between the current model and an incoming batch of elements. * * @param model Current MEMO model (from the builder) * @param incoming Parsed elements from the incoming CSV * @param detectRemovals If true, elements in the model that are missing from * the incoming batch are listed in `removed`. Only set * this to true when the CSV represents a full replacement * of the population, not a partial update. */ export declare function computeImportDiff(model: MemoModel, incoming: CsvElement[], detectRemovals?: boolean): ImportDiff; /** Summarise an ImportDiff to a one-line string */ export declare function formatDiffSummary(diff: ImportDiff): string; //# sourceMappingURL=import-diff.d.ts.map