Stay organized with collections Save and categorize content based on your preferences.

blockly > ConnectionChecker

ConnectionChecker class

Class for connection type checking logic.

Signature:

export declare class ConnectionChecker implements IConnectionChecker 

Implements: IConnectionChecker

Methods

Method Modifiers Description
canConnect(a, b, isDragging, opt_distance) Check whether the current connection can connect with the target connection.
canConnectToPrevious_(a, b) protected Helper function for drag checking.
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.