Expand all

abstract ve.dm.Selection

Constructor

new ve.dm.Selection()abstract #

Properties

collapseToEndabstract #

Get a new selection at the end point of this one

Source:
Get a new selection at the end point of this one

collapseToFromabstract #

Get a new selection at the 'from' point of this one

Source:
Get a new selection at the 'from' point of this one

collapseToStartabstract #

Get a new selection at the start point of this one

Source:
Get a new selection at the start point of this one

collapseToToabstract #

Get a new selection at the 'to' point of this one

Source:
Get a new selection at the 'to' point of this one

equalsabstract #

Check if two selections are equal

Source:
Check if two selections are equal

getCoveringRangeabstract #

Get the covering linear range for this selection

Source:
Get the covering linear range for this selection

getDescriptionabstract #

Get a textual description of this selection, for debugging purposes

Source:
Get a textual description of this selection, for debugging purposes

getRangesabstract #

Get the content ranges for this selection

Source:
Get the content ranges for this selection

isCollapsedabstract #

Check if a selection is collapsed

Source:
Check if a selection is collapsed

toJSONabstract #

Get a JSON serialization of this selection

Source:
Get a JSON serialization of this selection

translateByTransactionabstract #

Apply translations from a transaction

Source:
Apply translations from a transaction

translateByTransactionWithAuthorabstract #

Apply translations from a transaction, with bias depending on author ID comparison

Source:
Apply translations from a transaction, with bias depending on author ID comparison

newFromHashabstractstatic #

Create a new selection from a hash object

Source:
Create a new selection from a hash object

Methods

getName() → {string} #

Get the name of the selection type

Source:

Returns:

Selection type name

Type
string
Get the name of the selection type

isNull() → {boolean} #

Check if this selection is null

Source:

Returns:

The selection is null

Type
boolean
Check if this selection is null

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
Apply translations from a change

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
Apply translations from a set of transactions

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
Create a new selection from a JSON serialization