TextAreaState

class TextAreaState(initialValue: String = "", val maxLength: Int = 32767)(source)

Owner-confined mutable text and vertical scroll position for one multiline editor.

Accepted input is well-formed Unicode with LF line breaks. CRLF, CR, VT, FF, NEL, line separator, and paragraph separator normalize to LF before the UTF-16 length limit is applied. Other C0 controls, DEL, isolated surrogates, and the section-sign formatting marker are rejected without changing state. Values own no retained nodes; one live text observer prevents simultaneous editors from sharing this state. Reads, writes, observation, and subscription release are confined to the construction execution owner.

Parameters

initialValue

initial text, normalized before storage.

Throws

when TextAreaState.maxLength is not positive or initialValue is unsupported or too long after normalization.

Constructors

Link copied to clipboard
constructor(initialValue: String = "", maxLength: Int = 32767)

Properties

Link copied to clipboard

positive maximum UTF-16 length of the normalized TextAreaState.value.

Link copied to clipboard

Stable owned vertical position shared by the editor and optional external scrollbars.

Link copied to clipboard

Current well-formed Unicode text with canonical LF line breaks.

Functions

Link copied to clipboard
fun observe(callback: (String) -> Unit): AutoCloseable

Installs the sole retained text observer used by a runtime text-area node.