API
Location Types
Range
10min
range objects are a set of points that refer to a specific span of a slate document they can define a span inside a single node or they can span across multiple nodes the editor's selection is stored as a range interface range { anchor point focus point } range docid\ yslfk seeirgwt33aog5vrange docid\ yslfk seeirgwt33aog5vrange docid\ yslfk seeirgwt33aog5vrange docid\ yslfk seeirgwt33aog5v static methods retrieval methods range edges(range range, options?) \[point, point] get the start and end points of a range , in the order in which they appear in the document options {reverse? boolean} range end(range range) point get the end point of a range range intersection(range range, another range) range | null get the intersection of one range with another range points(range range) generator\<pointentry> iterate through all the point entries in a range range start(range range) point get the start point of a range check methods check some attribute of a range always returns a boolean range equals(range range, another range) boolean check if a range is exactly equal to another range includes(range range, target path | point | range) boolean check if a range includes a path, a point, or part of another range for clarity the definition of includes can mean partially includes another way to describe this is if one range intersectns the other range range isbackward(range range) boolean check if a range is backward, meaning that its anchor point appears after its focus point in the document range iscollapsed(range range) boolean check if a range is collapsed, meaning that both its anchor and focus points refer to the exact same position in the document range isexpanded(range range) boolean check if a range is expanded this is the opposite of range iscollapsed and is provided for legibility range isforward(range range) boolean check if a range is forward this is the opposite of range isbackward and is provided for legibility range isrange(value any) value is range check if a value implements the range interface transform methods range transform(range range, op operation, options) range | null transform a range by an op options {affinity 'forward' | 'backward' | 'outward' | 'inward' | null}
🤔
Have a question?
Our super-smart AI,knowledgeable support team and an awesome community will get you an answer in a flash.
To ask a question or participate in discussions, you'll need to authenticate first.