From e2ae33043a2881c48822cf980fc65da2a030844b Mon Sep 17 00:00:00 2001 From: Sunny Hirai Date: Sun, 6 Jun 2021 17:50:49 -0700 Subject: [PATCH] docs: Experiment with alternate options documentation format --- docs/api/nodes/editor.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/docs/api/nodes/editor.md b/docs/api/nodes/editor.md index 93b6b7941..d06f8e1fe 100644 --- a/docs/api/nodes/editor.md +++ b/docs/api/nodes/editor.md @@ -52,10 +52,24 @@ Creates a new, empty `Editor` object. #### `Editor.above(editor: Editor, options?) => NodeEntry | undefined` -Get the 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}` +```ts +type 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. +- `voids?`: If `false` (default), ignore void objects. If `true`, include `void` objects. +- `at?`: Where to start at which is `editor.selection` by default. +- `match?`: Narrow the match + #### `Editor.after(editor: Editor, at: Location, options?) => Point | undefined` Get the point after a location.