Files
blockly/core/interfaces/i_toolbox_item.ts
Maribeth Bottorff 037eb59b89 chore: Lint TsDoc. (#6353)
* chore: add linting for tsdoc

* chore: don't require types on return

* chore: remove redundant fileoverview from ts

* chore: change return to returns and add some newlines

* chore: remove license tag

* chore: don't require params/return docs

* chore: remove spurious struct tags

* Revert "chore: change return to returns and add some newlines"

This reverts commit d6d8656a45.

* chore: don't auto-add param names

* chore: disable require-param bc it breaks on this

* return to returns and add line breaks

* chore: configure additional jsdoc rules

* chore: run format

* Revert "chore: remove license tag"

This reverts commit 173455588a.

* chore: allow license tag format

* chore: only require jsdoc on exported items

* chore: add missing jsdoc or silence where needed

* chore: run format

* chore: lint fixes
2022-08-23 14:27:22 -07:00

91 lines
1.9 KiB
TypeScript

/**
* @license
* Copyright 2020 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
/**
* 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.
*
* @returns The div for the toolbox item.
*/
getDiv(): Element|null;
/**
* Gets a unique identifier for this toolbox item.
*
* @returns The ID for the toolbox item.
*/
getId(): string;
/**
* Gets the parent if the toolbox item is nested.
*
* @returns The parent toolbox item, or null if this toolbox item is not
* nested.
*/
getParent(): IToolboxItem|null;
/**
* Gets the nested level of the category.
*
* @returns The nested level of the category.
* @internal
*/
getLevel(): number;
/**
* Whether the toolbox item is selectable.
*
* @returns True if the toolbox item can be selected.
*/
isSelectable(): boolean;
/**
* Whether the toolbox item is collapsible.
*
* @returns 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.
*
* @returns 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;
}