UNPKG

@blockly/block-shareable-procedures

Version:
41 lines 1.34 kB
/** * @license * Copyright 2022 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import * as Blockly from 'blockly/core'; import { ProcedureBase, ProcedureBaseJson } from './events_procedure_base'; /** * Notifies listeners that a procedure data model has been created. */ export declare class ProcedureCreate extends ProcedureBase { static readonly TYPE = "procedure_create"; /** A string used to check the type of the event. */ type: string; /** * Replays the event in the workspace. * * @param forward if true, play the event forward (redo), otherwise play it * backward (undo). */ run(forward: boolean): void; /** * Encode the event as JSON. * * @returns JSON representation. */ toJson(): ProcedureCreateJson; /** * Deserializes the JSON event. * * @param json The JSON representation of a procedure create event. * @param workspace The workspace to deserialize the event into. * @returns The new procedure create event. * @internal */ static fromJson(json: ProcedureCreateJson, workspace: Blockly.Workspace): ProcedureCreate; } export interface ProcedureCreateJson extends ProcedureBaseJson { procedure: Blockly.serialization.procedures.State; } //# sourceMappingURL=events_procedure_create.d.ts.map