feat: trigger updates to IProcedureBlock blocks (#6570)

* 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
This commit is contained in:
Beka Westberg
2022-10-25 08:56:13 -07:00
committed by GitHub
parent 7ffe1fa89f
commit c9ced48de2
6 changed files with 60 additions and 6 deletions

View File

@@ -0,0 +1,19 @@
/**
* @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;
}