mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-23 15:32:59 +02:00
docs: Experiment with using ts for showing API signature
This commit is contained in:
@@ -52,19 +52,22 @@ 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`
|
||||||
|
|
||||||
Get the matching ancestor above a location in the document.
|
|
||||||
|
|
||||||
Options: `{at?: Location, match?: NodeMatch, mode?: 'highest' | 'lowest', voids?: boolean}`
|
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
type Options = {
|
function Editor.above<T extends Ancestor>(
|
||||||
|
editor: Editor,
|
||||||
|
options?: {
|
||||||
at?: Location
|
at?: Location
|
||||||
match?: NodeMatch<T>
|
match?: NodeMatch<T>
|
||||||
mode?: 'highest' | 'lowest'
|
mode?: 'highest' | 'lowest'
|
||||||
voids?: boolean
|
voids?: boolean
|
||||||
}
|
}
|
||||||
|
) => NodeEntry<T> | undefined
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Get the matching ancestor above a location in the document.
|
||||||
|
|
||||||
|
Options: `{at?: Location, match?: NodeMatch, mode?: 'highest' | 'lowest', voids?: boolean}`
|
||||||
|
|
||||||
- `mode?`: If `lowest` (default), returns the lowest matching ancestor. If `highest`, returns the highest matching ancestor.
|
- `mode?`: If `lowest` (default), returns the lowest matching ancestor. If `highest`, returns the highest matching ancestor.
|
||||||
- `voids?`: If `false` (default), ignore void objects. If `true`, include `void` objects.
|
- `voids?`: If `false` (default), ignore void objects. If `true`, include `void` objects.
|
||||||
- `at?`: Where to start at which is `editor.selection` by default.
|
- `at?`: Where to start at which is `editor.selection` by default.
|
||||||
|
Reference in New Issue
Block a user