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.