1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-29 09:59:48 +02:00

docs: Experiment with alternate Options syntax for documentation

This commit is contained in:
Sunny Hirai
2021-06-06 18:04:18 -07:00
parent 614260f771
commit 665b6c81ab

View File

@@ -52,26 +52,14 @@ Creates a new, empty `Editor` object.
#### `Editor.above<T extends Ancestor>(editor: Editor, options?) => NodeEntry<T> | undefined` #### `Editor.above<T extends Ancestor>(editor: Editor, options?) => NodeEntry<T> | undefined`
```ts
function Editor.above<T extends Ancestor>(
editor: Editor,
options?: {
at?: Location
match?: NodeMatch<T>
mode?: 'highest' | 'lowest'
voids?: boolean
}
) => NodeEntry<T> | undefined
```
Get the matching ancestor above a location in the document. Get the matching ancestor above a location in the document.
Options: `{at?: Location, match?: NodeMatch, mode?: 'highest' | 'lowest', voids?: boolean}` Options:
- `mode?`: If `lowest` (default), returns the lowest matching ancestor. If `highest`, returns the highest matching ancestor. - `at?: Location`: Where to start at which is `editor.selection` by default.
- `voids?`: If `false` (default), ignore void objects. If `true`, include `void` objects. - `match?: NodeMatch`: Narrow the match
- `at?`: Where to start at which is `editor.selection` by default. - `mode?: 'highest' | 'lowest'`: If `lowest` (default), returns the lowest matching ancestor. If `highest`, returns the highest matching ancestor.
- `match?`: Narrow the match - `voids?: boolean`: If `false` (default), ignore void objects. If `true`, include `void` objects.
#### `Editor.after(editor: Editor, at: Location, options?) => Point | undefined` #### `Editor.after(editor: Editor, at: Location, options?) => Point | undefined`