Skip to main content

ITextEditor

Interfaces​

IListConfiguration​

A structure defining layout settings and format of lists in text elements.

Properties​

bulletChar​
bulletChar: string;

The bulleted list marker that will be used when creating lists through the Top toolbar. The default value is "•" (0x8226).

firstLineIndent​
firstLineIndent: number;

The distance between the bullet and text in the first line of a list item, in points. The default value is -20.

levelIndent​
levelIndent: number;

The offset of each next level of the list relative to the previous level, in points. The default value is 30.

listIndent​
listIndent: number;

The distance between the left edge of the text element and the leftmost line of list items in this text element, in points. The default value is 30.

maxLevel​
maxLevel: number;

The maximum number of levels in multilevel lists. The default value is 3.

numberingFormat​
numberingFormat: NumberingFormatType;

The numbered list marker format, one of "none", "number", "lowerLetter", "upperLetter", "lowerRoman", or "upperRoman". If "none", then list items will represent paragraphs without numbers. This marker format will be used when creating lists through the Top toolbar. The default value is "number".

tabOffset​
tabOffset: number;

The offset that will appear before text on the first line if this text may overlap the bullet, in points. If this value is not enough to create an indent, it will be added again. The default value is 30.


ITextEditor​

Executes a command of the specified type.

Extends​

Properties​

canRedo​
canRedo: boolean;

Indicates if the action can be redone.

canUndo​
canUndo: boolean;

Indicates if the action can be undone.

disableDrawBaseline​
disableDrawBaseline: boolean;
editorInitialized​
editorInitialized: EventObject<void>;

Editor initialization event.

frameChanged​
frameChanged: EventObject<RectangleF>;

Text frame change event.

Remarks​

Reports the currently text frame.

highlightInEditingModeEnabled​
highlightInEditingModeEnabled: boolean;

Indicates if the editor has to be highlighted when in editing mode.

invalidCharEntered​
invalidCharEntered: EventObject<void>;

Invalid character input event.

isActive​
isActive: boolean;

Indicates if the editor is in editing mode.

isReady​
isReady: boolean;

Indicates if the editor is initialized and ready to work.

redrawActiveTextInEditMode​
redrawActiveTextInEditMode: boolean;

Indicates if the editor needs to redraw ActiveText when it is edited.

styleChanged​
styleChanged: EventObject<void>;

Character or paragraph style change event.

textLimits​
textLimits: ITextLimits;

Get current text limits.

textLimitsViolationEvent​
textLimitsViolationEvent: EventObject<ILimitsViolationEventData>;
textMetrics​
textMetrics: ITextMetrics;

Get current text data: characters count, paragraphs count, current paragraph characters count.

textMetricsChangedEvent​
textMetricsChangedEvent: EventObject<ITextMetrics>;

Methods​

dispose()​
dispose(): void;

Disposes text editor when its no longer needed.

Returns​

void

enterEditMode()​
enterEditMode(point): void;

Enters the editing mode.

Parameters​
ParameterTypeDescription
pointIPointcursor point.
Returns​

void

executeCommand()​
Call Signature​
executeCommand(type): void;
Parameters​
ParameterType
typeundo
Returns​

void

Inherited from​

ITextEditorCmd.executeCommand

Call Signature​
executeCommand(type): void;
Parameters​
ParameterType
typeredo
Returns​

void

Inherited from​

ITextEditorCmd.executeCommand

Call Signature​
executeCommand(type, data): void;
Parameters​
ParameterType
typesetCursor
dataSetCursorCmdData
Returns​

void

Inherited from​

ITextEditorCmd.executeCommand

Call Signature​
executeCommand(type, data): void;
Parameters​
ParameterType
typemoveCursor
dataMoveCursorCmdData
Returns​

void

Inherited from​

ITextEditorCmd.executeCommand

Call Signature​
executeCommand(type, data): void;
Parameters​
ParameterType
typesetSelection
dataSetSelectionCmdData
Returns​

void

Inherited from​

ITextEditorCmd.executeCommand

Call Signature​
executeCommand(type, data): void;
Parameters​
ParameterType
typeselectWord
dataSelectWordCmdData
Returns​

void

Inherited from​

ITextEditorCmd.executeCommand

Call Signature​
executeCommand(type, data): void;
Parameters​
ParameterType
typeselectParagraph
dataSelectParagraphCmdData
Returns​

void

Inherited from​

ITextEditorCmd.executeCommand

Call Signature​
executeCommand(type): void;
Parameters​
ParameterType
typeselectAllText
Returns​

void

Inherited from​

ITextEditorCmd.executeCommand

Call Signature​
executeCommand(type, data): void;
Parameters​
ParameterType
typeinsertNewLine
dataInsertNewLineCmdData
Returns​

void

Inherited from​

ITextEditorCmd.executeCommand

Call Signature​
executeCommand(type, data): void;
Parameters​
ParameterType
typeinsertLineBrake
dataInsertLineBrakeCmdData
Returns​

void

Inherited from​

ITextEditorCmd.executeCommand

Call Signature​
executeCommand(type): void;
Parameters​
ParameterType
typeinsertTab
Returns​

void

Inherited from​

ITextEditorCmd.executeCommand

Call Signature​
executeCommand(type, data): void;
Parameters​
ParameterType
typeinsertText
dataInsertTextCmdData
Returns​

void

Inherited from​

ITextEditorCmd.executeCommand

Call Signature​
executeCommand(type, data): void;
Parameters​
ParameterType
typedeleteText
dataDeleteTextCmdData
Returns​

void

Inherited from​

ITextEditorCmd.executeCommand

Call Signature​
executeCommand(type): void;
Parameters​
ParameterType
typecopyToClipboard
Returns​

void

Inherited from​

ITextEditorCmd.executeCommand

Call Signature​
executeCommand(type): void;
Parameters​
ParameterType
typeclearFormatting
Returns​

void

Inherited from​

ITextEditorCmd.executeCommand

Call Signature​
executeCommand(type, data): void;
Parameters​
ParameterType
typesetCharStyle
dataSetCharStyleCmdData
Returns​

void

Inherited from​

ITextEditorCmd.executeCommand

Call Signature​
executeCommand(type, data): void;
Parameters​
ParameterType
typesetParagraphStyle
dataSetParagraphStyleCmdData
Returns​

void

Inherited from​

ITextEditorCmd.executeCommand

Call Signature​
executeCommand(type): void;
Parameters​
ParameterType
typesetCapitalLetters
Returns​

void

Inherited from​

ITextEditorCmd.executeCommand

Call Signature​
executeCommand(type): void;
Parameters​
ParameterType
typesetFontBold
Returns​

void

Inherited from​

ITextEditorCmd.executeCommand

Call Signature​
executeCommand(type): void;
Parameters​
ParameterType
typesetFontItalic
Returns​

void

Inherited from​

ITextEditorCmd.executeCommand

Call Signature​
executeCommand(type): void;
Parameters​
ParameterType
typesetSuperscriptLetters
Returns​

void

Inherited from​

ITextEditorCmd.executeCommand

Call Signature​
executeCommand(type): void;
Parameters​
ParameterType
typesetSubscriptLetters
Returns​

void

Inherited from​

ITextEditorCmd.executeCommand

Call Signature​
executeCommand(type): void;
Parameters​
ParameterType
typesetFontUnderline
Returns​

void

Inherited from​

ITextEditorCmd.executeCommand

Call Signature​
executeCommand(type, data?): void;
Parameters​
ParameterType
typeincreaseFontSize
data?IncreaseFontSizeCmdData
Returns​

void

Inherited from​

ITextEditorCmd.executeCommand

Call Signature​
executeCommand(type, data?): void;
Parameters​
ParameterType
typedecreaseFontSize
data?DecreaseFontSizeCmdData
Returns​

void

Inherited from​

ITextEditorCmd.executeCommand

Call Signature​
executeCommand(type, data): void;
Parameters​
ParameterType
typesetAlignment
dataSetAlignmentCmdData
Returns​

void

Inherited from​

ITextEditorCmd.executeCommand

Call Signature​
executeCommand(type, data): void;
Parameters​
ParameterType
typeaddListItem
dataAddListItemCmdData
Returns​

void

Inherited from​

ITextEditorCmd.executeCommand

Call Signature​
executeCommand(type, data): void;
Parameters​
ParameterType
typecreteBulletedListItem
dataCreateBulletedListItemCmdData
Returns​

void

Inherited from​

ITextEditorCmd.executeCommand

Call Signature​
executeCommand(type, data): void;
Parameters​
ParameterType
typecreteBulletedListItem
dataCreateNumberedListItemCmdData
Returns​

void

Inherited from​

ITextEditorCmd.executeCommand

Call Signature​
executeCommand(type, data?): void;
Parameters​
ParameterType
typedeleteListItem
data?DeleteListItemCmdData
Returns​

void

Inherited from​

ITextEditorCmd.executeCommand

Call Signature​
executeCommand(type, data?): void;
Parameters​
ParameterType
typeincreaseListItemIndent
data?IncreaseListItemIndentData
Returns​

void

Inherited from​

ITextEditorCmd.executeCommand

Call Signature​
executeCommand(type, data?): void;
Parameters​
ParameterType
typedecreaseListItemIndent
data?DecreaseListItemIndentData
Returns​

void

Inherited from​

ITextEditorCmd.executeCommand

Call Signature​
executeCommand(type, data): void;
Parameters​
ParameterType
typeapplyListItem
dataApplyListTypeCmdData
Returns​

void

Inherited from​

ITextEditorCmd.executeCommand

exitEditMode()​
exitEditMode(): void;

Exits editing mode.

Returns​

void

getFormattedText()​
getFormattedText(): Promise<string>;

Returns formatted text.

Returns​

Promise<string>

getInlineStyle()​
getInlineStyle(): ICharStyle;

Returns the character style for the current cursor position or the starting position of the selected text.

Returns​

ICharStyle

getParagraphStyle()​
getParagraphStyle(): IParagraphStyle;

Returns the paragraph style for the current cursor position or the first paragraph of the selected text.

Returns​

IParagraphStyle

getTextModel()​
getTextModel(): Text;

Returns the text model.

Returns​

Text

isApplyingListsEnabled()​
isApplyingListsEnabled(): boolean;

Indicates if applying lists is allowed.

Returns​

boolean

isBulletedList()​
isBulletedList(): boolean;

Indicates if the current paragraph or selected paragraphs are bulleted list.

Returns​

boolean

isIndentationEnabled()​
isIndentationEnabled(): boolean;

Indicates if indentation is allowed.

Returns​

boolean

isIndentationHidden()​
isIndentationHidden(): boolean;

Indicates if indentation is applyable.

Returns​

boolean

isNumberedList()​
isNumberedList(): boolean;

Indicates if the current paragraph or selected paragraphs are numbered list.

Returns​

boolean

processKeyEvent()​
processKeyEvent(e): Promise<boolean>;

Handles keyboard input events.

Parameters​
ParameterTypeDescription
eIKeyboardEventkeyboard event.
Returns​

Promise<boolean>

true if changes were made, false otherwise.

processMouseEvent()​
processMouseEvent(e): void;

Handles mouse input events.

Parameters​
ParameterTypeDescription
eIMouseEventmouse event.
Returns​

void

processZoomChangedEvent()​
processZoomChangedEvent(): Promise<boolean>;

Handles canvas zoom changed event.

Returns​

Promise<boolean>

true if event was processed, false if the text editor is not ready yet.

redo()​
redo(): void;

Redoes an action.

Returns​

void

redraw()​
redraw(): void;
Returns​

void

setFontRegistry()​
setFontRegistry(fontRegistry): any;
Parameters​
ParameterType
fontRegistryIFontRegistry
Returns​

any

setInlineStyle()​
setInlineStyle(style): Promise<void>;

Sets the character style for the current cursor position or selected text.

Parameters​
ParameterTypeDescription
styleICharStyleexpected character style.
Returns​

Promise<void>

Remarks​

only properties specified in the expected style are set.

setParagraphStyle()​
setParagraphStyle(style): Promise<void>;

Sets the paragraph style for the current cursor position or selected text.

Parameters​
ParameterTypeDescription
styleIParagraphStyleexpected paragraph style.
Returns​

Promise<void>

Remarks​

only properties specified in the expected style are set.

undo()​
undo(): void;

Undoes an action.

Returns​

void


ITextEditorElementHandler​

Properties​

textEditorDiv​
textEditorDiv: HTMLElement;
textEditorInnerDiv​
textEditorInnerDiv: HTMLElement;

Methods​

addTextEditorStyles()​
addTextEditorStyles(css): void;
Parameters​
ParameterType
cssstring
Returns​

void

getTextEditorFormattedText()​
getTextEditorFormattedText(): string;
Returns​

string

hideTextEditor()​
hideTextEditor(): any;
Returns​

any

showTextEditor()​
showTextEditor(
rectangle,
textAlignment,
html,
borderWidth,
borderColor,
fillColor,
opacity,
verticalAlignment,
isVertical): void;
Parameters​
ParameterType
rectangleRotatedRectangleF
textAlignmentTextAlignment
htmlstring
borderWidthnumber
borderColorstring
fillColorstring
opacitynumber
verticalAlignmentTextVerticalAlignment
isVerticalboolean
Returns​

void

Type Aliases​

EditorInitData​

type EditorInitData = object;

Properties​

borderColor?​
optional borderColor?: string;
borderWidth?​
optional borderWidth?: number;
defaultInlineStyle?​
optional defaultInlineStyle?: ICharStyle;
defaultParagraphStyle?​
optional defaultParagraphStyle?: IParagraphStyle;
fillColor?​
optional fillColor?: string;
isVertical?​
optional isVertical?: boolean;
limits?​
optional limits?: ITextLimits;
listSettings​
listSettings: IListConfiguration;
newLineEnabled?​
optional newLineEnabled?: boolean;
opacity?​
optional opacity?: number;
point?​
optional point?: IPoint;
previewScale?​
optional previewScale?: number;
rectangle?​
optional rectangle?: RotatedRectangleF;
text?​
optional text?: string;
textAlignment?​
optional textAlignment?: TextAlignment;
textFormattingEnabled?​
optional textFormattingEnabled?: boolean;
textVerticalAlignment?​
optional textVerticalAlignment?: TextVerticalAlignment;
transform?​
optional transform?: Transform;
Was this page helpful?