Update @package annotations (#5558)

This commit is contained in:
Monica Kozbial
2021-09-28 08:55:49 -07:00
committed by GitHub
parent 56d26b8a35
commit f67214dac5
19 changed files with 45 additions and 45 deletions

View File

@@ -38,6 +38,7 @@ let disconnectGroup = null;
* Play some UI effects (sound, animation) when disposing of a block.
* @param {!BlockSvg} block The block being disposed of.
* @alias Blockly.blockAnimations.disposeUiEffect
* @package
*/
const disposeUiEffect = function(block) {
const workspace = block.workspace;
@@ -55,7 +56,6 @@ const disposeUiEffect = function(block) {
// Start the animation.
disposeUiStep(clone, workspace.RTL, new Date, workspace.scale);
};
/** @package */
exports.disposeUiEffect = disposeUiEffect;
/**
@@ -89,6 +89,7 @@ const disposeUiStep = function(clone, rtl, start, workspaceScale) {
* Play some UI effects (sound, ripple) after a connection has been established.
* @param {!BlockSvg} block The block being connected.
* @alias Blockly.blockAnimations.connectionUiEffect
* @package
*/
const connectionUiEffect = function(block) {
const workspace = block.workspace;
@@ -120,7 +121,6 @@ const connectionUiEffect = function(block) {
// Start the animation.
connectionUiStep(ripple, new Date, scale);
};
/** @package */
exports.connectionUiEffect = connectionUiEffect;
/**
@@ -145,6 +145,7 @@ const connectionUiStep = function(ripple, start, scale) {
* Play some UI effects (sound, animation) when disconnecting a block.
* @param {!BlockSvg} block The block being disconnected.
* @alias Blockly.blockAnimations.disconnectUiEffect
* @package
*/
const disconnectUiEffect = function(block) {
block.workspace.getAudioManager().play('disconnect');
@@ -162,7 +163,6 @@ const disconnectUiEffect = function(block) {
// Start the animation.
disconnectUiStep(block.getSvgRoot(), magnitude, new Date);
};
/** @package */
exports.disconnectUiEffect = disconnectUiEffect;
/**
@@ -193,6 +193,7 @@ const disconnectUiStep = function(group, magnitude, start) {
/**
* Stop the disconnect UI animation immediately.
* @alias Blockly.blockAnimations.disconnectUiStop
* @package
*/
const disconnectUiStop = function() {
if (disconnectGroup) {
@@ -203,5 +204,4 @@ const disconnectUiStop = function() {
disconnectGroup = null;
}
};
/** @package */
exports.disconnectUiStop = disconnectUiStop;

View File

@@ -31,17 +31,18 @@ let copyData = null;
* Copy a block or workspace comment onto the local clipboard.
* @param {!ICopyable} toCopy Block or Workspace Comment to be copied.
* @alias Blockly.clipboard.copy
* @package
*/
const copy = function(toCopy) {
copyData = toCopy.toCopyData();
};
/** @package */
exports.copy = copy;
/**
* Paste a block or workspace comment on to the main workspace.
* @return {boolean} True if the paste was successful, false otherwise.
* @alias Blockly.clipboard.paste
* @package
*/
const paste = function() {
if (!copyData) {
@@ -62,7 +63,6 @@ const paste = function() {
}
return false;
};
/** @package */
exports.paste = paste;
/**
@@ -70,6 +70,7 @@ exports.paste = paste;
* @param {!ICopyable} toDuplicate Block or Workspace Comment to be
* duplicated.
* @alias Blockly.clipboard.duplicate
* @package
*/
const duplicate = function(toDuplicate) {
const oldCopyData = copyData;
@@ -77,5 +78,4 @@ const duplicate = function(toDuplicate) {
toDuplicate.workspace.paste(copyData.saveInfo);
copyData = oldCopyData;
};
/** @package */
exports.duplicate = duplicate;

View File

@@ -284,6 +284,7 @@ exports.callbackFactory = callbackFactory;
* right-click originated.
* @return {!Object} A menu option, containing text, enabled, and a callback.
* @alias Blockly.ContextMenu.commentDeleteOption
* @package
*/
const commentDeleteOption = function(comment) {
const deleteOption = {
@@ -297,7 +298,6 @@ const commentDeleteOption = function(comment) {
};
return deleteOption;
};
/** @package */
exports.commentDeleteOption = commentDeleteOption;
/**
@@ -306,6 +306,7 @@ exports.commentDeleteOption = commentDeleteOption;
* right-click originated.
* @return {!Object} A menu option, containing text, enabled, and a callback.
* @alias Blockly.ContextMenu.commentDuplicateOption
* @package
*/
const commentDuplicateOption = function(comment) {
const duplicateOption = {
@@ -317,7 +318,6 @@ const commentDuplicateOption = function(comment) {
};
return duplicateOption;
};
/** @package */
exports.commentDuplicateOption = commentDuplicateOption;
/**
@@ -330,6 +330,7 @@ exports.commentDuplicateOption = commentDuplicateOption;
* @suppress {strictModuleDepCheck,checkTypes} Suppress checks while workspace
* comments are not bundled in.
* @alias Blockly.ContextMenu.workspaceCommentOption
* @package
*/
const workspaceCommentOption = function(ws, e) {
const WorkspaceCommentSvg = goog.module.get('Blockly.WorkspaceCommentSvg');
@@ -386,5 +387,4 @@ const workspaceCommentOption = function(ws, e) {
};
return wsCommentOption;
};
/** @package */
exports.workspaceCommentOption = workspaceCommentOption;

View File

@@ -491,6 +491,7 @@ exports.setGroup = setGroup;
* @param {!Block} block The root block.
* @return {!Array<string>} List of block IDs.
* @alias Blockly.Events.utils.getDescendantIds
* @package
*/
const getDescendantIds = function(block) {
const ids = [];
@@ -500,7 +501,6 @@ const getDescendantIds = function(block) {
}
return ids;
};
/** @package */
exports.getDescendantIds = getDescendantIds;
/**

View File

@@ -63,6 +63,7 @@ exports.unregister = unregister;
* @return {?Field} The new field instance or null if a field wasn't
* found with the given type name
* @alias Blockly.fieldRegistry.fromJson
* @package
*/
const fromJson = function(options) {
const fieldObject = /** @type {?IRegistrableField} */ (
@@ -77,5 +78,4 @@ const fromJson = function(options) {
}
return fieldObject.fromJson(options);
};
/** @package */
exports.fromJson = fromJson;

View File

@@ -29,6 +29,7 @@ const {Marker} = goog.requireType('Blockly.Marker');
* @param {!WorkspaceSvg} workspace The workspace for the marker manager.
* @constructor
* @alias Blockly.MarkerManager
* @package
*/
const MarkerManager = function(workspace) {
/**
@@ -198,5 +199,4 @@ MarkerManager.prototype.dispose = function() {
}
};
/** @package */
exports = MarkerManager;

View File

@@ -31,24 +31,24 @@ const toolbox = goog.require('Blockly.utils.toolbox');
* Enum for vertical positioning.
* @enum {number}
* @alias Blockly.uiPosition.verticalPosition
* @package
*/
const verticalPosition = {
TOP: 0,
BOTTOM: 1
};
/** @package */
exports.verticalPosition = verticalPosition;
/**
* Enum for horizontal positioning.
* @enum {number}
* @alias Blockly.uiPosition.horizontalPosition
* @package
*/
const horizontalPosition = {
LEFT: 0,
RIGHT: 1
};
/** @package */
exports.horizontalPosition = horizontalPosition;
/**
@@ -57,21 +57,21 @@ exports.horizontalPosition = horizontalPosition;
* horizontal: !horizontalPosition,
* vertical: !verticalPosition
* }}
* @package
*/
let Position;
/** @package */
exports.Position = Position;
/**
* Enum for bump rules to use for dealing with collisions.
* @enum {number}
* @alias Blockly.uiPosition.bumpDirection
* @package
*/
const bumpDirection = {
UP: 0,
DOWN: 1
};
/** @package */
exports.bumpDirection = bumpDirection;
/**
@@ -89,6 +89,7 @@ exports.bumpDirection = bumpDirection;
* @param {!WorkspaceSvg} workspace The workspace.
* @return {!Rect} The suggested start position.
* @alias Blockly.uiPosition.getStartPositionRect
* @package
*/
const getStartPositionRect = function(
position, size, horizontalPadding, verticalPadding, metrics, workspace) {
@@ -122,7 +123,6 @@ const getStartPositionRect = function(
}
return new Rect(top, top + size.height, left, left + size.width);
};
/** @package */
exports.getStartPositionRect = getStartPositionRect;
/**
@@ -134,6 +134,7 @@ exports.getStartPositionRect = getStartPositionRect;
* @param {!MetricsManager.UiMetrics} metrics The workspace metrics.
* @return {!Position} The suggested corner position.
* @alias Blockly.uiPosition.getCornerOppositeToolbox
* @package
*/
const getCornerOppositeToolbox = function(workspace, metrics) {
const leftCorner =
@@ -145,7 +146,6 @@ const getCornerOppositeToolbox = function(workspace, metrics) {
const vPosition = topCorner ? verticalPosition.TOP : verticalPosition.BOTTOM;
return {horizontal: hPosition, vertical: vPosition};
};
/** @package */
exports.getCornerOppositeToolbox = getCornerOppositeToolbox;
/**
@@ -160,6 +160,7 @@ exports.getCornerOppositeToolbox = getCornerOppositeToolbox;
* represent the positions of UI elements already placed.
* @return {!Rect} The suggested position rectangle.
* @alias Blockly.uiPosition.bumpPositionRect
* @package
*/
const bumpPositionRect = function(startRect, margin, bumpDir, savedPositions) {
let top = startRect.top;
@@ -184,5 +185,4 @@ const bumpPositionRect = function(startRect, margin, bumpDir, savedPositions) {
}
return boundingRect;
};
/** @package */
exports.bumpPositionRect = bumpPositionRect;

View File

@@ -304,6 +304,7 @@ const updateMutatorFlyout = function(workspace) {
* update and adds a mutator change listener to the mutator workspace.
* @param {!Abstract} e The event that triggered this listener.
* @alias Blockly.Procedures.mutatorOpenListener
* @package
*/
const mutatorOpenListener = function(e) {
if (!(e.type == eventUtils.BUBBLE_OPEN && e.bubbleType === 'mutator' &&
@@ -320,7 +321,6 @@ const mutatorOpenListener = function(e) {
updateMutatorFlyout(workspace);
workspace.addChangeListener(mutatorChangeListener);
};
/** @package */
exports.mutatorOpenListener = mutatorOpenListener;
/**

View File

@@ -56,6 +56,7 @@ const registry = goog.require('Blockly.registry');
* Returns whether the debugger is turned on.
* @return {boolean} Whether the debugger is turned on.
* @alias Blockly.blockRendering.isDebuggerEnabled
* @package
*/
const isDebuggerEnabled = function() {
deprecation.warn(
@@ -63,7 +64,6 @@ const isDebuggerEnabled = function() {
'September 2022', 'Blockly.blockRendering.debug.isDebuggerEnabled()');
return debug.isDebuggerEnabled();
};
/** @package */
exports.isDebuggerEnabled = isDebuggerEnabled;
/**
@@ -92,6 +92,7 @@ exports.unregister = unregister;
* Turn on the blocks debugger.
* @package
* @alias Blockly.blockRendering.startDebugger
* @package
*/
const startDebugger = function() {
deprecation.warn(
@@ -99,13 +100,13 @@ const startDebugger = function() {
'September 2022', 'Blockly.blockRendering.debug.startDebugger()');
debug.startDebugger();
};
/** @package */
exports.startDebugger = startDebugger;
/**
* Turn off the blocks debugger.
* @package
* @alias Blockly.blockRendering.stopDebugger
* @package
*/
const stopDebugger = function() {
deprecation.warn(
@@ -113,7 +114,6 @@ const stopDebugger = function() {
'September 2022', 'Blockly.blockRendering.debug.stopDebugger()');
debug.stopDebugger();
};
/** @package */
exports.stopDebugger = stopDebugger;
/**
@@ -125,6 +125,7 @@ exports.stopDebugger = stopDebugger;
* Already initialized.
* @package
* @alias Blockly.blockRendering.init
* @package
*/
const init = function(name, theme, opt_rendererOverrides) {
const rendererClass = registry.getClass(registry.Type.RENDERER, name);
@@ -132,7 +133,6 @@ const init = function(name, theme, opt_rendererOverrides) {
renderer.init(theme, opt_rendererOverrides);
return renderer;
};
/** @package */
exports.init = init;
exports.BottomRow = BottomRow;

View File

@@ -25,31 +25,31 @@ let useDebugger = false;
* Returns whether the debugger is turned on.
* @return {boolean} Whether the debugger is turned on.
* @alias Blockly.blockRendering.debug.isDebuggerEnabled
* @package
*/
const isDebuggerEnabled = function() {
return useDebugger;
};
/** @package */
exports.isDebuggerEnabled = isDebuggerEnabled;
/**
* Turn on the blocks debugger.
* @package
* @alias Blockly.blockRendering.debug.startDebugger
* @package
*/
const startDebugger = function() {
useDebugger = true;
};
/** @package */
exports.startDebugger = startDebugger;
/**
* Turn off the blocks debugger.
* @package
* @alias Blockly.blockRendering.debug.stopDebugger
* @package
*/
const stopDebugger = function() {
useDebugger = false;
};
/** @package */
exports.stopDebugger = stopDebugger;

View File

@@ -327,6 +327,7 @@ exports.append = append;
* by the user. False by default.
* @return {!Block} The block that was just appended.
* @alias Blockly.serialization.blocks.appendInternal
* @package
*/
const appendInternal = function(
state,
@@ -364,7 +365,6 @@ const appendInternal = function(
return block;
};
/** @package */
exports.appendInternal = appendInternal;
/**

View File

@@ -287,6 +287,7 @@ exports.registerRedo = registerRedo;
* Registers all default keyboard shortcut item. This should be called once per
* instance of KeyboardShortcutRegistry.
* @alias Blockly.ShortcutItems.registerDefaultShortcuts
* @package
*/
const registerDefaultShortcuts = function() {
registerEscape();
@@ -297,7 +298,6 @@ const registerDefaultShortcuts = function() {
registerUndo();
registerRedo();
};
/** @package */
exports.registerDefaultShortcuts = registerDefaultShortcuts;
registerDefaultShortcuts();

View File

@@ -347,13 +347,13 @@ const onMouseMove = function(e) {
/**
* Dispose of the tooltip.
* @alias Blockly.Tooltip.dispose
* @package
*/
const dispose = function() {
element = null;
poisonedElement = null;
hide();
};
/** @package */
exports.dispose = dispose;
/**
@@ -377,23 +377,23 @@ exports.hide = hide;
* Hide any in-progress tooltips and block showing new tooltips until the next
* call to unblock().
* @alias Blockly.Tooltip.block
* @package
*/
const block = function() {
hide();
blocked = true;
};
/** @package */
exports.block = block;
/**
* Unblock tooltips: allow them to be scheduled and shown according to their own
* logic.
* @alias Blockly.Tooltip.unblock
* @package
*/
const unblock = function() {
blocked = false;
};
/** @package */
exports.unblock = unblock;
/**

View File

@@ -86,6 +86,7 @@ let longPid_ = 0;
* @param {!Event} e Touch start event.
* @param {Gesture} gesture The gesture that triggered this longStart.
* @alias Blockly.Touch.longStart
* @package
*/
const longStart = function(e, gesture) {
longStop();
@@ -109,13 +110,13 @@ const longStart = function(e, gesture) {
}
}, internalConstants.LONGPRESS);
};
/** @package */
exports.longStart = longStart;
/**
* Nope, that's not a long-press. Either touchend or touchcancel was fired,
* or a drag hath begun. Kill the queued long-press task.
* @alias Blockly.Touch.longStop
* @package
*/
const longStop = function() {
if (longPid_) {
@@ -123,7 +124,6 @@ const longStop = function() {
longPid_ = 0;
}
};
/** @package */
exports.longStop = longStop;
/**

View File

@@ -537,6 +537,7 @@ exports.runAfterPageLoad = runAfterPageLoad;
* @return {!Rect} An object containing window width, height, and
* scroll position in window coordinates.
* @alias Blockly.utils.getViewportBBox
* @package
*/
const getViewportBBox = function() {
// Pixels, in window coordinates.
@@ -545,7 +546,6 @@ const getViewportBBox = function() {
scrollOffset.y, document.documentElement.clientHeight + scrollOffset.y,
scrollOffset.x, document.documentElement.clientWidth + scrollOffset.x);
};
/** @package */
exports.getViewportBBox = getViewportBBox;
/**
@@ -554,6 +554,7 @@ exports.getViewportBBox = getViewportBBox;
* @param {*} value Value to remove.
* @return {boolean} True if an element was removed.
* @alias Blockly.utils.arrayRemove
* @package
*/
const arrayRemove = function(arr, value) {
const i = arr.indexOf(value);
@@ -563,7 +564,6 @@ const arrayRemove = function(arr, value) {
arr.splice(i, 1);
return true;
};
/** @package */
exports.arrayRemove = arrayRemove;
/**
@@ -624,6 +624,7 @@ exports.getBlockTypeCounts = getBlockTypeCounts;
* be converted to workspace coordinates
* @return {!Coordinate} The workspace coordinates.
* @alias Blockly.utils.screenToWsCoordinates
* @package
*/
const screenToWsCoordinates = function(ws, screenCoordinates) {
const screenX = screenCoordinates.x;
@@ -652,7 +653,6 @@ const screenToWsCoordinates = function(ws, screenCoordinates) {
const finalOffsetMainWs = finalOffsetPixels.scale(1 / ws.scale);
return finalOffsetMainWs;
};
/** @package */
exports.screenToWsCoordinates = screenToWsCoordinates;
/**

View File

@@ -29,6 +29,7 @@ goog.module('Blockly.utils.deprecation');
* @param {string=} opt_use The name of a function or property to use instead,
* if any.
* @alias Blockly.utils.deprecation.warn
* @package
*/
const warn = function(name, deprecationDate, deletionDate, opt_use) {
let msg = name + ' was deprecated on ' + deprecationDate +
@@ -38,5 +39,4 @@ const warn = function(name, deprecationDate, deletionDate, opt_use) {
}
console.warn(msg);
};
/** @package */
exports.warn = warn;

View File

@@ -239,6 +239,7 @@ exports.Position = Position;
* @return {?ToolboxInfo} Object holding information
* for creating a toolbox.
* @alias Blockly.utils.toolbox.convertToolboxDefToJson
* @package
*/
const convertToolboxDefToJson = function(toolboxDef) {
if (!toolboxDef) {
@@ -254,7 +255,6 @@ const convertToolboxDefToJson = function(toolboxDef) {
validateToolbox(toolboxJson);
return toolboxJson;
};
/** @package */
exports.convertToolboxDefToJson = convertToolboxDefToJson;
/**
@@ -287,6 +287,7 @@ const validateToolbox = function(toolboxJson) {
* the flyout in one of its many forms.
* @return {!FlyoutItemInfoArray} A list of flyout items.
* @alias Blockly.utils.toolbox.convertFlyoutDefToJsonArray
* @package
*/
const convertFlyoutDefToJsonArray = function(flyoutDef) {
if (!flyoutDef) {
@@ -305,7 +306,6 @@ const convertFlyoutDefToJsonArray = function(flyoutDef) {
return xmlToJsonArray(/** @type {!Array<Node>|!NodeList} */ (flyoutDef));
};
/** @package */
exports.convertFlyoutDefToJsonArray = convertFlyoutDefToJsonArray;
/**
@@ -314,6 +314,7 @@ exports.convertFlyoutDefToJsonArray = convertFlyoutDefToJsonArray;
* information for creating a toolbox.
* @return {boolean} True if the toolbox has categories.
* @alias Blockly.utils.toolbox.hasCategories
* @package
*/
const hasCategories = function(toolboxJson) {
if (!toolboxJson) {
@@ -330,7 +331,6 @@ const hasCategories = function(toolboxJson) {
});
return !!categories.length;
};
/** @package */
exports.hasCategories = hasCategories;
/**
@@ -339,6 +339,7 @@ exports.hasCategories = hasCategories;
* information for creating a category.
* @return {boolean} True if the category has subcategories.
* @alias Blockly.utils.toolbox.isCategoryCollapsible
* @package
*/
const isCategoryCollapsible = function(categoryInfo) {
if (!categoryInfo || !categoryInfo['contents']) {
@@ -350,7 +351,6 @@ const isCategoryCollapsible = function(categoryInfo) {
});
return !!categories.length;
};
/** @package */
exports.isCategoryCollapsible = isCategoryCollapsible;
/**

View File

@@ -541,6 +541,7 @@ const createVariable = function(workspace, id, opt_name, opt_type) {
* were freshly added to the workspace after creating the new block,
* or [] if no new variables were added to the workspace.
* @alias Blockly.Variables.getAddedVariables
* @package
*/
const getAddedVariables = function(workspace, originalVariables) {
const allCurrentVariables = workspace.getAllVariables();
@@ -557,5 +558,4 @@ const getAddedVariables = function(workspace, originalVariables) {
}
return addedVariables;
};
/** @package */
exports.getAddedVariables = getAddedVariables;

View File

@@ -214,6 +214,7 @@ const positionInternal = function(x, y, height) {
* @param {boolean} rtl Whether the workspace is in RTL mode. This determines
* horizontal alignment.
* @alias Blockly.WidgetDiv.positionWithAnchor
* @package
*/
const positionWithAnchor = function(viewportBBox, anchorBBox, widgetSize, rtl) {
const y = calculateY(viewportBBox, anchorBBox, widgetSize);
@@ -225,7 +226,6 @@ const positionWithAnchor = function(viewportBBox, anchorBBox, widgetSize, rtl) {
positionInternal(x, y, widgetSize.height);
}
};
/** @package */
exports.positionWithAnchor = positionWithAnchor;
/**