Files
blockly/core/interfaces/i_toolbox_item.ts
Christopher Allen b0a7c004a9 refactor(build): Delete Closure Library (#7415)
* fix(build): Restore erroneously-deleted filter function

  This was deleted in PR #7406 as it was mainly being used to
  filter core/ vs. test/mocha/ deps into separate deps files -
  but it turns out also to be used for filtering error
  messages too.  Oops.

* refactor(tests): Migrate advanced compilation test to ES Modules

* refactor(build): Migrate main.js to TypeScript

  This turns out to be pretty straight forward, even if it would
  cause crashing if one actually tried to import this module
  instead of just feeding it to Closure Compiler.

* chore(build): Remove goog.declareModuleId calls

  Replace goog.declareModuleId calls with a comment recording the
  former module ID for posterity (or at least until we decide
  how to reformat the renamings file.

* chore(tests): Delete closure/goog/*

  For the moment we still need something to serve as base.js for
  the benefit of closure-make-deps, so we keep a vestigial
  base.js around, containing only the @provideGoog declaration.

* refactor(build): Remove vestigial base.js

  By changing slightly the command line arguments to
  closure-make-deps and closure-calculate-chunks the need to have
  any base.js is eliminated.

* chore: Typo fix for PR #7415
2023-08-31 00:24:47 +01:00

82 lines
1.7 KiB
TypeScript

/**
* @license
* Copyright 2020 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
// Former goog.module ID: Blockly.IToolboxItem
/**
* Interface for an item in the toolbox.
*/
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;
}