Stay organized with collections
Save and categorize content based on your preferences.
blockly > IConnectionChecker
IConnectionChecker interface
Class for connection type checking logic.
Signature:
export interface IConnectionChecker
Methods
Method |
Description |
canConnect(a, b, isDragging, opt_distance) |
Check whether the current connection can connect with the target connection. |
canConnectWithReason(a, b, isDragging, opt_distance) |
Checks whether the current connection can connect with the target connection, and return an error code if there are problems. |
doDragChecks(a, b, distance) |
Check whether this connection can be made by dragging. |
doSafetyChecks(a, b) |
Check that connecting the given connections is safe, meaning that it would not break any of Blockly's basic assumptions (e.g. no self connections). |
doTypeChecks(a, b) |
Check whether this connection is compatible with another connection with respect to the value type system. E.g. square_root("Hello") is not compatible. |
getErrorMessage(errorCode, a, b) |
Helper method that translates a connection error code into a string. |
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 2024-09-18 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 2024-09-18 UTC."],[[["The `IConnectionChecker` interface defines the logic for validating connections between blocks in Blockly."],["It provides methods to check connection compatibility, including type checks, safety checks, and drag checks."],["`IConnectionChecker` helps ensure that connections adhere to Blockly's rules and prevent invalid block configurations."],["Developers can use `IConnectionChecker` methods to determine if two connections can be connected and understand the reasons for any connection failures."]]],[]]