Interface ISelectionHandler
Handler for performing simple operations with text selection.
Package: @aurigma/design-atoms-text
Properties
selectionChangeEvent
Text selection change event.
Declaration
selectionChangeEvent: EventObject<ITextRange | null>;Property Value
| Type | Description | 
|---|---|
| EventObject<ITextRange | null> | Text selection change event. | 
Remarks
reports the currently selected text.
Methods
getSelectionRange()
Returns the currently selected text range.
Declaration
getSelectionRange(): ITextRange | null;Returns
| Type | Description | 
|---|---|
| ITextRange | null | 
resetSelection(position)
Resets the selection of text and sets the anchor to a new position.
Declaration
resetSelection(position?: IPositionInText): void;Parameters
| Type | Name | Description | 
|---|---|---|
| IPositionInText | position | new position in the text. | 
Returns
| Type | Description | 
|---|---|
| void | 
Remarks
if position is null then anchor is set to null.
setSelectionByPoints(startPoint, endPoint)
Sets the selection of text by starting and ending points.
Declaration
setSelectionByPoints(startPoint: IPoint, endPoint: IPoint): void;Parameters
| Type | Name | Description | 
|---|---|---|
| IPoint | startPoint | starting point. | 
| IPoint | endPoint | ending point. | 
Returns
| Type | Description | 
|---|---|
| void | 
setSelectionByPositions(startPosition, endPosition)
Sets the selection of text by starting and ending positions.
Declaration
setSelectionByPositions(startPosition: IPositionInText, endPosition: IPositionInText): void;Parameters
| Type | Name | Description | 
|---|---|---|
| IPositionInText | startPosition | starting position. | 
| IPositionInText | endPosition | ending position. | 
Returns
| Type | Description | 
|---|---|
| void | 
setSelectionByRange(selection)
Sets the selection of text by a range.
Declaration
setSelectionByRange(selection: ITextRange): void;Parameters
| Type | Name | Description | 
|---|---|---|
| ITextRange | selection | start position in text. | 
Returns
| Type | Description | 
|---|---|
| void | 
setSelectionToPosition(position)
Sets the selection of text to a position relative to the anchor.
Declaration
setSelectionToPosition(position: IPositionInText): void;Parameters
| Type | Name | Description | 
|---|---|---|
| IPositionInText | position | new position in the text. | 
Returns
| Type | Description | 
|---|---|
| void |