From 614260f7714f7a45c4e76ea6a8a89afc4eec98d9 Mon Sep 17 00:00:00 2001 From: Sunny Hirai Date: Sun, 6 Jun 2021 17:53:21 -0700 Subject: [PATCH] docs: Experiment with using ts for showing API signature --- docs/api/nodes/editor.md | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/docs/api/nodes/editor.md b/docs/api/nodes/editor.md index d06f8e1fe..f9f1113ef 100644 --- a/docs/api/nodes/editor.md +++ b/docs/api/nodes/editor.md @@ -52,19 +52,22 @@ Creates a new, empty `Editor` object. #### `Editor.above(editor: Editor, options?) => NodeEntry | undefined` +```ts +function Editor.above( + editor: Editor, + options?: { + at?: Location + match?: NodeMatch + mode?: 'highest' | 'lowest' + voids?: boolean + } +) => NodeEntry | undefined +``` + 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.