/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options */ /** * @module footnotes/modelelementtracker */ import type { ModelElement, Model, DifferItem } from "@ckeditor/ckeditor5-engine"; /** * Tracks changes of specific elements in document changes. */ export declare class ModelElementTracker { /** * @param model The editor model instance. * @param config Configuration for tracking specific element type. */ constructor(model: Model, config: TrackElementChangesConfig); /** * Resets the tracker, clearing all tracked elements. */ reset(): void; /** * Analyzes document changes and returns the set of changes for the tracked element type. * * @param documentChanges Array of document changes to analyze. * @returns Object containing removed, inserted, and moved elements. */ getChanges(documentChanges: Array): ElementChangesResult; } /** * Configuration for tracking element changes. */ type TrackElementChangesConfig = { /** * Name of the element to track (e.g., 'footnoteRef', 'footnotesDefinitions'). */ elementName: string; /** * Function to extract a unique key from the element for tracking purposes. */ getElementKey: (element: ModelElement) => string; }; /** * Result of tracking element changes. */ type ElementChangesResult = { /** * Set of removed element keys. */ removed: Array; /** * Map of inserted element keys to their elements. */ inserted: Array; /** * Set of moved elements (removed + inserted). */ moved: Array; }; export {};