Skip to content

Commit 5786dae

Browse files
authored
Merge pull request #162 from Sozialarchiv/type-fix
Type fixes, closes #155
2 parents 7dd3941 + 218a171 commit 5786dae

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

src/toolbox.js

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
import Popover from "./utils/popover";
22
import * as $ from "./utils/dom";
33
import { IconMenuSmall } from "@codexteam/icons";
4+
5+
/**
6+
* @typedef {object} PopoverItem
7+
* @property {string} label - button text
8+
* @property {string} icon - button icon
9+
* @property {boolean} confirmationRequired - if true, a confirmation state will be applied on the first click
10+
* @property {function} hideIf - if provided, item will be hid, if this method returns true
11+
* @property {function} onClick - click callback
12+
*/
13+
414
/**
515
* Toolbox is a menu for manipulation of rows/cols
616
*
@@ -14,11 +24,12 @@ export default class Toolbox {
1424
/**
1525
* Creates toolbox buttons and toolbox menus
1626
*
17-
* @param {object} api - Editor.js api
18-
* @param {PopoverItem[]} items - Editor.js api
19-
* @param {function} onOpen - callback fired when the Popover is opening
20-
* @param {function} onClose - callback fired when the Popover is closing
21-
* @param {string} [cssModifier] - the modifier for the Toolbox. Allows to add some specific styles.
27+
* @param {Object} config
28+
* @param {any} config.api - Editor.js api
29+
* @param {PopoverItem[]} config.items - Editor.js api
30+
* @param {function} config.onOpen - callback fired when the Popover is opening
31+
* @param {function} config.onClose - callback fired when the Popover is closing
32+
* @param {string} config.cssModifier - the modifier for the Toolbox. Allows to add some specific styles.
2233
*/
2334
constructor({ api, items, onOpen, onClose, cssModifier = "" }) {
2435
this.api = api;

0 commit comments

Comments
 (0)