Skip to content

Type Editor


Type Editor / @type-editor/dom-change-util / types/dom-change/DocumentChange

types/dom-change/DocumentChange

Interfaces

InterfaceDescription

DocumentChange

Represents a change detected in the document by comparing old and new content.

This interface describes the positions where content has changed, with separate end positions for the old document (endA) and new document (endB).

DocumentChange

Example

typescript
// User types "x" at position 5
const change: DocumentChange = {
  start: 5, // Change starts at position 5
  endA: 5, // Old document ends at 5 (nothing was there)
  endB: 6, // New document ends at 6 (one char added)
};