1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-17 12:41:44 +02:00

remove non-transform transforming methods from reference

This commit is contained in:
Ian Storm Taylor
2016-07-24 18:03:36 -07:00
parent d90c982a37
commit c7fac3456e
2 changed files with 4 additions and 106 deletions

View File

@@ -9,7 +9,7 @@
- [`kind`](#kind)
- [`length`](#length)
- [`text`](#text)
- [Retrieval Methods](#retrieval-methods)
- [Methods](#methods)
- [`filterDescendants`](#filterdescendants)
- [`findDescendant`](#finddescendant)
- [`getBlocksAtRange`](#getblockatrange)
@@ -35,10 +35,6 @@
- [`getTextsAtRange`](#gettextsatrange)
- [`hasChild`](#haschild)
- [`hasDescendant`](#hasdescendant)
- [Transform Methods](#transform-methods)
- [`mapDescendants`](#mapdescendants)
- [`removeDescendant`](#removedescendant)
- [`updateDescendant`](#updatedescendant)
## Properties
@@ -67,7 +63,7 @@ The sum of the lengths of all of the descendant [`Text`](./text.md) nodes of thi
A concatenated string of all of the descendant [`Text`](./text.md) nodes of this node.
## Retrieval Methods
## Methods
### `filterDescendants`
`filterDescendants(iterator: Function) => List`
@@ -193,23 +189,3 @@ Check whether the node has a child node by `key`.
`hasDescendant(key: String || Node) => Boolean`
Check whether the node has a descendant node by `key`.
## Transform Methods
Since nodes are immutable, all of the transform methods return a new copy of the node in question.
### `mapDescendants`
`mapDescendants(iterator: Function) => Node`
Map all of the descendant nodes of a node through an `iterator` function.
### `removeDescendant`
`removeDescendant(key: String || Node) => Node`
Remove a descendant node from the tree by `key`.
### `updateDescendant`
`updateDescendant(node: Node) => Node`
Update a descendant `node` to the new value.

View File

@@ -29,26 +29,13 @@ Often times, you don't need to specifically know which point is the "anchor" and
- [`startOffset`](#startoffset)
- [Static Methods](#static-methods)
- [`Selection.create`](#selectioncreate)
- [Checking Methods](#checking-methods)
- [Methods](#checking-methods)
- [`has{Edge}AtEndOf`](#hasedgeatendof)
- [`has{Edge}AtStartOf`](#hasedgeatstartof)
- [`has{Edge}Between`](#hasedgebetween)
- [`has{Edge}In`](#hasedgein)
- [`isAtEndOf`](#isatendof)
- [`isAtStartOf`](#isatstartof)
- [Transforming Methods](#transforming-methods)
- [`blur`](blur)
- [`extendBackward`](#extendbackward)
- [`extendForward`](#extendforward)
- [`extendToEndOf`](#extendtoendof)
- [`extendToStartOf`](#extendtostartof)
- [`focus`](#focus)
- [`moveBackward`](#movebackward)
- [`moveForward`](#moveforward)
- [`moveToEndOf`](#movetoendof)
- [`moveToRangeOf`](#movetorangeof)
- [`moveToStartOf`](#movetostartof)
- [`moveTo{Edge}`](#movetoedge)
## Properties
@@ -135,7 +122,7 @@ A few convenience properties for accessing the first and last point of the selec
Create a new `Selection` instance with `properties`.
## Checking Methods
## Methods
### `has{Edge}AtStartOf`
`has{Edge}AtStartOf(node: Node) => Boolean`
@@ -166,68 +153,3 @@ Determine whether the selection is at the start of a `node`.
`isAtEndOf(node: Node) => Boolean`
Determine whether the selection is at the end of a `node`.
## Transforming Methods
Since `Selection`s are immutable, all of the transforming methods return a new instance of the selection.
### `blur`
`blur() => Selection`
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() => Selection`
Change the selection's `isFocused` property to `true`.
### `moveTo{Edge}`
`moveTo{Edge}() => Selection`
Move both of the selection's points to an edge, collapsing it. Where `{Edge}` can be one of: `Anchor`, `Focus`, `Start` or `End`.
### `moveToEndOf`
`moveToEndOf(node: Node) => Selection`
Move both of the selection's points to the end of a `node`.
### `moveToRangeOf`
`moveToRangeOf(node: Node) => Selection`
Move the selection's anchor point to the start of a `node`, and its focus point to the end of the same `node`.
### `moveToStartOf`
`moveToStartOf(node: Node) => Selection`
Move both of the selection's points to the start of a `node`.
### `moveBackward`
`moveBackward([n = 1: Number]) => Selection`
Decrease the selection's `anchorOffset` and `focusOffset` by `n`, defaulting to `1`.
### `moveForward`
`moveForward([n = 1: Number]) => Selection`
Increase the selection's `anchorOffset` and `focusOffset` by `n`, defaulting to `1`.