blockly > Workspace > getVariablesOfType

Workspace.getVariablesOfType() method

v12: use Blockly.Workspace.getVariableMap().getVariablesOfType.

Find the variable with the specified type. If type is null, return list of variables with empty string type.

Signature:

getVariablesOfType(type: string | null): IVariableModel<IVariableState>[];

Parameters

Parameter Type Description
type string | null Type of the variables to find.

Returns:

IVariableModel<IVariableState>[]

The sought after variables of the passed in type. An empty array if none are found.