@blockly/block-shareable-procedures
Version:
A plugin that adds procedure blocks which are backed by explicit data models.
52 lines • 2.02 kB
TypeScript
/**
* @license
* Copyright 2022 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import * as Blockly from 'blockly/core';
import { ProcedureParameterBase, ProcedureParameterBaseJson } from './events_procedure_parameter_base';
/**
* Notifies listeners that a parameter has been removed from a procedure.
*/
export declare class ProcedureParameterDelete extends ProcedureParameterBase {
readonly index: number;
static readonly TYPE = "procedure_parameter_delete";
/** A string used to check the type of the event. */
type: string;
/**
* Constructs the procedure parameter delete event.
*
* @param workspace The workspace this event is associated with.
* @param procedure The procedure model this event is associated with.
* @param parameter The parameter model that was just removed from the
* procedure.
* @param index The index the parameter was at before it was removed.
*/
constructor(workspace: Blockly.Workspace, procedure: Blockly.procedures.IProcedureModel, parameter: Blockly.procedures.IParameterModel, index: number);
/**
* 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(): ProcedureParameterDeleteJson;
/**
* Deserializes the JSON event.
*
* @param json The JSON representation of a procedure parameter delete event.
* @param workspace The workspace to deserialize the event into.
* @returns The new procedure parameter delete event.
* @internal
*/
static fromJson(json: ProcedureParameterDeleteJson, workspace: Blockly.Workspace): ProcedureParameterDelete;
}
export interface ProcedureParameterDeleteJson extends ProcedureParameterBaseJson {
index: number;
}
//# sourceMappingURL=events_procedure_parameter_delete.d.ts.map