eo-typewriterjs / TDeleteEvent
Type Alias: TDeleteEvent
ts
type TDeleteEvent = TBaseEvent & object;Defined in: core/events/types/delete-event.type.ts:21
Type Declaration
| Name | Type | Defined in |
|---|---|---|
time | number | core/events/types/delete-event.type.ts:22 |
cursorId | string | core/events/types/delete-event.type.ts:23 |
boundary? | "start" | "end" | "whole" | core/events/types/delete-event.type.ts:24 |
count | number | core/events/types/delete-event.type.ts:25 |
unit | TAdvanceUnit | core/events/types/delete-event.type.ts:26 |
direction | 1 | -1 | core/events/types/delete-event.type.ts:27 |
sourceCommandId | string | core/events/types/delete-event.type.ts:28 |
Description
A scheduled event that removes text from the document relative to the cursor.
When boundary is present, it takes precedence and removes text to the named boundary:
"start": delete from the cursor back to document start"end": delete from the cursor forward to document end"whole": delete the entire document
When boundary is absent the reducer uses count, unit, and direction:
count: number of logical units to removedirection:1for forward deletion,-1for backward deletion
The reducer resolves the unit to a character count at apply time.