Skip to content

Commit

Permalink
Merge pull request #5519 from gonfunko/jsdoc
Browse files Browse the repository at this point in the history
fix: JSDoc generation for modules without classes
  • Loading branch information
gonfunko authored Sep 22, 2021
2 parents e1defd8 + e1310b6 commit 33e6471
Show file tree
Hide file tree
Showing 24 changed files with 303 additions and 37 deletions.
12 changes: 12 additions & 0 deletions core/blockly.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ goog.require('Blockly.Xml');
* For local builds, you can pass --define='Blockly.VERSION=X.Y.Z' to the
* compiler to override this constant.
* @define {string}
* @alias Blockly.VERSION
*/
exports.VERSION = 'uncompiled';

Expand Down Expand Up @@ -152,6 +153,7 @@ Object.defineProperties(exports, {
* @param {!SVGElement} svg SVG image.
* @return {!Size} Contains width and height properties.
* @deprecated Use workspace.setCachedParentSvgSize. (2021 March 5)
* @alias Blockly.svgSize
*/
const svgSize = function(svg) {
// When removing this function, remove svg.cachedWidth_ and svg.cachedHeight_
Expand All @@ -168,6 +170,7 @@ exports.svgSize = svgSize;
* Size the workspace when the contents change. This also updates
* scrollbars accordingly.
* @param {!WorkspaceSvg} workspace The workspace to resize.
* @alias Blockly.resizeSvgContents
*/
const resizeSvgContents = function(workspace) {
workspace.resizeContents();
Expand All @@ -178,13 +181,15 @@ exports.resizeSvgContents = resizeSvgContents;
* Copy a block or workspace comment onto the local clipboard.
* @param {!ICopyable} toCopy Block or Workspace Comment to be copied.
* @package
* @alias Blockly.copy
*/
exports.copy = clipboard.copy;

/**
* Paste a block or workspace comment on to the main workspace.
* @return {boolean} True if the paste was successful, false otherwise.
* @package
* @alias Blockly.paste
*/
exports.paste = clipboard.paste;

Expand All @@ -193,13 +198,15 @@ exports.paste = clipboard.paste;
* @param {!ICopyable} toDuplicate Block or Workspace Comment to be
* copied.
* @package
* @alias Blockly.duplicate
*/
exports.duplicate = clipboard.duplicate;

/**
* Close tooltips, context menus, dropdown selections, etc.
* @deprecated Use Blockly.common.getMainWorkspace().hideChaff()
* @param {boolean=} opt_onlyClosePopups Whether only popups should be closed.
* @alias Blockly.hideChaff
*/
const hideChaff = function(opt_onlyClosePopups) {
deprecation.warn('Blockly.hideChaff', 'September 2021', 'September 2022');
Expand All @@ -212,6 +219,7 @@ exports.hideChaff = hideChaff;
* focus). Try not to use this function, particularly if there are multiple
* Blockly instances on a page.
* @return {!Workspace} The main workspace.
* @alias Blockly.getMainWorkspace
*/
exports.getMainWorkspace = common.getMainWorkspace;

Expand All @@ -232,6 +240,7 @@ const jsonInitFactory = function(jsonDef) {
* Define blocks from an array of JSON block definitions, as might be generated
* by the Blockly Developer Tools.
* @param {!Array<!Object>} jsonArray An array of JSON block definitions.
* @alias Blockly.defineBlocksWithJsonArray
*/
const defineBlocksWithJsonArray = function(jsonArray) {
for (let i = 0; i < jsonArray.length; i++) {
Expand Down Expand Up @@ -263,6 +272,7 @@ exports.defineBlocksWithJsonArray = defineBlocksWithJsonArray;
* Is the given string a number (includes negative and decimals).
* @param {string} str Input string.
* @return {boolean} True if number, false otherwise.
* @alias Blockly.isNumber
*/
const isNumber = function(str) {
return /^\s*-?\d+(\.\d+)?\s*$/.test(str);
Expand All @@ -276,6 +286,7 @@ exports.isNumber = isNumber;
* is called.
* This method is a NOP if called after the first ``Blockly.inject``.
* @param {!Element} container The container element.
* @alias Blockly.setParentContainer
*/
exports.setParentContainer = common.setParentContainer;

Expand All @@ -284,6 +295,7 @@ exports.setParentContainer = common.setParentContainer;
/**
* @see colour.hueToHex
* @deprecated Use Blockly.utils.colour.hueToHex (September 2021).
* @alias Blockly.hueToHex
*/
exports.hueToHex = colour.hueToHex;

Expand Down
3 changes: 3 additions & 0 deletions core/css.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ let injected = false;
* components such as fields and the toolbox to store separate CSS.
* The provided array of CSS will be destroyed by this function.
* @param {!Array<string>} cssArray Array of CSS strings.
* @alias Blockly.Css.register
*/
const register = function(cssArray) {
if (injected) {
Expand All @@ -50,6 +51,7 @@ exports.register = register;
* @param {boolean} hasCss If false, don't inject CSS
* (providing CSS becomes the document's responsibility).
* @param {string} pathToMedia Path from page to the Blockly media directory.
* @alias Blockly.Css.inject
*/
const inject = function(hasCss, pathToMedia) {
// Only inject the CSS once.
Expand Down Expand Up @@ -77,6 +79,7 @@ exports.inject = inject;

/**
* Array making up the CSS content for Blockly.
* @alias Blockly.Css.CONTENT
*/
const CONTENT = [
`.blocklySvg {
Expand Down
Loading

0 comments on commit 33e6471

Please sign in to comment.