Content Model Image object if an image is select, or null
Adjust selection to make sure select a hyperlink if any, or a word if original selection is collapsed
A combination of existing link display text and url if any. If there is no existing link, return selected text and null
Bulk apply segment format to all selected content. This is usually used for format painter.
The editor to operate on
The segment format to apply
Operations to apply border
The editor instance
The border to apply
The operation to apply
Change the capitalization of text in the selection
The editor instance
The case option
Optional parameter for language string that should comply to "IETF BCP 47 Tags for Identifying Languages". For example: 'en' or 'en-US' for English, 'tr' for Turkish. Default is the host environment’s current locale.
Increase or decrease font size in selection
The editor instance
Whether increase or decrease font size
Change the selected image src
The editor instance
The image file
Clear format of selection
The editor to clear format from
Clear selection of a table.
The table model where the selection is to be cleared
The selection coordinates to be cleared
Format current focused table with the given format
The editor instance
The table operation to apply
Search for all list items in the same thread as the current list item
The current list item
Search for all list items in the same thread as the current list item (Readonly)
The current list item
Invoke a callback to format the selected image using Content Model
The editor object
Name of API this calling this function. This is mostly for logging.
The callback to format the image. It will be called with current selected table. If no table is selected, it will not be called.
Invoke a callback to format the content in a specific position using Content Model
The editor object
The insert position.
The callback to insert the format.
More options, @see FormatContentModelOptions
Invoke a callback to format the selected paragraph using Content Model
The editor object
Name of API this calling this function. This is mostly for logging.
The callback to format the paragraph. It will be called with current selected table. If no table is selected, it will not be called.
Invoke a callback to format the selected segment using Content Model
The editor object
Name of API this calling this function. This is mostly for logging.
The callback to format the segment. It will be called with current selected table. If no table is selected, it will not be called.
The callback used for checking if the given segment already has required format
True to also include format holder of list item when search selected segments
A callback to invoke after format is applied to all selected segments and before the change is applied to DOM tree
Format current focused table with the given format
The editor instance
The table format to apply
Whether keep existing shade color when apply format if there is a manually set shade color
Invoke a callback to format the selected table using Content Model
The editor object
Name of API this calling this function. This is mostly for logging.
The callback to format the table. It will be called with current selected table. If no table is selected, it will not be called.
Override the current selection. If we want to format a table even currently it is not selected, we can use this parameter to override current selection
Invoke a callback to format the text segment before the selection marker using Content Model
The editor object
The callback to format the text segment.
True if the segment before cursor is found and callback is called, otherwise false
Get current format state
The editor to get format from
The strategy for handling format conflicts
Get announce data for list item
Content model path that include the list item
Announce data of current list item if any, or null
Insert an entity into editor
The editor object
Type of entity
True to insert a block entity, false to insert an inline entity
Position of the entity to insert. It can be Value of InsertEntityPosition: see InsertEntityPosition selectionRangeEx: Use this range instead of current focus position to insert. After insert, focus will be moved to the beginning of this range (when focusAfterEntity is not set to true) or after the new entity (when focusAfterEntity is set to true)
Move options to insert. See InsertEntityOptions
Insert a block entity into editor
The editor object
Type of entity
Must be true for a block entity
Position of the entity to insert. It can be Value of InsertEntityPosition: see InsertEntityPosition selectionRangeEx: Use this range instead of current focus position to insert. After insert, focus will be moved to the beginning of this range (when focusAfterEntity is not set to true) or after the new entity (when focusAfterEntity is set to true)
Move options to insert. See InsertEntityOptions
Insert an image into current selected position
The editor to operate on
Insert a hyperlink at cursor. When there is a selection, hyperlink will be applied to the selection, otherwise a hyperlink will be inserted to the cursor position.
Editor object
Link address, can be http(s), mailto, notes, file, unc, ftp, news, telnet, gopher, wais. When protocol is not specified, a best matched protocol will be predicted.
Optional alt text of the link, will be shown when hover on the link
Optional display text for the link.
Optional display target for the link ("_blank"|"_self"|"_parent"|"_top"|"{framename}") If specified, the display text of link will be replaced with this text. If not specified and there wasn't a link, the link url will be used as display text.
Insert table into editor at current selection
The editor instance
Number of columns in table, it also controls the default table cell width: if columns <= 4, width = 120px; if columns <= 6, width = 100px; else width = 70px
Number of rows in table
(Optional) The table format. If not passed, the default format will be applied: background color: #FFF; border color: #ABABAB
Insert a column to the table
The table model where the column is to be inserted
The operation to be performed
Insert a row to the table
The table model where the row is to be inserted
The operation to be performed
Try to match a given string with link match rules, return matched link
Input url to match
The matched link data, or null if no match found. The link data includes an original url and a normalized url
Promote the given text segment to a hyper link when the segment text is ending with a valid link format. When the whole text segment if of a link, promote the whole segment. When the text segment ends with a link format, split the segment and promote the second part When link is in middle of the text segment, no action. This is mainly used for doing auto link when there is a link before cursor
The text segment to search link text from
Parent paragraph of the segment
If a link is promoted, return this segment. Otherwise return null
Query content model blocks
The block group to query
The type of block to query
Optional selector to filter the blocks
True to return the first block only, false to return all blocks
Remove link at selection. If no links at selection, do nothing. If selection contains multiple links, all of the link styles will be removed. If only part of a link is selected, the whole link style will be removed.
The editor instance
Set text alignment of selected paragraphs
The editor to set alignment
Alignment value: left, center or right
Set background color
The editor to operate on
The color to set. Pass null to remove existing color.
Set text direction of selected paragraphs (Left to right or Right to left)
The editor to set alignment
Direction value: ltr (Left to right) or rtl (Right to left)
Set font name
The editor to operate on
The font name to set
Set font size
The editor to operate on
The font size to set
Set heading level of selected paragraphs
The editor to set heading level to
Level of heading, from 1 to 6. Set to 0 means set it back to a regular paragraph
Set image alt text for all selected images at selection. If no images is contained in selection, do nothing.
The editor instance
The image alt text
Set image border style for all selected images at selection.
The editor instance
the border format object. Ex: { color: 'red', width: '10px', style: 'solid'}, if one of the value in object is undefined its value will not be changed. Passing null instead of an object will remove the border
the border radius value, if undefined, the border radius will keep the actual value
Set image box shadow for all selected images at selection.
The editor instance
The image box boxShadow
The image margin for all sides (eg. "4px"), null to remove margin
Indent or outdent to selected paragraphs
The editor to operate on
Whether indent or outdent
The length of pixel to indent/outdent @default 40
Set start number of a list item
The editor to operate on
The number to set to, must be equal or greater than 1
Set style of list items with in same thread of current item
The editor to operate on
The target list item style to set
Set a list type to content model
the model document
the list type OL | UL
true to remove margins, false to keep margins @default false
The content model to set indentation
The indentation type, 'indent' to indent, 'outdent' to outdent
The length of indentation in pixel, default value is 40 Set indentation for selected list items or paragraphs
Set start number of a list item
The model document
The number to set to, must be equal or greater than 1
Set style of list items with in same thread of current item
The model document
The style to set
Toggles the current block(s) margin properties. null deletes any existing value, undefined is ignored
The editor to operate on
value for top margin
value for bottom margin
Sets current selected block(s) line-height property and wipes such property from child segments
The editor to operate on
Unitless/px value to set line height
Set table cell shade color
The editor instance
The color to set. Pass null to remove existing shade color
Set text color
The editor to operate on
The text color to set. Pass null to remove existing color.
Split given text segments from the given range
segment to split
parent paragraph the text segment exist in
starting point of the split
ending point of the split
text segment from the indicated split.
Toggle BLOCKQUOTE state of selected paragraphs. If any selected paragraph is not under a BLOCKQUOTE, wrap them into a BLOCKQUOTE. Otherwise, unwrap all related BLOCKQUOTEs.
The editor object to toggle BLOCKQUOTE onto
@optional Block format for the new quote object
Toggle bold style
The editor to operate on
Toggle bullet list type
The editor to operate on
true to remove margins, false to keep margins @default false
Toggle italic style
The editor to operate on
Toggle italic style
The editor to operate on
Toggle numbering list type
The editor to operate on
true to remove margins, false to keep margins @default false
Toggle strikethrough style
The editor to operate on
Toggle subscript style
The editor to operate on
Toggle superscript style
The editor to operate on
Toggle underline style
The editor to operate on
Generated using TypeDoc
Adjust selection to make sure select an image if any