Class for a workspace. This is a data structure that contains blocks. There is no UI, and can be created headlessly.
An object that encapsulates logic for safety, type, and dragging checks.
Set of databases for rapid lookup of connection locations.
Returns true if the workspace is currently in the process of a bulk clear.
Maximum number of undo events in stack. 0 turns off undo, Infinity sets
it to unlimited.
Returns true if the workspace is visible and false if it's headless.
When something in this workspace changes, call a function. Note that there may be a few recent events already on the stack. Thus the new change listener might be called with events that occurred a few milliseconds before the change listener was added.
Function to call.
Obsolete return value, ignore.
Adds a comment to the list of top comments.
comment to add.
Checks whether all value and statement inputs in the workspace are filled with blocks.
Optionalopt_shadowBlocksAreFilled: booleanAn optional argument controlling whether shadow blocks are counted as filled. Defaults to true.
True if all inputs are filled, false otherwise.
Dispose of all blocks and comments in workspace.
Clear the undo/redo stacks.
Create a variable with a given name, optional type, and optional ID.
The name of the variable. This must be unique across variables and procedures.
Optionalopt_type: stringThe type of the variable like 'int' or 'string'. Does not need to be unique. Field_variable can filter variables based on their type. This will default to '' which is a specific type.
Optionalopt_id: stringThe unique ID of the variable. This will default to a UUID.
The newly created variable.
Delete a variables by the passed in ID and all of its uses from this workspace. May prompt the user for confirmation.
ID of variable to delete.
Returns all variable names of all types.
List of all variable names of all types.
Find the comment on this workspace with the specified ID.
ID of comment to find.
The sought after comment, or null if not found.
Return the variable map that contains "potential" variables. These exist in the flyout but not in the workspace.
The potential variable map.
Finds the top-level comments and returns them. Comments are optionally sorted by position; top to bottom (with slight LTR or RTL bias).
Sort the list if true.
The top-level comment objects.
Find the variable by the given name and return it. Return null if not found.
The name to check for.
Optionalopt_type: stringThe type of the variable. If not provided it defaults to the empty string, which is a specific type.
The variable with the given name.
Find the variable by the given ID and return it. Return null if not found.
The ID to check for.
The variable with the given ID.
Find the variable with the specified type. If type is null, return list of variables with empty string type.
Type of the variables to find.
The sought after variables of the passed in type. An empty array if none are found.
Returns the horizontal offset of the workspace. Intended for LTR/RTL compatibility in XML. Not relevant for a headless workspace.
Width.
Checks if the workspace has any limits on the maximum number of blocks, or the maximum number of blocks of specific types.
True if it has block limits, false otherwise.
Check if there is remaining capacity for blocks of the given counts to be created. If the total number of blocks represented by the map is more than the total remaining capacity, it returns false. If a type count is more than the remaining capacity for that type, it returns false.
A map of types to counts (usually representing blocks to be created).
True if there is capacity for the given map, false otherwise.
The number of blocks that may be added to the workspace before reaching the maxBlocks.
Number of blocks left.
The number of blocks of the given type that may be added to the workspace before reaching the maxInstances allowed for that type.
Type of block to return capacity for.
Number of blocks of type left.
Stop listening for this workspace's changes.
Function to stop calling.
Removes a comment from the list of top comments.
comment to remove.
Rename a variable by updating its name in the variable map. Identify the variable to rename with the given ID.
ID of the variable to rename.
New variable name.
Set the map of all variables on the workspace.
The variable map.
Undo or redo the previous action.
False if undo, true if redo.
Fake class which should be extended to avoid inheriting static properties