Skip to main content

IStyleService

Interfaces​

IStyleService​

Service for performing basic operations with paragraph and character styles.

Extended by​

Properties​

styleChangedEvent​
styleChangedEvent: EventObject<void>;

Character or paragraph style change event.

Methods​

clearCurrentFormatting()​
clearCurrentFormatting(): void;

Clears formatting (character style) for the current cursor position or selected text.

Returns​

void

getCharStyleForPosition()​
getCharStyleForPosition(position): ICharStyle;

Returns the character style by position.

Parameters​
ParameterTypeDescription
positionIPositionInTextposition in text.
Returns​

ICharStyle

getCurrentCharStyle()​
getCurrentCharStyle(): ICharStyle;

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

Returns​

ICharStyle

getCurrentParagraphStyle()​
getCurrentParagraphStyle(): IParagraphStyle;

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

Returns​

IParagraphStyle

getParagraphStyleByIndex()​
getParagraphStyleByIndex(index): IParagraphStyle;

Returns the paragraph style by index.

Parameters​
ParameterTypeDescription
indexnumberparagraph index (from 0).
Returns​

IParagraphStyle

setCharStyleForPosition()​
setCharStyleForPosition(position, style): void;

Sets the character style by position.

Parameters​
ParameterTypeDescription
positionIPositionInTextposition in text.
styleICharStyleexpected character style.
Returns​

void

setCurrentCharStyle()​
setCurrentCharStyle(style): void;

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

Parameters​
ParameterTypeDescription
styleICharStyleexpected character style.
Returns​

void

Remarks​

only properties specified in the expected style are set.

setCurrentParagraphStyle()​
setCurrentParagraphStyle(style): void;

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

Parameters​
ParameterTypeDescription
styleIParagraphStyleexpected paragraph style.
Returns​

void

Remarks​

only properties specified in the expected style are set.

setParagraphStyleByIndex()​
setParagraphStyleByIndex(index, style): void;

Sets the paragraph style by index.

Parameters​
ParameterTypeDescription
indexnumberparagraph index (from 0).
styleIParagraphStyleexpected paragraph style.
Returns​

void

Remarks​

only properties specified in the expected style are set.

Was this page helpful?