Skip to content

Commit

Permalink
Merge pull request #162 from Sozialarchiv/type-fix
Browse files Browse the repository at this point in the history
Type fixes, closes #155
  • Loading branch information
neSpecc authored Nov 11, 2024
2 parents 7dd3941 + 218a171 commit 5786dae
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions src/toolbox.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
import Popover from "./utils/popover";
import * as $ from "./utils/dom";
import { IconMenuSmall } from "@codexteam/icons";

/**
* @typedef {object} PopoverItem
* @property {string} label - button text
* @property {string} icon - button icon
* @property {boolean} confirmationRequired - if true, a confirmation state will be applied on the first click
* @property {function} hideIf - if provided, item will be hid, if this method returns true
* @property {function} onClick - click callback
*/

/**
* Toolbox is a menu for manipulation of rows/cols
*
Expand All @@ -14,11 +24,12 @@ export default class Toolbox {
/**
* Creates toolbox buttons and toolbox menus
*
* @param {object} api - Editor.js api
* @param {PopoverItem[]} items - Editor.js api
* @param {function} onOpen - callback fired when the Popover is opening
* @param {function} onClose - callback fired when the Popover is closing
* @param {string} [cssModifier] - the modifier for the Toolbox. Allows to add some specific styles.
* @param {Object} config
* @param {any} config.api - Editor.js api
* @param {PopoverItem[]} config.items - Editor.js api
* @param {function} config.onOpen - callback fired when the Popover is opening
* @param {function} config.onClose - callback fired when the Popover is closing
* @param {string} config.cssModifier - the modifier for the Toolbox. Allows to add some specific styles.
*/
constructor({ api, items, onOpen, onClose, cssModifier = "" }) {
this.api = api;
Expand Down

0 comments on commit 5786dae

Please sign in to comment.