1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-06 23:36:31 +02:00

Methods missed in upgrade 0.17 (#645)

This commit is contained in:
Anuj
2017-03-02 22:27:23 -08:00
committed by Ian Storm Taylor
parent b8543b537c
commit 5c3338782d

View File

@@ -43,9 +43,11 @@ Transform methods can either operate on the [`Document`](./document.md), the [`S
- [`collapseTo{Edge}Of{Direction}Text`](#collapsetoedgeofdirectiontext) - [`collapseTo{Edge}Of{Direction}Text`](#collapsetoedgeofdirectiontext)
- [`collapseTo{Edge}`](#collapsetoedge) - [`collapseTo{Edge}`](#collapsetoedge)
- [`extendTo{Edge}Of`](#extendtoedgeof) - [`extendTo{Edge}Of`](#extendtoedgeof)
- [`extend{Direction}`](#extenddirection) - [`extend`](#extend)
- [`flip`](#flip)
- [`focus`](#focus) - [`focus`](#focus)
- [`move`](#move) - [`move`](#move)
- [`move{Edge}`](#moveedge)
- [`moveOffsetsTo`](#moveoffsetsto) - [`moveOffsetsTo`](#moveoffsetsto)
- [`moveToRangeOf`](#movetorangeof) - [`moveToRangeOf`](#movetorangeof)
- [`select`](#select) - [`select`](#select)
@@ -262,16 +264,21 @@ Collapse the current selection to the `{Edge}` of the next [`Block`](./block.md)
Collapse the current selection to the `{Edge}` of the next [`Text`](./text.md) node in `{Direction}`. Where `{Edge}` is either `{Start}` or `{End}` and `{Direction}` is either `Next` or `Previous`. Collapse the current selection to the `{Edge}` of the next [`Text`](./text.md) node in `{Direction}`. Where `{Edge}` is either `{Start}` or `{End}` and `{Direction}` is either `Next` or `Previous`.
### `extend{Direction}` ### `extend`
`extend{Direction}(n: Number) => Transform` `extend(n: Number) => Transform`
Extend the current selection's points `n` characters in `{Direction}`. Where `{Direction}` is either `Backward` or `Forward`. Extend the current selection's points by `n` characters. `n` can be positive or negative to indicate direction.
### `extendTo{Edge}Of` ### `extendTo{Edge}Of`
`extendTo{Edge}Of(node: Node) => Transform` `extendTo{Edge}Of(node: Node) => Transform`
Extend the current selection to the `{Edge}` of a `node`. Where `{Edge}` is either `Start` or `End`. Extend the current selection to the `{Edge}` of a `node`. Where `{Edge}` is either `Start` or `End`.
### `flip`
`flip() => Transform`
Flip the selection.
### `focus` ### `focus`
`focus() => Transform` `focus() => Transform`
@@ -282,6 +289,11 @@ Focus the current selection.
Move the current selection's offsets by `n`. Move the current selection's offsets by `n`.
### `move{Edge}`
`move{Edge}(n: Number) => Transform`
Move the current selection's `edge` offset by `n`. `edge` can be one of `Start`, `End`.
### `moveOffsetsTo` ### `moveOffsetsTo`
`moveOffsetsTo(anchorOffset: Number, focusOffset: Number) => Transform` `moveOffsetsTo(anchorOffset: Number, focusOffset: Number) => Transform`