mirror of
https://github.com/google/blockly.git
synced 2026-01-08 01:20:12 +01:00
* 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
22 lines
623 B
TypeScript
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;
|
|
}
|