Properties
collapseToEndabstract
#
Get a new selection at the end point of this one
- Source:
collapseToFromabstract
#
Get a new selection at the 'from' point of this one
- Source:
collapseToStartabstract
#
Get a new selection at the start point of this one
- Source:
collapseToToabstract
#
Get a new selection at the 'to' point of this one
- Source:
equalsabstract
#
Check if two selections are equal
- Source:
getCoveringRangeabstract
#
Get the covering linear range for this selection
- Source:
getDescriptionabstract
#
Get a textual description of this selection, for debugging purposes
- Source:
getRangesabstract
#
Get the content ranges for this selection
- Source:
isCollapsedabstract
#
Check if a selection is collapsed
- Source:
toJSONabstract
#
Get a JSON serialization of this selection
- Source:
translateByTransactionabstract
#
Apply translations from a transaction
- Source:
translateByTransactionWithAuthorabstract
#
Apply translations from a transaction, with bias depending on author ID comparison
- Source:
newFromHashabstractstatic
#
Create a new selection from a hash object
- Source:
Methods
getName() → {string}
#
Get the name of the selection type
- Source:
Returns:
Selection type name
- Type
- string
isNull() → {boolean}
#
Check if this selection is null
- Source:
Returns:
The selection is null
- Type
- boolean
translateByChange(change, authorId) → {ve.dm.Selection}
#
Apply translations from a change
Parameters:
Name | Type | Description |
---|---|---|
change |
ve.dm.Change | |
authorId |
number | The author ID of this selection |
- Source:
Returns:
A new translated selection
- Type
- ve.dm.Selection
translateByTransactions(txs, [excludeInsertion]) → {ve.dm.Selection}
#
Apply translations from a set of transactions
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
txs |
Array.<ve.dm.Transaction> | Transactions |
|
excludeInsertion |
boolean |
optional |
Do not grow to cover insertions at boundaries |
- Source:
Returns:
A new translated selection
- Type
- ve.dm.Selection
newFromJSON(json) → {ve.dm.Selection}static
#
Create a new selection from a JSON serialization
Parameters:
Name | Type | Description |
---|---|---|
json |
string | Object | JSON serialization or hash object |
- Source:
Returns:
New selection
- Type
- ve.dm.Selection
Throws:
-
Unknown selection type
- Type
- Error