mirror of
https://github.com/google/blockly.git
synced 2026-01-17 05:47:10 +01:00
* feat: add interface and method for updating procedure blocks * chore: remove module ID declarations * feat: add actually triggering updates * chore: format * chore: clean up tests
20 lines
527 B
TypeScript
20 lines
527 B
TypeScript
/**
|
|
* @license
|
|
* Copyright 2022 Google LLC
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
import type {Block} from '../block.js';
|
|
|
|
|
|
/** The interface for a block which models a procedure. */
|
|
export interface IProcedureBlock {
|
|
doProcedureUpdate(): void;
|
|
}
|
|
|
|
/** 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;
|
|
}
|