mirror of
https://github.com/google/blockly.git
synced 2026-01-04 15:40:08 +01:00
Update JSDoc from Array.<> to Array<>
Same with Object.
This commit is contained in:
@@ -432,7 +432,7 @@ AppController.prototype.assignExporterChangeListeners = function() {
|
||||
/**
|
||||
* If given checkbox is checked, enable the given elements. Otherwise, disable.
|
||||
* @param {boolean} enabled True if enabled, false otherwise.
|
||||
* @param {!Array.<string>} idArray Array of element IDs to enable when
|
||||
* @param {!Array<string>} idArray Array of element IDs to enable when
|
||||
* checkbox is checked.
|
||||
*/
|
||||
AppController.prototype.ifCheckedEnable = function(enabled, idArray) {
|
||||
|
||||
@@ -49,7 +49,7 @@ BlockDefinitionExtractor.buildBlockFactoryWorkspace = function(block) {
|
||||
* inner text.
|
||||
*
|
||||
* @param {string} name New element tag name.
|
||||
* @param {!Object.<string, string>=} opt_attrs Optional list of attributes.
|
||||
* @param {!Object<string, string>=} opt_attrs Optional list of attributes.
|
||||
* @param {string=} opt_text Optional inner text.
|
||||
* @return {!Element} The newly created element.
|
||||
* @private
|
||||
@@ -112,7 +112,7 @@ BlockDefinitionExtractor.buildTypeConstraintBlockForConnection_ =
|
||||
} else if (connection.check_.length === 1) {
|
||||
typeBlock = BlockDefinitionExtractor.buildBlockForType_(
|
||||
connection.check_[0]);
|
||||
} else if (connection.check_.length > 1 ) {
|
||||
} else if (connection.check_.length > 1) {
|
||||
typeBlock = BlockDefinitionExtractor.typeGroup_(connection.check_);
|
||||
}
|
||||
} else {
|
||||
@@ -323,7 +323,7 @@ BlockDefinitionExtractor.input_ = function(input, align) {
|
||||
|
||||
/**
|
||||
* Constructs a sequence <block> elements representing the field definition.
|
||||
* @param {Array.<Blockly.Field>} fieldRow A list of fields in a Blockly.Input.
|
||||
* @param {Array<Blockly.Field>} fieldRow A list of fields in a Blockly.Input.
|
||||
* @return {Element} The fist <block> element of the sequence
|
||||
* (and the root of the constructed DOM).
|
||||
* @private
|
||||
@@ -600,7 +600,7 @@ BlockDefinitionExtractor.buildFieldImage_ =
|
||||
/**
|
||||
* Creates a <block> element a group of allowed connection constraint types.
|
||||
*
|
||||
* @param {Array.<string>} types List of type names in this group.
|
||||
* @param {Array<string>} types List of type names in this group.
|
||||
* @return {Element} The <block> element representing the group, with child
|
||||
* types attached.
|
||||
* @private
|
||||
|
||||
@@ -253,7 +253,7 @@ BlockExporterController.prototype.selectUsedBlocks = function() {
|
||||
|
||||
/**
|
||||
* Set the array that holds the block types used in workspace factory.
|
||||
* @param {!Array.<string>} usedBlockTypes Block types used in
|
||||
* @param {!Array<string>} usedBlockTypes Block types used in
|
||||
*/
|
||||
BlockExporterController.prototype.setUsedBlockTypes =
|
||||
function(usedBlockTypes) {
|
||||
|
||||
@@ -70,7 +70,7 @@ BlockExporterView.prototype.deselectAllBlocks = function() {
|
||||
/**
|
||||
* Given an array of selected blocks, selects these blocks in the view, marking
|
||||
* the checkboxes accordingly.
|
||||
* @param {Array.<Blockly.Block>} blockTypes Array of block types to select.
|
||||
* @param {Array<Blockly.Block>} blockTypes Array of block types to select.
|
||||
*/
|
||||
BlockExporterView.prototype.setSelectedBlockTypes = function(blockTypes) {
|
||||
for (var i = 0, blockType; blockType = blockTypes[i]; i++) {
|
||||
@@ -80,7 +80,7 @@ BlockExporterView.prototype.setSelectedBlockTypes = function(blockTypes) {
|
||||
|
||||
/**
|
||||
* Returns array of selected blocks.
|
||||
* @return {!Array.<string>} Array of all selected block types.
|
||||
* @return {!Array<string>} Array of all selected block types.
|
||||
*/
|
||||
BlockExporterView.prototype.getSelectedBlockTypes = function() {
|
||||
var selectedTypes = [];
|
||||
|
||||
@@ -212,7 +212,7 @@ BlockLibraryController.prototype.hasEmptyBlockLibrary = function() {
|
||||
|
||||
/**
|
||||
* Get all block types stored in block library.
|
||||
* @return {!Array.<string>} Array of block types.
|
||||
* @return {!Array<string>} Array of block types.
|
||||
*/
|
||||
BlockLibraryController.prototype.getStoredBlockTypes = function() {
|
||||
return this.storage.getBlockTypes();
|
||||
|
||||
@@ -100,7 +100,7 @@ BlockLibraryStorage.prototype.getBlockXml = function(blockType) {
|
||||
/**
|
||||
* Returns map of each block type to its corresponding XML stored in current
|
||||
* block library (this.blocks).
|
||||
* @param {!Array.<string>} blockTypes Types of blocks.
|
||||
* @param {!Array<string>} blockTypes Types of blocks.
|
||||
* @return {!Object} Map of block type to corresponding XML.
|
||||
*/
|
||||
BlockLibraryStorage.prototype.getBlockXmlMap = function(blockTypes) {
|
||||
@@ -115,7 +115,7 @@ BlockLibraryStorage.prototype.getBlockXmlMap = function(blockTypes) {
|
||||
|
||||
/**
|
||||
* Returns array of all block types stored in current block library.
|
||||
* @return {!Array.<string>} Array of block types stored in library.
|
||||
* @return {!Array<string>} Array of block types stored in library.
|
||||
*/
|
||||
BlockLibraryStorage.prototype.getBlockTypes = function() {
|
||||
return Object.keys(this.blocks);
|
||||
@@ -134,7 +134,7 @@ BlockLibraryStorage.prototype.isEmpty = function() {
|
||||
|
||||
/**
|
||||
* Returns array of all block types stored in current block library.
|
||||
* @return {!Array.<string>} Map of block type to corresponding XML text.
|
||||
* @return {!Array<string>} Map of block type to corresponding XML text.
|
||||
*/
|
||||
BlockLibraryStorage.prototype.getBlockXmlTextMap = function() {
|
||||
return this.blocks;
|
||||
|
||||
@@ -377,7 +377,7 @@ FactoryUtils.connectionLineJs_ = function(functionName, typeName, workspace) {
|
||||
/**
|
||||
* Returns field strings and any config.
|
||||
* @param {!Blockly.Block} block Input block.
|
||||
* @return {!Array.<string>} Field strings.
|
||||
* @return {!Array<string>} Field strings.
|
||||
* @private
|
||||
*/
|
||||
FactoryUtils.getFieldsJs_ = function(block) {
|
||||
@@ -484,7 +484,7 @@ FactoryUtils.getFieldsJs_ = function(block) {
|
||||
/**
|
||||
* Returns field strings and any config.
|
||||
* @param {!Blockly.Block} block Input block.
|
||||
* @return {!Array.<string|!Object>} Array of static text and field configs.
|
||||
* @return {!Array<string|!Object>} Array of static text and field configs.
|
||||
* @private
|
||||
*/
|
||||
FactoryUtils.getFieldsJson_ = function(block) {
|
||||
@@ -614,7 +614,7 @@ FactoryUtils.getOptTypesFrom = function(block, name) {
|
||||
* Fetch the type(s) defined in the given input.
|
||||
* @param {!Blockly.Block} block Block with input.
|
||||
* @param {string} name Name of the input.
|
||||
* @return {!Array.<string>} List of types.
|
||||
* @return {!Array<string>} List of types.
|
||||
* @private
|
||||
*/
|
||||
FactoryUtils.getTypesFrom_ = function(block, name) {
|
||||
@@ -745,7 +745,7 @@ FactoryUtils.getBlockTypeFromJsDefinition = function(blockDef) {
|
||||
|
||||
/**
|
||||
* Generates a category containing blocks of the specified block types.
|
||||
* @param {!Array.<!Blockly.Block>} blocks Blocks to include in the category.
|
||||
* @param {!Array<!Blockly.Block>} blocks Blocks to include in the category.
|
||||
* @param {string} categoryName Name to use for the generated category.
|
||||
* @return {!Element} Category XML containing the given block types.
|
||||
*/
|
||||
@@ -771,7 +771,7 @@ FactoryUtils.generateCategoryXml = function(blocks, categoryName) {
|
||||
* Parses a string containing JavaScript block definition(s) to create an array
|
||||
* in which each element is a single block definition.
|
||||
* @param {string} blockDefsString JavaScript block definition(s).
|
||||
* @return {!Array.<string>} Array of block definitions.
|
||||
* @return {!Array<string>} Array of block definitions.
|
||||
*/
|
||||
FactoryUtils.parseJsBlockDefinitions = function(blockDefsString) {
|
||||
var blockDefArray = [];
|
||||
@@ -797,7 +797,7 @@ FactoryUtils.parseJsBlockDefinitions = function(blockDefsString) {
|
||||
* JSON objects.
|
||||
* @param {string} blockDefsString String containing JSON block
|
||||
* definition(s).
|
||||
* @return {!Array.<string>} Array of block definitions.
|
||||
* @return {!Array<string>} Array of block definitions.
|
||||
*/
|
||||
FactoryUtils.parseJsonBlockDefinitions = function(blockDefsString) {
|
||||
var blockDefArray = [];
|
||||
@@ -827,7 +827,7 @@ FactoryUtils.parseJsonBlockDefinitions = function(blockDefsString) {
|
||||
* Define blocks from imported block definitions.
|
||||
* @param {string} blockDefsString Block definition(s).
|
||||
* @param {string} format Block definition format ('JSON' or 'JavaScript').
|
||||
* @return {!Array.<!Element>} Array of block types defined.
|
||||
* @return {!Array<!Element>} Array of block types defined.
|
||||
*/
|
||||
FactoryUtils.defineAndGetBlockTypes = function(blockDefsString, format) {
|
||||
var blockTypes = [];
|
||||
|
||||
@@ -1251,7 +1251,7 @@ WorkspaceFactoryController.prototype.importBlocks = function(file, format) {
|
||||
/**
|
||||
* Updates the block library category in the toolbox workspace toolbox.
|
||||
* @param {!Element} categoryXml XML for the block library category.
|
||||
* @param {!Array.<string>} libBlockTypes Array of block types from the block
|
||||
* @param {!Array<string>} libBlockTypes Array of block types from the block
|
||||
* library.
|
||||
*/
|
||||
WorkspaceFactoryController.prototype.setBlockLibCategory =
|
||||
@@ -1278,7 +1278,7 @@ WorkspaceFactoryController.prototype.setBlockLibCategory =
|
||||
|
||||
/**
|
||||
* Return the block types used in the custom toolbox and pre-loaded workspace.
|
||||
* @return {!Array.<string>} Block types used in the custom toolbox and
|
||||
* @return {!Array<string>} Block types used in the custom toolbox and
|
||||
* pre-loaded workspace.
|
||||
*/
|
||||
WorkspaceFactoryController.prototype.getAllUsedBlockTypes = function() {
|
||||
|
||||
@@ -212,8 +212,8 @@ WorkspaceFactoryGenerator.prototype.setShadowBlocksInHiddenWorkspace_ =
|
||||
/**
|
||||
* Given a set of block types, gets the Blockly.Block objects for each block
|
||||
* type.
|
||||
* @param {!Array.<!Element>} blockTypes Array of blocks that have been defined.
|
||||
* @return {!Array.<!Blockly.Block>} Array of Blockly.Block objects corresponding
|
||||
* @param {!Array<!Element>} blockTypes Array of blocks that have been defined.
|
||||
* @return {!Array<!Blockly.Block>} Array of Blockly.Block objects corresponding
|
||||
* to the array of blockTypes.
|
||||
*/
|
||||
WorkspaceFactoryGenerator.prototype.getDefinedBlocks = function(blockTypes) {
|
||||
|
||||
@@ -246,7 +246,7 @@ WorkspaceFactoryModel.prototype.getSelectedXml = function() {
|
||||
|
||||
/**
|
||||
* Return ordered list of ListElement objects.
|
||||
* @return {!Array.<!ListElement>} ordered list of ListElement objects
|
||||
* @return {!Array<!ListElement>} ordered list of ListElement objects
|
||||
*/
|
||||
WorkspaceFactoryModel.prototype.getToolboxList = function() {
|
||||
return this.toolboxList;
|
||||
@@ -383,7 +383,7 @@ WorkspaceFactoryModel.prototype.setOptions = function(options) {
|
||||
* Returns an array of all the block types currently being used in the toolbox
|
||||
* and the pre-loaded blocks. No duplicates.
|
||||
* TODO(evd2014): Move pushBlockTypesToList to FactoryUtils.
|
||||
* @return {!Array.<string>} Array of block types currently being used.
|
||||
* @return {!Array<string>} Array of block types currently being used.
|
||||
*/
|
||||
WorkspaceFactoryModel.prototype.getAllUsedBlockTypes = function() {
|
||||
var blockTypeList = [];
|
||||
@@ -424,7 +424,7 @@ WorkspaceFactoryModel.prototype.getAllUsedBlockTypes = function() {
|
||||
|
||||
/**
|
||||
* Adds new imported block types to the list of current imported block types.
|
||||
* @param {!Array.<string>} blockTypes Array of block types imported.
|
||||
* @param {!Array<string>} blockTypes Array of block types imported.
|
||||
*/
|
||||
WorkspaceFactoryModel.prototype.addImportedBlockTypes = function(blockTypes) {
|
||||
this.importedBlockTypes = this.importedBlockTypes.concat(blockTypes);
|
||||
@@ -432,7 +432,7 @@ WorkspaceFactoryModel.prototype.addImportedBlockTypes = function(blockTypes) {
|
||||
|
||||
/**
|
||||
* Updates block types in block library.
|
||||
* @param {!Array.<string>} blockTypes Array of block types in block library.
|
||||
* @param {!Array<string>} blockTypes Array of block types in block library.
|
||||
*/
|
||||
WorkspaceFactoryModel.prototype.updateLibBlockTypes = function(blockTypes) {
|
||||
this.libBlockTypes = blockTypes;
|
||||
@@ -454,7 +454,7 @@ WorkspaceFactoryModel.prototype.isDefinedBlockType = function(blockType) {
|
||||
|
||||
/**
|
||||
* Checks if any of the block types are already defined.
|
||||
* @param {!Array.<string>} blockTypes Array of block types.
|
||||
* @param {!Array<string>} blockTypes Array of block types.
|
||||
* @return {boolean} True if a block type in the array is already defined,
|
||||
* false if none of the blocks are already defined.
|
||||
*/
|
||||
|
||||
@@ -294,7 +294,7 @@ WorkspaceFactoryView.prototype.clearToolboxTabs = function() {
|
||||
* Given a set of blocks currently loaded user-generated shadow blocks, visually
|
||||
* marks them without making them actual shadow blocks (allowing them to still
|
||||
* be editable and movable).
|
||||
* @param {!Array.<!Blockly.Block>} blocks Array of user-generated shadow blocks
|
||||
* @param {!Array<!Blockly.Block>} blocks Array of user-generated shadow blocks
|
||||
* currently loaded.
|
||||
*/
|
||||
WorkspaceFactoryView.prototype.markShadowBlocks = function(blocks) {
|
||||
|
||||
@@ -278,7 +278,7 @@ function connectionLineJs_(functionName, typeName) {
|
||||
/**
|
||||
* Returns field strings and any config.
|
||||
* @param {!Blockly.Block} block Input block.
|
||||
* @return {!Array.<string>} Field strings.
|
||||
* @return {!Array<string>} Field strings.
|
||||
* @private
|
||||
*/
|
||||
function getFieldsJs_(block) {
|
||||
@@ -374,7 +374,7 @@ function getFieldsJs_(block) {
|
||||
/**
|
||||
* Returns field strings and any config.
|
||||
* @param {!Blockly.Block} block Input block.
|
||||
* @return {!Array.<string|!Object>} Array of static text and field configs.
|
||||
* @return {!Array<string|!Object>} Array of static text and field configs.
|
||||
* @private
|
||||
*/
|
||||
function getFieldsJson_(block) {
|
||||
@@ -504,7 +504,7 @@ function getOptTypesFrom(block, name) {
|
||||
* Fetch the type(s) defined in the given input.
|
||||
* @param {!Blockly.Block} block Block with input.
|
||||
* @param {string} name Name of the input.
|
||||
* @return {!Array.<string>} List of types.
|
||||
* @return {!Array<string>} List of types.
|
||||
* @private
|
||||
*/
|
||||
function getTypesFrom_(block, name) {
|
||||
|
||||
@@ -298,7 +298,7 @@ Graph.drawVisualization = function() {
|
||||
/**
|
||||
* Plot points on the function y = f(x).
|
||||
* @param {string} code JavaScript code.
|
||||
* @return {!Array.<!Array>} 2D Array of points on the graph.
|
||||
* @return {!Array<!Array>} 2D Array of points on the graph.
|
||||
*/
|
||||
Graph.plot = function(code) {
|
||||
// Initialize a table with two column headings.
|
||||
|
||||
@@ -613,7 +613,7 @@ goog.string.StringBuffer.prototype.append = function(a1, opt_a2, var_args) {
|
||||
// directly to avoid arguments instantiation, another 2x improvement.
|
||||
this.buffer_[this.bufferLength_++] = a1;
|
||||
} else {
|
||||
var arr = /**@type {Array.<number|string|boolean>}*/(this.buffer_);
|
||||
var arr = /**@type {Array<number|string|boolean>}*/(this.buffer_);
|
||||
arr.push.apply(arr, arguments);
|
||||
this.bufferLength_ = this.buffer_.length;
|
||||
}
|
||||
@@ -1656,7 +1656,7 @@ soy.$$checkMapKey = function(key) {
|
||||
/**
|
||||
* Gets the keys in a map as an array. There are no guarantees on the order.
|
||||
* @param {Object} map The map to get the keys of.
|
||||
* @return {Array.<string>} The array of keys in the given map.
|
||||
* @return {Array<string>} The array of keys in the given map.
|
||||
*/
|
||||
soy.$$getMapKeys = function(map) {
|
||||
var mapKeys = [];
|
||||
@@ -1779,9 +1779,9 @@ soy.$$getDelegateFn = function(
|
||||
* Private helper soy.$$getDelegateFn(). This is the empty template function
|
||||
* that is returned whenever there's no delegate implementation found.
|
||||
*
|
||||
* @param {Object.<string, *>=} opt_data
|
||||
* @param {Object<string, *>=} opt_data
|
||||
* @param {soy.StringBuilder=} opt_sb
|
||||
* @param {Object.<string, *>=} opt_ijData
|
||||
* @param {Object<string, *>=} opt_ijData
|
||||
* @return {string}
|
||||
* @private
|
||||
*/
|
||||
@@ -2052,7 +2052,7 @@ soy.$$HTML5_VOID_ELEMENTS_ = new RegExp(
|
||||
*
|
||||
* @param {*} value The HTML to be escaped. May not be a string, but the
|
||||
* value will be coerced to a string.
|
||||
* @param {Object.<string, number>=} opt_tagAllowlist Has an own property whose
|
||||
* @param {Object<string, number>=} opt_tagAllowlist Has an own property whose
|
||||
* name is a lower-case tag name and whose value is {@code 1} for
|
||||
* each element that is allowed in the output.
|
||||
* @return {string} A representation of value without disallowed tags,
|
||||
@@ -2118,7 +2118,7 @@ soy.$$stripHtmlTags = function(value, opt_tagAllowlist) {
|
||||
* If {@code <table>} is used for formatting, embedded HTML shouldn't be able
|
||||
* to use a mismatched {@code </table>} to break page layout.
|
||||
*
|
||||
* @param {Array.<string>} tags an array of tags that will be modified in place
|
||||
* @param {Array<string>} tags an array of tags that will be modified in place
|
||||
* include tags, the empty string, or concatenations of empty tags.
|
||||
* @return {string} zero or more closed tags that close all elements that are
|
||||
* opened in tags but not closed.
|
||||
@@ -2575,7 +2575,7 @@ soy.$$isLowSurrogate_ = function(ch) {
|
||||
/**
|
||||
* Cache of bidi formatter by context directionality, so we don't keep on
|
||||
* creating new objects.
|
||||
* @type {!Object.<!goog.i18n.BidiFormatter>}
|
||||
* @type {!Object<!goog.i18n.BidiFormatter>}
|
||||
* @private
|
||||
*/
|
||||
soy.$$bidiFormatterCache_ = {};
|
||||
@@ -2799,7 +2799,7 @@ soy.esc.$$escapeUriHelper = function(v) {
|
||||
|
||||
/**
|
||||
* Maps characters to the escaped versions for the named escape directives.
|
||||
* @type {Object.<string, string>}
|
||||
* @type {Object<string, string>}
|
||||
* @private
|
||||
*/
|
||||
soy.esc.$$ESCAPE_MAP_FOR_ESCAPE_HTML__AND__NORMALIZE_HTML__AND__ESCAPE_HTML_NOSPACE__AND__NORMALIZE_HTML_NOSPACE_ = {
|
||||
@@ -2837,7 +2837,7 @@ soy.esc.$$REPLACER_FOR_ESCAPE_HTML__AND__NORMALIZE_HTML__AND__ESCAPE_HTML_NOSPAC
|
||||
|
||||
/**
|
||||
* Maps characters to the escaped versions for the named escape directives.
|
||||
* @type {Object.<string, string>}
|
||||
* @type {Object<string, string>}
|
||||
* @private
|
||||
*/
|
||||
soy.esc.$$ESCAPE_MAP_FOR_ESCAPE_JS_STRING__AND__ESCAPE_JS_REGEX_ = {
|
||||
@@ -2889,7 +2889,7 @@ soy.esc.$$REPLACER_FOR_ESCAPE_JS_STRING__AND__ESCAPE_JS_REGEX_ = function(ch) {
|
||||
|
||||
/**
|
||||
* Maps characters to the escaped versions for the named escape directives.
|
||||
* @type {Object.<string, string>}
|
||||
* @type {Object<string, string>}
|
||||
* @private
|
||||
*/
|
||||
soy.esc.$$ESCAPE_MAP_FOR_ESCAPE_CSS_STRING_ = {
|
||||
@@ -2934,7 +2934,7 @@ soy.esc.$$REPLACER_FOR_ESCAPE_CSS_STRING_ = function(ch) {
|
||||
|
||||
/**
|
||||
* Maps characters to the escaped versions for the named escape directives.
|
||||
* @type {Object.<string, string>}
|
||||
* @type {Object<string, string>}
|
||||
* @private
|
||||
*/
|
||||
soy.esc.$$ESCAPE_MAP_FOR_NORMALIZE_URI__AND__FILTER_NORMALIZE_URI_ = {
|
||||
@@ -3291,7 +3291,7 @@ soy.esc.$$LT_REGEX_ = /</g;
|
||||
/**
|
||||
* Maps lower-case names of innocuous tags to 1.
|
||||
*
|
||||
* @type {Object.<string,number>}
|
||||
* @type {Object<string,number>}
|
||||
* @private
|
||||
*/
|
||||
soy.esc.$$SAFE_TAG_ALLOWLIST_ = {'b': 1, 'br': 1, 'em': 1, 'i': 1, 's': 1, 'sub': 1, 'sup': 1, 'u': 1};
|
||||
|
||||
Reference in New Issue
Block a user