Selection
import { Selection } from 'slate'The user's current selection in a Slate Document. Selections implement the Range interface, but also expose data about the current "focus" and the cursor current marks.
Properties
Selection({
anchor: Point,
focus: Point,
isFocused: Boolean,
marks: Set,
})isFocused
isFocusedBoolean
Whether the range currently has focus.
marks
marksSet
A set of marks associated with the range.
object
objectString
A string with a value of 'selection'.
Computed Properties
isBlurred
isBlurredBoolean
The opposite of isFocused, for convenience.
Static Methods
Selection.create
Selection.createSelection.create(properties: Object) => Selection
Create a new Selection instance with properties.
Selection.createProperties
Selection.createPropertiesSelection.createProperties(object: Object|Selection) => Object
Create a new dictionary of range properties from an object.
Selection.fromJSON
Selection.fromJSONSelection.fromJSON(object: Object) => Selection
Create a range from a JSON object.
Selection.isSelection
Selection.isSelectionSelection.isSelection(value: Any) => Boolean
Check whether a value is a Selection.
Instance Methods
toJSON
toJSONtoJSON() => Object
Return a JSON representation of the range.
Mutating Methods
setIsFocused
setIsFocusedsetIsFocused(isFocused: Boolean) => Selection
Return a new range with a new isFocused value.
setMarks
setMarkssetMarks(marks: Set|Null) => Selection
Return a new range with a new set of marks.
Last updated