diff --git a/core/interfaces/i_connection_checker.js b/core/interfaces/i_connection_checker.js index 4b6120da1..527dec4c5 100644 --- a/core/interfaces/i_connection_checker.js +++ b/core/interfaces/i_connection_checker.js @@ -11,7 +11,8 @@ */ 'use strict'; -goog.provide('Blockly.IConnectionChecker'); +goog.module('Blockly.IConnectionChecker'); +goog.module.declareLegacyNamespace(); goog.requireType('Blockly.Connection'); goog.requireType('Blockly.RenderedConnection'); @@ -21,7 +22,7 @@ goog.requireType('Blockly.RenderedConnection'); * Class for connection type checking logic. * @interface */ -Blockly.IConnectionChecker = function() {}; +const IConnectionChecker = function() {}; /** * Check whether the current connection can connect with the target @@ -35,7 +36,7 @@ Blockly.IConnectionChecker = function() {}; * @return {boolean} Whether the connection is legal. * @public */ -Blockly.IConnectionChecker.prototype.canConnect; +IConnectionChecker.prototype.canConnect; /** * Checks whether the current connection can connect with the target @@ -50,7 +51,7 @@ Blockly.IConnectionChecker.prototype.canConnect; * an error code otherwise. * @public */ -Blockly.IConnectionChecker.prototype.canConnectWithReason; +IConnectionChecker.prototype.canConnectWithReason; /** * Helper method that translates a connection error code into a string. @@ -61,7 +62,7 @@ Blockly.IConnectionChecker.prototype.canConnectWithReason; * @return {string} A developer-readable error string. * @public */ -Blockly.IConnectionChecker.prototype.getErrorMessage; +IConnectionChecker.prototype.getErrorMessage; /** * Check that connecting the given connections is safe, meaning that it would @@ -71,7 +72,7 @@ Blockly.IConnectionChecker.prototype.getErrorMessage; * @return {number} An enum with the reason this connection is safe or unsafe. * @public */ -Blockly.IConnectionChecker.prototype.doSafetyChecks; +IConnectionChecker.prototype.doSafetyChecks; /** * Check whether this connection is compatible with another connection with @@ -82,7 +83,7 @@ Blockly.IConnectionChecker.prototype.doSafetyChecks; * @return {boolean} True if the connections share a type. * @public */ -Blockly.IConnectionChecker.prototype.doTypeChecks; +IConnectionChecker.prototype.doTypeChecks; /** * Check whether this connection can be made by dragging. @@ -92,4 +93,6 @@ Blockly.IConnectionChecker.prototype.doTypeChecks; * @return {boolean} True if the connection is allowed during a drag. * @public */ -Blockly.IConnectionChecker.prototype.doDragChecks; +IConnectionChecker.prototype.doDragChecks; + +exports = IConnectionChecker; diff --git a/tests/deps.js b/tests/deps.js index 0b641086e..aa3fc9275 100644 --- a/tests/deps.js +++ b/tests/deps.js @@ -81,7 +81,7 @@ goog.addDependency('../../core/interfaces/i_block_dragger.js', ['Blockly.IBlockD goog.addDependency('../../core/interfaces/i_bounded_element.js', ['Blockly.IBoundedElement'], [], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/interfaces/i_bubble.js', ['Blockly.IBubble'], ['Blockly.IContextMenu', 'Blockly.IDraggable'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/interfaces/i_component.js', ['Blockly.IComponent'], [], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/interfaces/i_connection_checker.js', ['Blockly.IConnectionChecker'], []); +goog.addDependency('../../core/interfaces/i_connection_checker.js', ['Blockly.IConnectionChecker'], [], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/interfaces/i_contextmenu.js', ['Blockly.IContextMenu'], [], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/interfaces/i_copyable.js', ['Blockly.ICopyable'], [], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/interfaces/i_deletable.js', ['Blockly.IDeletable'], [], {'lang': 'es6', 'module': 'goog'});