mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-09 16:56:36 +02:00
docs: Organize the Range docs into sections by type
This commit is contained in:
@@ -12,6 +12,14 @@ interface Range {
|
|||||||
|
|
||||||
## Static methods
|
## Static methods
|
||||||
|
|
||||||
|
- [Relationship methods](#relationship-methods)
|
||||||
|
- [Check methods](#check-methods)
|
||||||
|
- [Transform method](#transform-method)
|
||||||
|
|
||||||
|
### Relationship methods
|
||||||
|
|
||||||
|
Relationship of a Range like its start and end points and the intersection with another Range.
|
||||||
|
|
||||||
###### `Range.edges(range: Range, options?): [Point, Point]`
|
###### `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.
|
Get the start and end points of a `range`, in the order in which they appear in the document.
|
||||||
@@ -22,6 +30,22 @@ Options: `{reverse?: boolean}`
|
|||||||
|
|
||||||
Get the end point of a `range`.
|
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`
|
###### `Range.equals(range: Range, another: Range): boolean`
|
||||||
|
|
||||||
Check if a `range` is exactly equal to `another`.
|
Check if a `range` is exactly equal to `another`.
|
||||||
@@ -30,10 +54,6 @@ Check if a `range` is exactly equal to `another`.
|
|||||||
|
|
||||||
Check if a `range` includes a path, a point, or part of another range.
|
Check if a `range` includes a path, a point, or part of another range.
|
||||||
|
|
||||||
###### `Range.intersection(range: Range, another: Range): Range | null`
|
|
||||||
|
|
||||||
Get the intersection of one `range` with `another`.
|
|
||||||
|
|
||||||
###### `Range.isBackward(range: Range): boolean`
|
###### `Range.isBackward(range: Range): boolean`
|
||||||
|
|
||||||
Check if a `range` is backward, meaning that its anchor point appears _after_ its focus point in the document.
|
Check if a `range` is backward, meaning that its anchor point appears _after_ its focus point in the document.
|
||||||
@@ -54,13 +74,7 @@ Check if a `range` is forward. This is the opposite of `Range.isBackward` and is
|
|||||||
|
|
||||||
Check if a `value` implements the `Range` interface.
|
Check if a `value` implements the `Range` interface.
|
||||||
|
|
||||||
###### `Range.points(range: Range): Generator<PointEntry>`
|
### Transform methods
|
||||||
|
|
||||||
Iterate through all the point entries in a `range`.
|
|
||||||
|
|
||||||
###### `Range.start(range: Range): Point`
|
|
||||||
|
|
||||||
Get the start point of a `range`
|
|
||||||
|
|
||||||
###### `Range.transform(range: Range, op: Operation, options): Range | null`
|
###### `Range.transform(range: Range, op: Operation, options): Range | null`
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user