From 9afe497b7eaa068fc294d6dcd8025169a16dc473 Mon Sep 17 00:00:00 2001 From: alschmiedt Date: Wed, 19 Dec 2018 08:45:20 -0800 Subject: [PATCH] Fixes jsdocs --- core/block.js | 18 +++++++++--------- core/block_svg.js | 10 +++++----- core/blockly.js | 8 ++++---- core/style.js | 2 +- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/core/block.js b/core/block.js index 9319ca239..90eb80c46 100644 --- a/core/block.js +++ b/core/block.js @@ -233,7 +233,7 @@ Blockly.Block.prototype.colour_ = '#000000'; /** * Secondary colour of the block. * Colour of the block if it is a shadow - * @type {string} + * @type {?string} * @private */ Blockly.Block.prototype.secondaryColour_ = null; @@ -241,21 +241,21 @@ Blockly.Block.prototype.secondaryColour_ = null; /** * Tertiary colour of the block. * Colour of the border on the block. - * @type {string} + * @type {?string} * @private */ Blockly.Block.prototype.tertiaryColour_ = null; /** * Style of the block. - * @type {Object} Map from style attribute name (string) to style value (string) + * @type {?Object} Map from style attribute name (string) to style value (string) * @private */ Blockly.Block.prototype.style_ = null; /** * Name of the block style. - * @type {string} + * @type {?string} * @private */ Blockly.Block.prototype.styleName_ = null; @@ -857,7 +857,7 @@ Blockly.Block.prototype.getColour = function() { /** * Get the secondary colour of a block. - * @return {string} #RRGGBB string. + * @return {?string} #RRGGBB string. */ Blockly.Block.prototype.getSecondaryColour = function() { return this.secondaryColour_; @@ -865,7 +865,7 @@ Blockly.Block.prototype.getSecondaryColour = function() { /** * Get the tertiary colour of a block. - * @return {string} #RRGGBB string. + * @return {?string} #RRGGBB string. */ Blockly.Block.prototype.getTertiaryColour = function() { return this.tertiaryColour_; @@ -873,7 +873,7 @@ Blockly.Block.prototype.getTertiaryColour = function() { /** * Get the style of a block. - * @return {Object} Map of style names (string) to style value (string). + * @return {?Object} Map of style names (string) to style value (string). */ Blockly.Block.prototype.getStyle = function() { return this.style_; @@ -881,7 +881,7 @@ Blockly.Block.prototype.getStyle = function() { /** * Get the name of the block style. - * @return {string} Name of the block style. + * @return {?string} Name of the block style. */ Blockly.Block.prototype.getStyleName = function() { return this.styleName_; @@ -1352,7 +1352,7 @@ Blockly.Block.prototype.jsonInit = function(json) { // Set basic properties of block. if (json['style'] && json['colour']) { throw Error(warningPrefix + 'Must not have both a colour and a style.'); - } else if (json['style']){ + } else if (json['style']) { this.jsonInitStyle_(json, warningPrefix); } else { this.jsonInitColour_(json, warningPrefix); diff --git a/core/block_svg.js b/core/block_svg.js index 675ca7b9e..b28d15fd5 100644 --- a/core/block_svg.js +++ b/core/block_svg.js @@ -922,8 +922,8 @@ Blockly.BlockSvg.prototype.updateColour = function() { /** * Sets the colour of the border. * Removes the light and dark paths if a tertiary colour is defined. - * @param {string} rgb Colour of the block. - * @param {string} tertiaryColour Colour of the border. + * @param {!string} rgb Colour of the block. + * @param {?string} tertiaryColour Colour of the border. */ Blockly.BlockSvg.prototype.setBorderColour_ = function(rgb, tertiaryColour) { if (tertiaryColour) { @@ -943,9 +943,9 @@ Blockly.BlockSvg.prototype.setBorderColour_ = function(rgb, tertiaryColour) { /** * Sets the colour of shadow blocks. - * @param {string} rgb Primary colour of the block. - * @param {string} secondaryColour Colour for shadow block. - * @return {string} hexColour The background color of the block. + * @param {!string} rgb Primary colour of the block. + * @param {?string} secondaryColour Colour for shadow block. + * @return {!string} hexColour The background color of the block. */ Blockly.BlockSvg.prototype.setShadowColour_ = function( rgb, secondaryColour) { diff --git a/core/blockly.js b/core/blockly.js index 9a7e1327d..e2e979e29 100644 --- a/core/blockly.js +++ b/core/blockly.js @@ -114,7 +114,7 @@ Blockly.cache3dSupported_ = null; /** * Holds all Blockly style attributes. - * @type {Blockly.Style} + * @type {?Blockly.Style} * @private */ Blockly.style_ = null; @@ -679,7 +679,7 @@ Blockly.checkBlockColourConstant_ = function( * Sets the style for blockly and refreshes all blocks in toolbox and workspace. * @param {Blockly.Style} style Style for blockly. */ -Blockly.setStyle = function(style){ +Blockly.setStyle = function(style) { this.style_ = style; var workspace = Blockly.getMainWorkspace(); var blocks = workspace.getAllBlocks(); @@ -697,9 +697,9 @@ Blockly.setStyle = function(style){ /** * Gets the style for blockly. - * @return {Blockly.Style} style Style for blockly. + * @return {?Blockly.Style} style Style for blockly. */ -Blockly.getStyle = function(){ +Blockly.getStyle = function() { return this.style_; }; diff --git a/core/style.js b/core/style.js index 57d9d320d..5e535cd80 100644 --- a/core/style.js +++ b/core/style.js @@ -44,7 +44,7 @@ Blockly.Style.prototype.getBlockStyle = function(blockStyleName) { * @param{String} blockStyleName The name of the block style. * @param{Blockly.BlockStyle} blockStyle The block style */ -Blockly.Style.prototype.setBlockStyle = function(blockStyleName, blockStyle){ +Blockly.Style.prototype.setBlockStyle = function(blockStyleName, blockStyle) { var event = new Blockly.Events.Ui(null, 'blockStyleChanged', this.blockStyles_[blockStyleName], blockStyle); this.blockStyles_[blockStyleName] = blockStyle;