Options
All
  • Public
  • Public/Protected
  • All
Menu

A wrapper for a contenteditable HTML element, allowing the element's text content to be spliced – that is, modified using a TextSplice, without losing or misplacing a user's active selection range.

Hierarchy

  • ElementSpliceText

Index

Constructors

constructor

  • Parameters

    • element: HTMLElement

      the HTML element to manage as splice-able text. Must be contenteditable.

    • clone: WriteStateMachine
    • subjectId: string
    • property: string
    • initialText: string

      some initial text to populate the element with

    Returns ElementSpliceText

Properties

Readonly clone

Readonly element

element: HTMLElement

the HTML element to manage as splice-able text. Must be contenteditable.

Readonly property

property: string

Readonly subjectId

subjectId: string

Methods

apply

Protected doWrite

  • doWrite(inputting: Inputting): Promise<unknown>
  • Parameters

    • inputting: Inputting

    Returns Promise<unknown>

get

  • get(): string
  • Returns string

Protected inputWriteRequest

  • inputWriteRequest(splices: TextSplice[]): { @update: object }
  • Parameters

    Returns { @update: object }

    • @update: object
      • @id: string
      • [this.property]: { @splice: TextSplice }[]

splice

  • splice(index: number, deleteCount: number, content?: undefined | string): void
  • Parameters

    • index: number
    • deleteCount: number
    • Optional content: undefined | string

    Returns void

toJSON

  • toJSON(): string
  • Returns string

Legend

  • Constructor
  • Property
  • Method
  • Property
  • Method
  • Inherited property
  • Inherited method
  • Static property
  • Static method
  • Protected method

Generated using TypeDoc. Delivered by Vercel. @m-ld/m-ld - v0.10.0 Source code licensed MIT. Privacy policy