Class for a connection between blocks that may be rendered on screen.
Has this connection been disposed of?
Connection this connection connects to. Null if not connected.
Horizontal location of this connection.
Vertical location of this connection.
Move the block(s) belonging to the connection to a point where they don't visually interfere with the specified connection.
The connection to move away from.
Checks whether the current connection can connect with the target connection.
Connection to check compatibility with.
Blockly.Connection.CAN_CONNECT if the connection is legal, an error code otherwise.
Checks whether the current connection and target connection are compatible and throws an exception if they are not.
The connection to check compatibility with.
Is this connection compatible with another connection with respect to the value type system. E.g. square_root("Hello") is not compatible.
Connection to compare against.
True if the connections share a type.
Find the closest compatible connection to this connection. All parameters are in workspace units.
The maximum radius to another connection.
Offset between this connection's location in the database and the current location (as a result of dragging).
Contains two properties: 'connection' which is either another connection or null, and 'radius' which is the distance.
Connect this connection to another connection.
Connection to connect to.
Disconnect this connection.
Returns the distance between this connection and another connection in workspace units.
The other connection to measure the distance to.
The distance between connections, in workspace units.
Get a connection's compatibility.
List of compatible value types. Null if all types are compatible.
Get the workspace's connection type checker object.
The connection type checker for the source block's workspace.
Get the offset of this connection relative to the top left of its block.
The offset of the connection.
Get the parent input of a connection.
The input that the connection belongs to or null if no parent exists.
Returns the xml representation of the connection's shadow block.
OptionalreturnCurrent: booleanIf true, and the shadow block is currently attached to this connection, this serializes the state of that block and returns it (so that field values are correct). Otherwise the saved shadowDom is just returned.
Shadow DOM representation of a block or null.
Add highlighting around this connection.
Is the connection connected?
True if connection is connected to another connection.
Check if the two connections can be dragged to connect to each other.
A nearby connection to check.
OptionalmaxRadius: numberThe maximum radius allowed for connections, in workspace units.
True if the connection is allowed, false otherwise.
Does the connection belong to a superior block (higher in the source stack)?
True if connection faces down or right.
Change the connection's coordinates.
Change to x coordinate, in workspace units.
Change to y coordinate, in workspace units.
Change the connection's coordinates.
New absolute x coordinate, in workspace coordinates.
New absolute y coordinate, in workspace coordinates.
Move this connection to the location given by its offset within the block and the location of the block's top left corner.
The location of the top left corner of the block, in workspace coordinates.
Find all nearby compatible connections to this connection. Type checking does not apply, since this function is used for bumping.
The maximum radius to another connection, in workspace units.
List of connections.
Behavior after a connection attempt fails. Bumps this connection away from the other connection. Called when an attempted connection fails.
Connection that this connection failed to connect to.
Change a connection's compatibility.
Compatible value type or list of value types. Null if all types are compatible.
The connection being modified (to allow chaining).
Set the offset of this connection relative to the top left of its block.
The new relative x, in workspace units.
The new relative y, in workspace units.
Changes the connection's shadow block.
DOM representation of a block or null.
This method returns a string describing this Connection in developer terms (English only). Intended to on be used in console logs and errors.
The description.
Remove the highlighting around this connection.
Fake class which should be extended to avoid inheriting static properties