Skip to content

Commit b5246a2

Browse files
committed
Lexical API: Updated docs to align method format
1 parent ab4b1c8 commit b5246a2

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

dev/docs/wysiwyg-js-api.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ Other elements may be accessible but are not designed to be used directly, and t
1414
without notice.
1515
Stable parts of the API may still change where needed, but such changes would be noted as part of BookStack update advisories.
1616

17+
The methods shown here are documented using standard TypeScript notation.
18+
1719
## Overview
1820

1921
The API is provided as an object, which itself provides a number of modules
@@ -32,7 +34,7 @@ This module provides methods related to the UI of the editor, like buttons and t
3234

3335
### Methods
3436

35-
#### createButton(options: object)
37+
#### createButton(options: object): EditorApiButton
3638

3739
Creates a new button which can be used by other methods.
3840
This takes an option object with the following properties:
@@ -55,7 +57,7 @@ const button = api.ui.createButton({
5557
});
5658
```
5759

58-
### getMainToolbar()
60+
### getMainToolbar(): EditorApiToolbar
5961

6062
Get the main editor toolbar. This is typically the toolbar at the top of the editor.
6163
The function returns an [EditorApiToolbar](#editorapitoolbar) object, or null if no toolbar is found.
@@ -73,7 +75,6 @@ if (sections.length > 0) {
7375
### Types
7476
7577
These are types which may be provided from UI module methods.
76-
The methods on these types are documented using standard TypeScript notation.
7778
7879
#### EditorApiButton
7980
@@ -106,7 +107,7 @@ This module provides methods related to the live user content being edited withi
106107
107108
### Methods
108109
109-
#### insertHtml(html, position)
110+
#### insertHtml(html: string, position: string = 'selection'): void
110111
111112
Inserts the given HTML string at the given position string.
112113
The position, if not provided, will default to `'selection'`, replacing any existing selected content (or inserting at the selection if there's no active selection range).

0 commit comments

Comments
 (0)