blockly > Procedures > IProcedureModel

Procedures.IProcedureModel interface

A data model for a procedure.

Signature:

export interface IProcedureModel 

Methods

Method Description
deleteParameter(index) Removes the parameter at the given index from the parameter list.
getEnabled() Returns whether the procedure is enabled/disabled. If a procedure is disabled, all procedure caller blocks should be disabled as well.
getId() Returns the unique language-neutral ID for the procedure.
getName() Returns the human-readable name of the procedure.
getParameter(index) Returns the parameter at the given index in the parameter list.
getParameters() Returns an array of all of the parameters in the parameter list.
getReturnTypes()

Returns the return type(s) of the procedure.

Null represents a procedure that does not return a value.

insertParameter(parameterModel, index)

Inserts a parameter into the list of parameters.

To move a parameter, first delete it, and then re-insert.

saveState() Serializes the state of the procedure to JSON.
setEnabled(enabled) Sets whether this procedure is enabled/disabled. If a procedure is disabled all procedure caller blocks should be disabled as well.
setName(name) Sets the human-readable name of the procedure.
setReturnTypes(types)

Sets the return type(s) of the procedure.

Pass null to represent a procedure that does not return.