Files
blockly/core/interfaces/i_toolbox_item.ts
Maribeth Bottorff 49f87fba79 chore: enable linting ts files (#6351)
* chore: initial setup for linting ts

* chore: Temporarily disable most of the rules causing problems

* chore: fix autofixable problems.

* chore: ignore the last few files and rules

* chore: fix remaining lint errors

* chore: fix more small lint

* chore: run original rules on js files, new ts rules on ts files

* chore: use jsdoc style return in js files

* chore: add lint fix script

* chore: fix prefer-spread lint

* chore: fix no-invalid-this rule

* chore: fix no-unused-vars

* chore: fix trashcan lint
2022-08-16 13:59:15 -07:00

85 lines
1.9 KiB
TypeScript

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