Skip to content

Commit 9e4bebe

Browse files
committed
docs(json-crdt-peritext-ui): ✏️ add JSDocs for "marker" event action field
1 parent e5eeefc commit 9e4bebe

File tree

1 file changed

+14
-0
lines changed
  • src/json-crdt-extensions/peritext/events

1 file changed

+14
-0
lines changed

src/json-crdt-extensions/peritext/events/types.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,20 @@ export interface FormatDetail extends RangeEventDetail, SliceDetailPart {
451451
export interface MarkerDetail extends RangeEventDetail, SliceDetailPart {
452452
/**
453453
* The action to perform.
454+
*
455+
* - The `'ins'` action inserts a new block marker at the current selection.
456+
* It splits the current block at the selection point, creating a new block
457+
* boundary (marker). The block type may be nested (say `['p', 'blockquote']`),
458+
* which will result in a nested block structure, for example,
459+
* `<p><blockquote>text</blockquote></p>`. Use the `type` field to specify
460+
* the block type.
461+
* - The `'del'` action removes all block markers which begin just before
462+
* the startu of the current selection ranges. To remove a specific block
463+
* marker, specify the `slice` field with the {@link MarkerSlice} or its
464+
* ID {@link ITimestampStruct}.
465+
* - The `'upd'` action lets you update an existing block marker. Use the
466+
* `target` to specify the target node to update, and the `ops` field to
467+
* specify the operations to perform on the target node.
454468
*/
455469
action: 'ins' | 'del' | 'upd';
456470

0 commit comments

Comments
 (0)