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
| Parameter | Type | Description |
|---|---|---|
position | IPositionInText | position in text. |
Returns
getCurrentCharStyle()
getCurrentCharStyle(): ICharStyle;
Returns the character style for the current cursor position or the starting position of the selected text.
Returns
getCurrentParagraphStyle()
getCurrentParagraphStyle(): IParagraphStyle;
Returns the paragraph style for the current cursor position or the first paragraph of the selected text.
Returns
getParagraphStyleByIndex()
getParagraphStyleByIndex(index): IParagraphStyle;
Returns the paragraph style by index.
Parameters
| Parameter | Type | Description |
|---|---|---|
index | number | paragraph index (from 0). |
Returns
setCharStyleForPosition()
setCharStyleForPosition(position, style): void;
Sets the character style by position.
Parameters
| Parameter | Type | Description |
|---|---|---|
position | IPositionInText | position in text. |
style | ICharStyle | expected character style. |
Returns
void
setCurrentCharStyle()
setCurrentCharStyle(style): void;
Sets the character style for the current cursor position or selected text.
Parameters
| Parameter | Type | Description |
|---|---|---|
style | ICharStyle | expected 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
| Parameter | Type | Description |
|---|---|---|
style | IParagraphStyle | expected 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
| Parameter | Type | Description |
|---|---|---|
index | number | paragraph index (from 0). |
style | IParagraphStyle | expected paragraph style. |
Returns
void
Remarks
only properties specified in the expected style are set.