Selection
Defined in: uzumaki.d.ts:503
Live view of a window’s text selection. Read endpoints through anchor /
focus; mutate via collapse, extend, setBaseAndExtent, or empty.
Programmatic mutations emit selectionchange on the window.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Selection():
Selection
Returns
Section titled “Returns”Selection
Accessors
Section titled “Accessors”anchor
Section titled “anchor”Get Signature
Section titled “Get Signature”get anchor():
UzSelectionEndpoint|null
Defined in: uzumaki.d.ts:508
Returns
Section titled “Returns”UzSelectionEndpoint | null
Get Signature
Section titled “Get Signature”get focus():
UzSelectionEndpoint|null
Defined in: uzumaki.d.ts:509
Returns
Section titled “Returns”UzSelectionEndpoint | null
isActive
Section titled “isActive”Get Signature
Section titled “Get Signature”get isActive():
boolean
Defined in: uzumaki.d.ts:506
Returns
Section titled “Returns”boolean
isCollapsed
Section titled “isCollapsed”Get Signature
Section titled “Get Signature”get isCollapsed():
boolean
Defined in: uzumaki.d.ts:507
Returns
Section titled “Returns”boolean
Get Signature
Section titled “Get Signature”get text():
string
Defined in: uzumaki.d.ts:510
Returns
Section titled “Returns”string
Methods
Section titled “Methods”collapse()
Section titled “collapse()”collapse(
node,offset):void
Defined in: uzumaki.d.ts:511
Parameters
Section titled “Parameters”offset
Section titled “offset”number
Returns
Section titled “Returns”void
empty()
Section titled “empty()”empty():
void
Defined in: uzumaki.d.ts:514
Returns
Section titled “Returns”void
extend()
Section titled “extend()”extend(
node,offset):void
Defined in: uzumaki.d.ts:512
Parameters
Section titled “Parameters”offset
Section titled “offset”number
Returns
Section titled “Returns”void
getRange()
Section titled “getRange()”getRange():
Range|null
Defined in: uzumaki.d.ts:524
Snapshot the current selection as a detached Range. Returns null
when there is no active selection.
Returns
Section titled “Returns”Range | null
selectAll()
Section titled “selectAll()”selectAll(
container):void
Defined in: uzumaki.d.ts:519
Replace the selection with all text inside container. Equivalent to
setRange(window.createRange().selectNodeContents(container)).
Parameters
Section titled “Parameters”container
Section titled “container”Returns
Section titled “Returns”void
set(
anchor,focus?):void
Defined in: uzumaki.d.ts:513
Parameters
Section titled “Parameters”anchor
Section titled “anchor”UzSelectionEndpointInit
focus?
Section titled “focus?”UzSelectionEndpointInit
Returns
Section titled “Returns”void
setRange()
Section titled “setRange()”setRange(
range):void
Defined in: uzumaki.d.ts:529
Apply a Range as the active selection. The range’s start becomes the
anchor and the end becomes the focus.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void