Interface IStyleHandler
Handler for performing simple operations with paragraph and character styles.
Package: @aurigma/design-atoms-text
Properties
styleChangeEvent
Character or paragraph style change event.
Declaration
styleChangeEvent: EventObject<void>;Property Value
| Type | Description | 
|---|---|
| EventObject<void> | Character or paragraph style change event. | 
Methods
clearFormatForCurrentPosition()
Clears the character style for the current cursor position.
Declaration
clearFormatForCurrentPosition(): void;Returns
| Type | Description | 
|---|---|
| void | 
clearFormatForRange(range)
Clears the character style for the text range.
Declaration
clearFormatForRange(range: ITextRange): void;Parameters
| Type | Name | Description | 
|---|---|---|
| ITextRange | range | text range. | 
Returns
| Type | Description | 
|---|---|
| void | 
getCharStyleForCurrentPosition()
Returns the character style for the current cursor position.
Declaration
getCharStyleForCurrentPosition(): ICharStyle;Returns
| Type | Description | 
|---|---|
| ICharStyle | 
getCharStyleForPosition(position)
Returns the character style by position.
Declaration
getCharStyleForPosition(position: IPositionInText): ICharStyle;Parameters
| Type | Name | Description | 
|---|---|---|
| IPositionInText | position | position in text. | 
Returns
| Type | Description | 
|---|---|
| ICharStyle | 
getCharStyleForRange(range)
Returns the character style for a text range.
Declaration
getCharStyleForRange(range: ITextRange): ICharStyle | null;Parameters
| Type | Name | Description | 
|---|---|---|
| ITextRange | range | text range. | 
Returns
| Type | Description | 
|---|---|
| ICharStyle | null | 
getDefaultCharStyle()
Returns the default character style.
Declaration
getDefaultCharStyle(): ICharStyle;Returns
| Type | Description | 
|---|---|
| ICharStyle | 
getDefaultParagraphStyle()
Returns the default paragraph style.
Declaration
getDefaultParagraphStyle(): IParagraphStyle;Returns
| Type | Description | 
|---|---|
| IParagraphStyle | 
getParagraphStyleByIndex(index)
Returns the paragraph style by index.
Declaration
getParagraphStyleByIndex(index: number): IParagraphStyle;Parameters
| Type | Name | Description | 
|---|---|---|
| number | index | paragraph index (from 0). | 
Returns
| Type | Description | 
|---|---|
| IParagraphStyle | 
getParagraphStyleForCurrentPosition()
Returns the paragraph style for the current cursor position.
Declaration
getParagraphStyleForCurrentPosition(): IParagraphStyle;Returns
| Type | Description | 
|---|---|
| IParagraphStyle | 
getParagraphStyleForRange(range)
Returns the paragraph style for a text range.
Declaration
getParagraphStyleForRange(range: ITextRange): IParagraphStyle;Parameters
| Type | Name | Description | 
|---|---|---|
| ITextRange | range | text range. | 
Returns
| Type | Description | 
|---|---|
| IParagraphStyle | 
setCharStyleForCurrentPosition(style)
Sets the character style for the current cursor position (patch).
Declaration
setCharStyleForCurrentPosition(style: ICharStyle): void;Parameters
| Type | Name | Description | 
|---|---|---|
| ICharStyle | style | expected character style. | 
Returns
| Type | Description | 
|---|---|
| void | 
Remarks
Only those properties that are specified in expected style are set.
setCharStyleForPosition(position, style)
Sets the character style by position.
Declaration
setCharStyleForPosition(position: IPositionInText, style: ICharStyle): void;Parameters
| Type | Name | Description | 
|---|---|---|
| IPositionInText | position | position in text. | 
| ICharStyle | style | character style. | 
Returns
| Type | Description | 
|---|---|
| void | 
Remarks
Only those properties that are specified in expected style are set.
setCharStyleForRange(style, range)
Sets the character style for a text range (patch).
Declaration
setCharStyleForRange(style: ICharStyle, range: ITextRange): void;Parameters
| Type | Name | Description | 
|---|---|---|
| ICharStyle | style | character style. | 
| ITextRange | range | text range. | 
Returns
| Type | Description | 
|---|---|
| void | 
Remarks
Only those properties that are specified in expected style are set.
setDefaultCharStyle(style)
Sets the default character style.
Declaration
setDefaultCharStyle(style: ICharStyle): void;Parameters
| Type | Name | Description | 
|---|---|---|
| ICharStyle | style | character style. | 
Returns
| Type | Description | 
|---|---|
| void | 
setDefaultParagraphStyle(style)
Sets the default paragraph style.
Declaration
setDefaultParagraphStyle(style: IParagraphStyle): void;Parameters
| Type | Name | Description | 
|---|---|---|
| IParagraphStyle | style | paragraph style. | 
Returns
| Type | Description | 
|---|---|
| void | 
setParagraphStyleByIndex(index, style)
Sets the paragraph style for the current cursor position (patch).
Declaration
setParagraphStyleByIndex(index: number, style: IParagraphStyle): void;Parameters
| Type | Name | Description | 
|---|---|---|
| number | index | paragraph index (from 0). | 
| IParagraphStyle | style | expected paragraph style. | 
Returns
| Type | Description | 
|---|---|
| void | 
setParagraphStyleForCurrentPosition(style)
Sets the paragraph style for the current cursor position (patch).
Declaration
setParagraphStyleForCurrentPosition(style: IParagraphStyle): void;Parameters
| Type | Name | Description | 
|---|---|---|
| IParagraphStyle | style | expected paragraph style. | 
Returns
| Type | Description | 
|---|---|
| void | 
Remarks
Only those properties that are specified in expected style are set.
setParagraphStyleForRange(style, range)
Sets the paragraph style for a text range (patch).
Declaration
setParagraphStyleForRange(style: IParagraphStyle, range: ITextRange): void;Parameters
| Type | Name | Description | 
|---|---|---|
| IParagraphStyle | style | paragraph style. | 
| ITextRange | range | text range. | 
Returns
| Type | Description | 
|---|---|
| void | 
Remarks
Only those properties that are specified in expected style are set.