Files
blockly/core/interfaces/i_procedure_model.ts
Maribeth Bottorff 88ff901a72 chore: use prettier instead of clang-format (#7014)
* chore: add and configure prettier

* chore: remove clang-format

* chore: remove clang-format config

* chore: lint additional ts files

* chore: fix lint errors in blocks

* chore: add prettier-ignore where needed

* chore: ignore js blocks when formatting

* chore: fix playground html syntax

* chore: fix yaml spacing from merge

* chore: convert text blocks to use arrow functions

* chore: format everything with prettier

* chore: fix lint unused imports in blocks
2023-05-10 16:01:39 -07:00

64 lines
1.7 KiB
TypeScript

/**
* @license
* Copyright 2022 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import {IParameterModel} from './i_parameter_model.js';
/**
* A data model for a procedure.
*/
export interface IProcedureModel {
/** Sets the human-readable name of the procedure. */
setName(name: string): this;
/**
* Inserts a parameter into the list of parameters.
*
* To move a parameter, first delete it, and then re-insert.
*/
insertParameter(parameterModel: IParameterModel, index: number): this;
/** Removes the parameter at the given index from the parameter list. */
deleteParameter(index: number): this;
/**
* Sets the return type(s) of the procedure.
*
* Pass null to represent a procedure that does not return.
*/
setReturnTypes(types: string[] | null): this;
/**
* Sets whether this procedure is enabled/disabled. If a procedure is disabled
* all procedure caller blocks should be disabled as well.
*/
setEnabled(enabled: boolean): this;
/** Returns the unique language-neutral ID for the procedure. */
getId(): string;
/** Returns the human-readable name of the procedure. */
getName(): string;
/** Returns the parameter at the given index in the parameter list. */
getParameter(index: number): IParameterModel;
/** Returns an array of all of the parameters in the parameter list. */
getParameters(): IParameterModel[];
/**
* Returns the return type(s) of the procedure.
*
* Null represents a procedure that does not return a value.
*/
getReturnTypes(): string[] | null;
/**
* Returns whether the procedure is enabled/disabled. If a procedure is
* disabled, all procedure caller blocks should be disabled as well.
*/
getEnabled(): boolean;
}