UNPKG

@blockly/workspace-backpack

Version:
65 lines 1.91 kB
/** * @license * Copyright 2021 Google LLC * SPDX-License-Identifier: Apache-2.0 */ /** * @fileoverview UI events used for the backpack plugin. * @author kozbial@google.com (Monica Kozbial) */ import * as Blockly from 'blockly/core'; /** * Name of event that records a backpack open. */ export declare const backpackOpen = "backpack_open"; /** * A UI event representing a backpack opening or closing. */ export declare class BackpackOpen extends Blockly.Events.UiBase { isOpen?: boolean | undefined; /** * Type of this event. */ type: string; /** * Class for a backpack open event. * * @param isOpen Whether the backpack flyout is opening (false * if closing). Undefined for a blank event. * @param workspaceId The workspace identifier for this event. * Undefined for a blank event. */ constructor(isOpen?: boolean | undefined, workspaceId?: string); /** * Encode the event as JSON. * * @returns JSON representation. */ toJson(): BackpackOpenEventJson; /** * Decode the JSON event. * * @param json JSON representation. * @param workspace A workspace to create the event on. * @param event an instance of BackpackOpen to deserialize into. * @returns A newly deserialized BackpackOpen event. */ static fromJson(json: BackpackOpenEventJson, workspace: Blockly.Workspace, event: unknown): BackpackOpen; } export interface BackpackOpenEventJson extends Blockly.Events.AbstractEventJson { isOpen?: boolean; } /** * Name of event that records a backpack change. */ export declare const backpackChange = "backpack_change"; /** * A UI event representing a change in a backpack's contents. */ export declare class BackpackChange extends Blockly.Events.UiBase { /** * Type of this event. */ type: string; } //# sourceMappingURL=ui_events.d.ts.map