Skip to content

Commit

Permalink
doc: Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
clepski committed Jan 10, 2025
1 parent 1334d00 commit 852c7ab
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions docs/core-api/edit-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,19 @@ interface SetTextContentV2 {
}
```

### Complex edits

Complex edits can be used to apply multiple edits as a single event. This will create a single entry in the history. You can create complex edit events by passing an array of edit events to the `newEditEventV2` factory function.

```ts
import { newEditEventV2 } from '@openscd/core';

const complexEditEvent = newEditEventV2([ insert, update, remove ]);

someComponent.dispatchEvent(complexEditEvent);

```

## History

All edit events with the option `createHistoryEntry` will create a history log entry and can be undone and redone through the history addon.
Expand Down

0 comments on commit 852c7ab

Please sign in to comment.