Connection class
Class for a connection between blocks.
Signature:
export declare class Connection
Constructors
Constructor | Modifiers | Description |
|---|---|---|
Constructs a new instance of the |
Properties
Property | Modifiers | Type | Description |
|---|---|---|---|
| number | Constants for checking whether two connections are compatible. | |
string | The unique ID of this connection. | ||
| number | ||
| number | ||
| number | ||
| number | ||
| number | ||
| number | ||
| number | ||
| number | ||
| |||
Connection | null | Connection this connection connects to. Null if not connected. | ||
number |
Methods
Method | Modifiers | Description |
|---|---|---|
| Connect two connections together. This is the connection on the superior block. | |
Connect this connection to another connection. | ||
Disconnect this connection. | ||
| Disconnect two blocks that are connected by this connection. | |
Get a connection's compatibility. | ||
getConnectionForOrphanedConnection(startBlock, orphanConnection) |
| Returns the connection (starting at the startBlock) which will accept the given connection. This includes compatible connection types and connection checks. |
| Returns the parent connection (superior) and child connection (inferior) given this connection and the connection it is connected to. | |
Returns the xml representation of the connection's shadow block. | ||
Returns the serialized object representation of the connection's shadow block. | ||
Get the source block for this connection. | ||
Is the connection connected? | ||
Does the connection belong to a superior block (higher in the source stack)? | ||
| Function to be called when this connection's compatible types have changed. | |
Reconnects this connection to the input with the given name on the given block. If there is already a connection connected to that input, that connection is disconnected. | ||
| Respawn the shadow block if there was one connected to the this connection. | |
Change a connection's compatibility. | ||
Changes the connection's shadow block. | ||
Changes the connection's shadow block. | ||
Returns the block that this connection connects to. | ||
This method returns a string describing this Connection in developer terms (English only). Intended to on be used in console logs and errors. |