Stay organized with collections
Save and categorize content based on your preferences.
blockly > Connection
Connection class
Class for a connection between blocks.
Signature:
export declare class Connection
Constructors
Properties
Methods
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-05-16 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-05-16 UTC."],[[["The `Connection` class in Blockly manages connections between blocks, enabling them to link and interact."],["It provides methods for connecting, disconnecting, and checking compatibility between connections."],["Connections have properties like `type` and `targetConnection` to define their role and relationships."],["`Connection` includes functionality for managing shadow blocks, which provide placeholders or default values."],["Developers can use methods like `getCheck`, `setCheck`, and `isConnected` to control and query connection states."]]],["The `Connection` class manages connections between blocks. Key actions include: connecting (`connect`, `connect_`), disconnecting (`disconnect`, `disconnectInternal`) and reconnecting blocks (`reconnect`). It manages connection compatibility (`getCheck`, `setCheck`), determines connection status (`isConnected`, `isSuperior`), and provides methods to manage shadow blocks (`getShadowDom`, `setShadowDom`, `respawnShadow_`). The class also defines constants for connection compatibility checks, providing reason codes. Methods exist to get block targets (`targetBlock`, `getSourceBlock`).\n"]]