Classes
Members
-
static, constant cleanupYTextFormatting
-
This function is experimental and subject to change / be removed.
Ideally, we don't need this function at all. Formatting attributes should be cleaned up automatically after each change. This function iterates twice over the complete YText type and removes unnecessary formatting attributes. This is also helpful for testing.
This function won't be exported anymore as soon as there is confidence that the YText type works as intended.
-
static parent :Item
-
Methods
-
inner cleanupContextlessFormattingGap(transaction, item)
-
Parameters:
Name Type Description transactionTransaction itemItem | null -
inner cleanupFormattingGap(transaction, start, end, startAttributes, endAttributes) → {number}
-
Call this function after string content has been deleted in order to clean up formatting Items.
Parameters:
Name Type Description transactionTransaction startItem endItem | null exclusive end, automatically iterates to the next Content Item
startAttributesMap.<string, any> endAttributesMap.<string, any> This attribute is modified!
Returns:
number -The amount of formatting Items deleted.
-
inner equalAttrs(a, b) → {boolean}
-
Parameters:
Name Type Description aany bany Returns:
boolean
Type Definitions
-
DeltaItem
-
Properties:
Name Type Description DeltaItem.deletenumber | undefined DeltaItem.retainnumber | undefined DeltaItem.insertstring | undefined DeltaItem.attributesObject.<string, any> -
TextAttributes
-
Attributes that can be assigned to a selection of text.
Example
{ bold: true, font-size: '40px' }