/** * @license * Copyright 2011 Google LLC * SPDX-License-Identifier: Apache-2.0 */ /** * @file ToolboxSearch class for Blockly * @author dev@varwin.com (Varwin Developers) * * @class */ import * as Blockly from '../blockly.js'; import * as toolbox from "../utils/toolbox"; import * as browserEvents from '../browser_events.js'; /** * Class for toolbox search. */ export declare class ToolboxSearch implements Blockly.IComponent { private readonly workspace_; private toolbox_; private initialToolboxDef_; id: string; private htmlDiv_; private inputElement_; /** * Array holding info needed to unbind event handlers. * Used for disposing. * Ex: [[node, name, func], [node, name, func]]. */ protected boundEvents_: browserEvents.Data[]; /** * Class for toolbox search. * * @param {!Blockly.WorkspaceSvg} workspace The workspace where toolbox sits in. * @param {!Blockly.Toolbox} toolbox The toolbox to search in. * @param {!Blockly.utils.toolbox.ToolboxInfo} toolboxDef_ The toolbox definition. */ constructor(workspace: Blockly.WorkspaceSvg, toolbox: Blockly.Toolbox, toolboxDef_: toolbox.ToolboxInfo); /** * Initializes the workspace search bar. */ init(): void; /** * Disposes of workspace search. * Unlink from all DOM elements and remove all event listeners * to prevent memory leaks. */ dispose(): void; resize(width: number): void; /** * Creates and injects the search bar's DOM. * * @protected */ protected createDom_(): void; /** * Helper method for adding an event. * * @param {!Element} node Node upon which to listen. * @param {string} name Event name to listen to (e.g. 'mousedown'). * @param {object} thisObject The value of 'this' in the function. * @param {Function} func Function to call when event is triggered. * @private */ private addEvent_; /** * Creates the text input for the search bar. * * @returns {!HTMLInputElement} A text input for the search bar. * @protected */ protected createSearchInput_(): HTMLInputElement; /** * Handles input value change in search bar. * * @private */ private onInput_; /** * A search blocks in toolbox definition tree function * * @param {string} searchString string */ searchBlocks(searchString: string): void; emulateClick(target: HTMLElement): void; /** * Sets the initial toolbox definition. * * @param {!Blockly.utils.toolbox.ToolboxInfo} def The toolbox definition. */ setInitialToolboxDef(def: Blockly.utils.toolbox.ToolboxInfo): void; searchToolboxDefinition(item: any, searchString: string, searchWorkspace: Blockly.Workspace): any; getBlockSearchString(block: Blockly.Block): string; } //# sourceMappingURL=toolbox_search.d.ts.map