Files
blockly/core/interfaces/i_toolbox_item.js
Rachel Fenichel daf78af13e fix!: fix or silence type errors (#6105)
* fix: add isBlockCreatable to IFlyout interface

* fix: add getClickTarget to IToolboxItem interface

* fix: fix some types in zelos renderer

* fix: add scrollToStart to IFlyout interface

* fix: add setVisible_ to IToolboxItem

* fix: use instanceof check for workspace comments in gesture code

* fix: data stored on the DOM for tooltips

* fix: use blockSvg to access icons

* fix: add instanceof check in shortcut_items.js

* fix: suppress warning about onKeyDown in tolbox

* fix: add instanceof check in workspace_svg

* fix: don't use dot accessor to avoid type problem

* fix: silence type errors in ast_node.js
2022-04-22 15:55:55 -07:00

101 lines
2.1 KiB
JavaScript

/**
* @license
* Copyright 2020 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
/**
* @fileoverview The interface for a toolbox item.
*/
'use strict';
/**
* The interface for a toolbox item.
* @namespace Blockly.IToolboxItem
*/
goog.module('Blockly.IToolboxItem');
/**
* Interface for an item in the toolbox.
* @interface
* @alias Blockly.IToolboxItem
*/
const IToolboxItem = function() {};
/**
* Initializes the toolbox item.
* This includes creating the DOM and updating the state of any items based
* on the info object.
* @return {void}
* @public
*/
IToolboxItem.prototype.init;
/**
* Gets the div for the toolbox item.
* @return {?Element} The div for the toolbox item.
* @public
*/
IToolboxItem.prototype.getDiv;
/**
* Gets a unique identifier for this toolbox item.
* @return {string} The ID for the toolbox item.
* @public
*/
IToolboxItem.prototype.getId;
/**
* Gets the parent if the toolbox item is nested.
* @return {?IToolboxItem} The parent toolbox item, or null if
* this toolbox item is not nested.
* @public
*/
IToolboxItem.prototype.getParent;
/**
* Gets the nested level of the category.
* @return {number} The nested level of the category.
* @package
*/
IToolboxItem.prototype.getLevel;
/**
* Whether the toolbox item is selectable.
* @return {boolean} True if the toolbox item can be selected.
* @public
*/
IToolboxItem.prototype.isSelectable;
/**
* Whether the toolbox item is collapsible.
* @return {boolean} True if the toolbox item is collapsible.
* @public
*/
IToolboxItem.prototype.isCollapsible;
/**
* Dispose of this toolbox item. No-op by default.
* @public
*/
IToolboxItem.prototype.dispose;
/**
* Gets the HTML element that is clickable.
* @return {?Element} The HTML element that receives clicks.
* @public
*/
IToolboxItem.prototype.getClickTarget;
/**
* Sets whether the category is visible or not.
* For a category to be visible its parent category must also be expanded.
* @param {boolean} isVisible True if category should be visible.
* @protected
*/
IToolboxItem.prototype.setVisible_;
exports.IToolboxItem = IToolboxItem;