Files
blockly/core/interfaces/i_procedure_block.ts
Christopher Allen ce22f42868 chore: Organise imports (#8527)
* chore(deps): Add pretter-plugin-organize-imports

* chore: Remove insignificant blank lines in import sections

  Since prettier-plugin-organize-imports sorts imports within
  sections separated by blank lines, but preserves the section
  divisions, remove any blank lines that are not dividing imports
  into meaningful sections.

  Do not remove blank lines separating side-effect-only imports
  from main imports.

* chore: Remove unneded eslint-disable directives

* chore: Organise imports
2024-08-15 03:16:14 +01:00

29 lines
825 B
TypeScript

/**
* @license
* Copyright 2022 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
// Former goog.module ID: Blockly.procedures.IProcedureBlock
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 {
getProcedureModel(): IProcedureModel;
doProcedureUpdate(): void;
isProcedureDef(): boolean;
}
/** 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).getProcedureModel !== undefined &&
(block as IProcedureBlock).doProcedureUpdate !== undefined &&
(block as IProcedureBlock).isProcedureDef !== undefined
);
}