new YText(stringopt)
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
string |
String |
<optional> |
The initial value of the YText. |
Extends
- AbstractType.<YTextEvent>
Methods
-
applyDelta(delta)
-
Apply a Delta on this shared YText type.
Parameters:
Name Type Description deltaany The changes to apply on this element.
-
delete(index, length)
-
Deletes text starting from an index.
Parameters:
Name Type Description indexnumber Index at which to start deleting.
lengthnumber The number of characters to remove. Defaults to 1.
-
format(index, length, attributes)
-
Assigns properties to a range of text.
Parameters:
Name Type Description indexnumber The position where to start formatting.
lengthnumber The amount of characters to assign properties to.
attributesTextAttributes Attribute information to apply on the text.
-
insert(index, text, attributes)
-
Insert text at a given index.
Parameters:
Name Type Description indexnumber The index at which to start inserting.
textString The text to insert at the specified position.
attributesTextAttributes Optionally define some formatting information to apply on the inserted Text.
-
insertEmbed(index, embed, attributes)
-
Inserts an embed at a index.
Parameters:
Name Type Description indexnumber The index to insert the embed at.
embedObject The Object that represents the embed.
attributesTextAttributes Attribute information to apply on the embed
-
toDelta(snapshotopt, prevSnapshotopt) → {any}
-
Returns the Delta representation of this YText type.
Parameters:
Name Type Attributes Description snapshotSnapshot <optional>
prevSnapshotSnapshot <optional>
Returns:
any -The Delta representation of this type.
-
toString()
-
Returns the unformatted string representation of this YText type.