Skip to content

Commit

Permalink
Type fixes, closes #155
Browse files Browse the repository at this point in the history
  • Loading branch information
Sozialarchiv committed Oct 1, 2024
1 parent dee45c8 commit 218a171
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@editorjs/table",
"description": "Table for Editor.js",
"version": "2.4.1",
"version": "2.4.2",
"license": "MIT",
"repository": "https://github.com/editor-js/table",
"files": [
Expand Down
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 218a171

Please sign in to comment.