1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-21 22:45:18 +02:00

update reference

This commit is contained in:
Ian Storm Taylor
2016-07-12 11:40:15 -07:00
parent 32e1f21a0b
commit 48be173b7b

View File

@@ -177,6 +177,26 @@ Since `Selection`s are immutable, all of the transforming methods return a new i
Change the selection's `isFocused` property to `false`. Change the selection's `isFocused` property to `false`.
### `extendBackward`
`extendBackward([n = 1: Number]) => Selection`
Decrease the selection's `focusOffset` by `n`, default to `1`.
### `extendForward`
`extendForward([n = 1: Number]) => Selection`
Increase the selection's `focusOffset` by `n`, default to `1`.
### `extendToEndOf`
`extendToEndOf(node: Node) => Selection`
Move the selection's `focusOffset` to the end of a `node`.
### `extendToStartOf`
`extendToStartOf(node: Node) => Selection`
Move the selection's `focusOffset` to the start of a `node`.
### `focus` ### `focus`
`focus() => Selection` `focus() => Selection`
@@ -187,11 +207,6 @@ Change the selection's `isFocused` property to `true`.
Move both of the selection's points to an edge, collapsing it. Where `{Edge}` can be one of: `Anchor`, `Focus`, `Start` or `End`. Move both of the selection's points to an edge, collapsing it. Where `{Edge}` can be one of: `Anchor`, `Focus`, `Start` or `End`.
### `moveToStartOf`
`moveToStartOf(node: Node) => Selection`
Move both of the selection's points to the start of a `node`.
### `moveToEndOf` ### `moveToEndOf`
`moveToEndOf(node: Node) => Selection` `moveToEndOf(node: Node) => Selection`
@@ -202,32 +217,17 @@ Move both of the selection's points to the end of a `node`.
Move the selection's anchor point to the start of a `node`, and its focus point to the end of the same `node`. Move the selection's anchor point to the start of a `node`, and its focus point to the end of the same `node`.
### `moveForward` ### `moveToStartOf`
`moveForward([n = 1: Number]) => Selection` `moveToStartOf(node: Node) => Selection`
Increase the selection's `anchorOffset` and `focusOffset` by `n`, defaulting to `1`. Move both of the selection's points to the start of a `node`.
### `moveBackward` ### `moveBackward`
`moveBackward([n = 1: Number]) => Selection` `moveBackward([n = 1: Number]) => Selection`
Decrease the selection's `anchorOffset` and `focusOffset` by `n`, defaulting to `1`. Decrease the selection's `anchorOffset` and `focusOffset` by `n`, defaulting to `1`.
### `extendForward` ### `moveForward`
`extendForward([n = 1: Number]) => Selection` `moveForward([n = 1: Number]) => Selection`
Increase the selection's `focusOffset` by `n`, default to `1`. Increase the selection's `anchorOffset` and `focusOffset` by `n`, defaulting to `1`.
### `extendBackward`
`extendBackward([n = 1: Number]) => Selection`
Decrease the selection's `focusOffset` by `n`, default to `1`.
### `extendToStartOf`
`extendToStartOf(node: Node) => Selection`
Move the selection's `focusOffset` to the start of a `node`.
### `extendToEndOf`
`extendToEndOf(node: Node) => Selection`
Move the selection's `focusOffset` to the end of a `node`.