Files
blockly/core/interfaces/i_procedure_block.ts
Beka Westberg 5d20b62339 feat: procedure blocks update models (#6672)
* feat: procedure blocks have models

* feat: add updating the name of the model

* feat: add procedure defs updating the model enabled state

* feat: add procedure blocks updating parameters in the model

* fix: add disposing of the procedure model

* chore: updates test to check for identity of parameters

* chore: move statement handling into setStatement

* fix: make parameter IDs consistent

* chore: un-only tests

* chore: fixup tests

* chore: revert validator to use Procedures.rename

* chore: cleanup typo
2023-01-05 14:31:20 -08:00

22 lines
623 B
TypeScript

/**
* @license
* Copyright 2022 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import type {Block} from '../block.js';
import {IProcedureModel} from './i_procedure_model.js';
/** The interface for a block which models a procedure. */
export interface IProcedureBlock {
doProcedureUpdate(): void;
getProcedureModel(): IProcedureModel;
}
/** A type guard which checks if the given block is a procedure block. */
export function isProcedureBlock(block: Block|
IProcedureBlock): block is IProcedureBlock {
return (block as IProcedureBlock).doProcedureUpdate !== undefined;
}