Skip to content

eo-typewriterjs


eo-typewriterjs / TDeleteEvent

Type Alias: TDeleteEvent

ts
type TDeleteEvent = TBaseEvent & object;

Defined in: core/events/types/delete-event.type.ts:21

Type Declaration

NameTypeDefined in
timenumbercore/events/types/delete-event.type.ts:22
cursorIdstringcore/events/types/delete-event.type.ts:23
boundary?"start" | "end" | "whole"core/events/types/delete-event.type.ts:24
countnumbercore/events/types/delete-event.type.ts:25
unitTAdvanceUnitcore/events/types/delete-event.type.ts:26
direction1 | -1core/events/types/delete-event.type.ts:27
sourceCommandIdstringcore/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 remove
  • direction: 1 for forward deletion, -1 for backward deletion

The reducer resolves the unit to a character count at apply time.

Released under the MIT License.