From 169959bc087d8d91527712ae72edc01de95b81a0 Mon Sep 17 00:00:00 2001 From: Maribeth Bottorff Date: Tue, 16 Aug 2022 16:11:00 -0700 Subject: [PATCH] chore: remove redundant fileoverview from ts --- core/block.ts | 4 - core/block_animations.ts | 12 +- core/block_drag_surface.ts | 9 - core/block_dragger.ts | 4 - core/block_svg.ts | 4 - core/blockly.ts | 39 +++- core/blockly_options.ts | 4 - core/blocks.ts | 4 - core/browser_events.ts | 35 ++- core/bubble.ts | 4 - core/bubble_dragger.ts | 15 +- core/bump_objects.ts | 15 +- core/clipboard.ts | 4 - core/comment.ts | 29 ++- core/common.ts | 5 - core/component_manager.ts | 4 - core/config.ts | 13 +- core/connection.ts | 4 - core/connection_checker.ts | 5 - core/connection_db.ts | 31 +-- core/connection_type.ts | 4 - core/constants.ts | 4 - core/contextmenu.ts | 33 ++- core/contextmenu_items.ts | 4 - core/contextmenu_registry.ts | 4 - core/css.ts | 8 +- core/delete_area.ts | 5 - core/dialog.ts | 5 - core/drag_target.ts | 5 - core/dropdowndiv.ts | 5 - core/events/events.ts | 5 +- core/events/events_abstract.ts | 18 +- core/events/events_block_base.ts | 10 +- core/events/events_block_change.ts | 17 +- core/events/events_block_create.ts | 11 +- core/events/events_block_delete.ts | 11 +- core/events/events_block_drag.ts | 4 - core/events/events_block_move.ts | 17 +- core/events/events_bubble_open.ts | 10 +- core/events/events_click.ts | 10 +- core/events/events_comment_base.ts | 11 +- core/events/events_comment_change.ts | 14 +- core/events/events_comment_create.ts | 11 +- core/events/events_comment_delete.ts | 11 +- core/events/events_comment_move.ts | 15 +- core/events/events_marker_move.ts | 10 +- core/events/events_selected.ts | 10 +- core/events/events_theme_change.ts | 4 - core/events/events_toolbox_item_select.ts | 4 - core/events/events_trashcan_open.ts | 10 +- core/events/events_ui.ts | 11 +- core/events/events_ui_base.ts | 7 +- core/events/events_var_base.ts | 10 +- core/events/events_var_create.ts | 11 +- core/events/events_var_delete.ts | 11 +- core/events/events_var_rename.ts | 11 +- core/events/events_viewport.ts | 10 +- core/events/utils.ts | 5 - core/events/workspace_events.ts | 10 +- core/extensions.ts | 7 - core/field.ts | 123 ++++++++--- core/field_angle.ts | 4 - core/field_checkbox.ts | 31 ++- core/field_colour.ts | 4 - core/field_dropdown.ts | 43 ++-- core/field_image.ts | 4 - core/field_label.ts | 5 - core/field_label_serializable.ts | 11 +- core/field_multilineinput.ts | 4 - core/field_number.ts | 4 - core/field_registry.ts | 14 +- core/field_textinput.ts | 4 - core/field_variable.ts | 4 - core/flyout_base.ts | 94 +++++--- core/flyout_button.ts | 4 - core/flyout_horizontal.ts | 4 - core/flyout_metrics_manager.ts | 4 - core/flyout_vertical.ts | 24 ++- core/generator.ts | 5 - core/gesture.ts | 66 ++++-- core/grid.ts | 22 +- core/icon.ts | 19 +- core/inject.ts | 20 +- core/input.ts | 4 - core/input_types.ts | 4 - core/insertion_marker_manager.ts | 4 - core/interfaces/i_ast_node_location.ts | 6 +- core/interfaces/i_ast_node_location_svg.ts | 8 +- .../i_ast_node_location_with_block.ts | 10 +- core/interfaces/i_autohideable.ts | 8 +- core/interfaces/i_block_dragger.ts | 12 +- core/interfaces/i_bounded_element.ts | 10 +- core/interfaces/i_bubble.ts | 17 +- core/interfaces/i_collapsible_toolbox_item.ts | 12 +- core/interfaces/i_component.ts | 7 +- core/interfaces/i_connection_checker.ts | 25 ++- core/interfaces/i_contextmenu.ts | 6 +- core/interfaces/i_copyable.ts | 8 +- core/interfaces/i_deletable.ts | 9 +- core/interfaces/i_delete_area.ts | 10 +- core/interfaces/i_drag_target.ts | 17 +- core/interfaces/i_draggable.ts | 6 +- core/interfaces/i_flyout.ts | 42 ++-- core/interfaces/i_keyboard_accessible.ts | 9 +- core/interfaces/i_metrics_manager.ts | 36 ++-- core/interfaces/i_movable.ts | 9 +- core/interfaces/i_positionable.ts | 10 +- core/interfaces/i_registrable.ts | 7 +- core/interfaces/i_registrable_field.ts | 6 +- core/interfaces/i_selectable.ts | 6 +- core/interfaces/i_selectable_toolbox_item.ts | 17 +- core/interfaces/i_serializer.ts | 12 +- core/interfaces/i_styleable.ts | 8 +- core/interfaces/i_toolbox.ts | 27 ++- core/interfaces/i_toolbox_item.ts | 28 ++- core/internal_constants.ts | 11 +- core/keyboard_nav/ast_node.ts | 5 - core/keyboard_nav/basic_cursor.ts | 5 - core/keyboard_nav/cursor.ts | 5 - core/keyboard_nav/marker.ts | 5 - core/keyboard_nav/tab_navigate_cursor.ts | 5 - core/marker_manager.ts | 4 - core/menu.ts | 4 - core/menuitem.ts | 4 - core/metrics_manager.ts | 45 ++-- core/msg.ts | 5 +- core/mutator.ts | 5 - core/names.ts | 4 - core/options.ts | 18 +- core/positionable_helpers.ts | 4 - core/procedures.ts | 4 - core/registry.ts | 5 - core/rendered_connection.ts | 4 - core/renderers/common/block_rendering.ts | 4 - core/renderers/common/constants.ts | 4 - core/renderers/common/debug.ts | 4 - core/renderers/common/debugger.ts | 4 - core/renderers/common/drawer.ts | 4 - core/renderers/common/i_path_object.ts | 5 - core/renderers/common/info.ts | 4 - core/renderers/common/marker_svg.ts | 4 - core/renderers/common/path_object.ts | 4 - core/renderers/common/renderer.ts | 4 - core/renderers/geras/constants.ts | 5 - core/renderers/geras/drawer.ts | 4 - core/renderers/geras/highlight_constants.ts | 4 - core/renderers/geras/highlighter.ts | 5 - core/renderers/geras/info.ts | 5 - .../geras/measurables/inline_input.ts | 5 - .../geras/measurables/statement_input.ts | 5 - core/renderers/geras/path_object.ts | 4 - core/renderers/geras/renderer.ts | 4 - core/renderers/measurables/base.ts | 4 - core/renderers/measurables/bottom_row.ts | 5 - core/renderers/measurables/connection.ts | 5 - .../measurables/external_value_input.ts | 5 - core/renderers/measurables/field.ts | 5 - core/renderers/measurables/hat.ts | 5 - core/renderers/measurables/icon.ts | 5 - core/renderers/measurables/in_row_spacer.ts | 5 - core/renderers/measurables/inline_input.ts | 5 - .../renderers/measurables/input_connection.ts | 4 - core/renderers/measurables/input_row.ts | 5 - core/renderers/measurables/jagged_edge.ts | 5 - core/renderers/measurables/next_connection.ts | 5 - .../measurables/output_connection.ts | 5 - .../measurables/previous_connection.ts | 5 - core/renderers/measurables/round_corner.ts | 5 - core/renderers/measurables/row.ts | 4 - core/renderers/measurables/spacer_row.ts | 4 - core/renderers/measurables/square_corner.ts | 5 - core/renderers/measurables/statement_input.ts | 5 - core/renderers/measurables/top_row.ts | 4 - core/renderers/measurables/types.ts | 4 - core/renderers/minimalist/constants.ts | 5 - core/renderers/minimalist/drawer.ts | 4 - core/renderers/minimalist/info.ts | 4 - core/renderers/minimalist/renderer.ts | 4 - core/renderers/thrasos/info.ts | 5 - core/renderers/thrasos/renderer.ts | 4 - core/renderers/zelos/constants.ts | 5 - core/renderers/zelos/drawer.ts | 4 - core/renderers/zelos/info.ts | 5 - core/renderers/zelos/marker_svg.ts | 4 - .../renderers/zelos/measurables/bottom_row.ts | 4 - core/renderers/zelos/measurables/inputs.ts | 5 - .../zelos/measurables/row_elements.ts | 5 - core/renderers/zelos/measurables/top_row.ts | 4 - core/renderers/zelos/path_object.ts | 4 - core/renderers/zelos/renderer.ts | 4 - core/scrollbar.ts | 4 - core/scrollbar_pair.ts | 4 - core/serialization/blocks.ts | 5 - core/serialization/exceptions.ts | 4 - core/serialization/priorities.ts | 6 - core/serialization/registry.ts | 5 - core/serialization/variables.ts | 5 - core/serialization/workspaces.ts | 5 - core/shortcut_items.ts | 4 - core/shortcut_registry.ts | 5 - core/sprites.ts | 13 -- core/theme.ts | 21 +- core/theme/classic.ts | 5 - core/theme/themes.ts | 5 +- core/theme/zelos.ts | 4 - core/theme_manager.ts | 5 - core/toolbox/category.ts | 4 - core/toolbox/collapsible_category.ts | 4 - core/toolbox/separator.ts | 4 - core/toolbox/toolbox.ts | 4 - core/toolbox/toolbox_item.ts | 4 - core/touch.ts | 4 - core/touch_gesture.ts | 5 - core/trashcan.ts | 4 - core/utils.ts | 4 - core/utils/aria.ts | 6 - core/utils/array.ts | 4 - core/utils/colour.ts | 4 - core/utils/coordinate.ts | 6 - core/utils/deprecation.ts | 5 - core/utils/dom.ts | 6 - core/utils/idgenerator.ts | 4 - core/utils/keycodes.ts | 6 - core/utils/math.ts | 6 - core/utils/metrics.ts | 4 - core/utils/object.ts | 4 - core/utils/parsing.ts | 4 - core/utils/rect.ts | 6 - core/utils/sentinel.ts | 6 +- core/utils/size.ts | 6 - core/utils/string.ts | 6 - core/utils/style.ts | 6 - core/utils/svg.ts | 5 - core/utils/svg_math.ts | 4 - core/utils/svg_paths.ts | 5 - core/utils/toolbox.ts | 4 - core/utils/useragent.ts | 6 - core/utils/xml.ts | 6 - core/variable_map.ts | 4 - core/variable_model.ts | 12 +- core/variables.ts | 4 - core/variables_dynamic.ts | 4 - core/warning.ts | 4 - core/widgetdiv.ts | 6 - core/workspace.ts | 4 - core/workspace_audio.ts | 11 +- core/workspace_comment.ts | 48 +++-- core/workspace_comment_svg.ts | 4 - core/workspace_drag_surface_svg.ts | 7 - core/workspace_dragger.ts | 4 - core/workspace_svg.ts | 201 +++++++++++++----- core/xml.ts | 4 - core/zoom_controls.ts | 4 - 253 files changed, 1079 insertions(+), 1440 deletions(-) diff --git a/core/block.ts b/core/block.ts index 0339d18e3..ec13826ac 100644 --- a/core/block.ts +++ b/core/block.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview The class representing one block. - */ - /** * The class representing one block. * @class diff --git a/core/block_animations.ts b/core/block_animations.ts index 4e9dd5a9c..5db01dd3b 100644 --- a/core/block_animations.ts +++ b/core/block_animations.ts @@ -4,12 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Methods animating a block on connection and disconnection. - */ - /** * Methods animating a block on connection and disconnection. + * * @namespace Blockly.blockAnimations */ import * as goog from '../closure/goog/goog.js'; @@ -37,6 +34,7 @@ let disconnectGroup: SVGElement|null = null; /** * Play some UI effects (sound, animation) when disposing of a block. + * * @param block The block being disposed of. * @alias Blockly.blockAnimations.disposeUiEffect * @internal @@ -59,6 +57,7 @@ export function disposeUiEffect(block: BlockSvg) { * Animate a cloned block and eventually dispose of it. * This is a class method, not an instance method since the original block has * been destroyed and is no longer accessible. + * * @param clone SVG element to animate and dispose of. * @param rect Starting rect of the clone. * @param rtl True if RTL, false if LTR. @@ -87,6 +86,7 @@ function disposeUiStep( /** * Play some UI effects (sound, ripple) after a connection has been established. + * * @param block The block being connected. * @alias Blockly.blockAnimations.connectionUiEffect * @internal @@ -124,6 +124,7 @@ export function connectionUiEffect(block: BlockSvg) { /** * Expand a ripple around a connection. + * * @param ripple Element to animate. * @param start Date of animation's start. * @param scale Scale of workspace. @@ -142,6 +143,7 @@ function connectionUiStep(ripple: SVGElement, start: Date, scale: number) { /** * Play some UI effects (sound, animation) when disconnecting a block. + * * @param block The block being disconnected. * @alias Blockly.blockAnimations.disconnectUiEffect * @internal @@ -167,6 +169,7 @@ export function disconnectUiEffect(block: BlockSvg) { /** * Animate a brief wiggle of a disconnected block. + * * @param group SVG element to animate. * @param magnitude Maximum degrees skew (reversed for RTL). * @param start Date of animation's start. @@ -190,6 +193,7 @@ function disconnectUiStep(group: SVGElement, magnitude: number, start: Date) { /** * Stop the disconnect UI animation immediately. + * * @alias Blockly.blockAnimations.disconnectUiStop * @internal */ diff --git a/core/block_drag_surface.ts b/core/block_drag_surface.ts index 7bd4dcfd5..b6373feba 100644 --- a/core/block_drag_surface.ts +++ b/core/block_drag_surface.ts @@ -4,15 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview A class that manages a surface for dragging blocks. When a - * block drag is started, we move the block (and children) to a separate DOM - * element that we move around using translate3d. At the end of the drag, the - * blocks are put back in into the SVG they came from. This helps - * performance by avoiding repainting the entire SVG on every mouse move - * while dragging blocks. - */ - /** * A class that manages a surface for dragging blocks. When a * block drag is started, we move the block (and children) to a separate DOM diff --git a/core/block_dragger.ts b/core/block_dragger.ts index c540fd2a8..16867265e 100644 --- a/core/block_dragger.ts +++ b/core/block_dragger.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Methods for dragging a block visually. - */ - /** * Methods for dragging a block visually. * @class diff --git a/core/block_svg.ts b/core/block_svg.ts index c5ac9034e..dbd707d9b 100644 --- a/core/block_svg.ts +++ b/core/block_svg.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Methods for graphically rendering a block as SVG. - */ - /** * Methods for graphically rendering a block as SVG. * @class diff --git a/core/blockly.ts b/core/blockly.ts index 08afa5a34..9590a8ad0 100644 --- a/core/blockly.ts +++ b/core/blockly.ts @@ -4,12 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview The top level namespace used to access the Blockly library. - */ - /** * The top level namespace used to access the Blockly library. + * * @namespace Blockly */ import * as goog from '../closure/goog/goog.js'; @@ -186,6 +183,7 @@ import {ZoomControls} from './zoom_controls.js'; * buildCompressed gulp task. * For local builds, you can pass --define='Blockly.VERSION=X.Y.Z' to the * compiler to override this constant. + * * @define {string} * @alias Blockly.VERSION */ @@ -290,6 +288,7 @@ export const TOOLBOX_AT_RIGHT = toolbox.Position.RIGHT; * See workspace.resizeContents to resize the workspace when the contents * change (e.g. when a block is added or removed). * Record the height/width of the SVG image. + * * @param workspace Any workspace in the SVG. * @see Blockly.common.svgResize * @alias Blockly.svgResize @@ -298,6 +297,7 @@ export const svgResize = common.svgResize; /** * Close tooltips, context menus, dropdown selections, etc. + * * @param opt_onlyClosePopups Whether only popups should be closed. * @see Blockly.WorkspaceSvg.hideChaff * @alias Blockly.hideChaff @@ -310,6 +310,7 @@ export function hideChaff(opt_onlyClosePopups?: boolean) { * Returns the main workspace. Returns the last used main workspace (based on * focus). Try not to use this function, particularly if there are multiple * Blockly instances on a page. + * * @see Blockly.common.getMainWorkspace * @alias Blockly.getMainWorkspace */ @@ -317,6 +318,7 @@ export const getMainWorkspace = common.getMainWorkspace; /** * Returns the currently selected copyable object. + * * @alias Blockly.common.getSelected */ export const getSelected = common.getSelected; @@ -324,6 +326,7 @@ export const getSelected = common.getSelected; /** * Define blocks from an array of JSON block definitions, as might be generated * by the Blockly Developer Tools. + * * @param jsonArray An array of JSON block definitions. * @see Blockly.common.defineBlocksWithJsonArray * @alias Blockly.defineBlocksWithJsonArray @@ -335,6 +338,7 @@ export const defineBlocksWithJsonArray = common.defineBlocksWithJsonArray; * dropDownDiv, and Tooltip are rendered into the first time `Blockly.inject` * is called. * This method is a NOP if called after the first ``Blockly.inject``. + * * @param container The container element. * @see Blockly.common.setParentContainer * @alias Blockly.setParentContainer @@ -343,8 +347,9 @@ export const setParentContainer = common.setParentContainer; /** * Returns the dimensions of the specified SVG image. + * * @param svg SVG image. - * @return Contains width and height properties. + * @returns Contains width and height properties. * @deprecated Use workspace.setCachedParentSvgSize. (2021 March 5) * @see Blockly.WorkspaceSvg.setCachedParentSvgSize * @alias Blockly.svgSize @@ -354,6 +359,7 @@ export const svgSize = svgMath.svgSize; /** * Size the workspace when the contents change. This also updates * scrollbars accordingly. + * * @param workspace The workspace to resize. * @deprecated Use workspace.resizeContents. (2021 December) * @see Blockly.WorkspaceSvg.resizeContents @@ -369,6 +375,7 @@ export const resizeSvgContents = resizeSvgContentsLocal; /** * Copy a block or workspace comment onto the local clipboard. + * * @param toCopy Block or Workspace Comment to be copied. * @deprecated Use Blockly.clipboard.copy(). (2021 December) * @see Blockly.clipboard.copy @@ -383,7 +390,8 @@ export function copy(toCopy: ICopyable) { /** * Paste a block or workspace comment on to the main workspace. - * @return True if the paste was successful, false otherwise. + * + * @returns True if the paste was successful, false otherwise. * @deprecated Use Blockly.clipboard.paste(). (2021 December) * @see Blockly.clipboard.paste * @alias Blockly.paste @@ -397,6 +405,7 @@ export function paste(): boolean { /** * Duplicate this block and its children, or a workspace comment. + * * @param toDuplicate Block or Workspace Comment to be copied. * @deprecated Use Blockly.clipboard.duplicate(). (2021 December) * @see Blockly.clipboard.duplicate @@ -411,8 +420,9 @@ export function duplicate(toDuplicate: ICopyable) { /** * Is the given string a number (includes negative and decimals). + * * @param str Input string. - * @return True if number, false otherwise. + * @returns True if number, false otherwise. * @deprecated Use Blockly.utils.string.isNumber(str). (2021 December) * @see Blockly.utils.string.isNumber * @alias Blockly.isNumber @@ -426,8 +436,9 @@ export function isNumber(str: string): boolean { /** * Convert a hue (HSV model) into an RGB hex triplet. + * * @param hue Hue on a colour wheel (0-360). - * @return RGB code, e.g. '#5ba65b'. + * @returns RGB code, e.g. '#5ba65b'. * @deprecated Use Blockly.utils.colour.hueToHex(). (2021 December) * @see Blockly.utils.colour.hueToHex * @alias Blockly.hueToHex @@ -444,11 +455,12 @@ export function hueToHex(hue: number): string { * of the active touch stream. * Use this for events that are not part of a multi-part gesture (e.g. * mouseover for tooltips). + * * @param node Node upon which to listen. * @param name Event name to listen to (e.g. 'mousedown'). * @param thisObject The value of 'this' in the function. * @param func Function to call when event is triggered. - * @return Opaque data that can be passed to unbindEvent_. + * @returns Opaque data that can be passed to unbindEvent_. * @deprecated Use Blockly.browserEvents.bind(). (December 2021) * @see Blockly.browserEvents.bind * @alias Blockly.bindEvent_ @@ -464,9 +476,10 @@ export function bindEvent_( /** * Unbind one or more events event from a function call. + * * @param bindData Opaque data from bindEvent_. * This list is emptied during the course of calling this function. - * @return The function call. + * @returns The function call. * @deprecated Use Blockly.browserEvents.unbind(). (December 2021) * @see browserEvents.unbind * @alias Blockly.unbindEvent_ @@ -483,6 +496,7 @@ export function unbindEvent_(bindData: browserEvents.Data): Function { * touch stream. * Use this for events that either start or continue a multi-part gesture (e.g. * mousedown or mousemove, which may be part of a drag or click). + * * @param node Node upon which to listen. * @param name Event name to listen to (e.g. 'mousedown'). * @param thisObject The value of 'this' in the function. @@ -493,7 +507,7 @@ export function unbindEvent_(bindData: browserEvents.Data): Function { * @param opt_noPreventDefault True if triggering on this event should prevent * the default handler. False by default. If opt_noPreventDefault is * provided, opt_noCaptureIdentifier must also be provided. - * @return Opaque data that can be passed to unbindEvent_. + * @returns Opaque data that can be passed to unbindEvent_. * @deprecated Use Blockly.browserEvents.conditionalBind(). (December 2021) * @see browserEvents.conditionalBind * @alias Blockly.bindEventWithChecks_ @@ -523,6 +537,7 @@ export const COLLAPSED_FIELD_NAME = constants.COLLAPSED_FIELD_NAME; * String for use in the "custom" attribute of a category in toolbox XML. * This string indicates that the category should be dynamically populated with * variable blocks. + * * @alias Blockly.VARIABLE_CATEGORY_NAME */ export const VARIABLE_CATEGORY_NAME: string = Variables.CATEGORY_NAME; @@ -531,6 +546,7 @@ export const VARIABLE_CATEGORY_NAME: string = Variables.CATEGORY_NAME; * String for use in the "custom" attribute of a category in toolbox XML. * This string indicates that the category should be dynamically populated with * variable blocks. + * * @alias Blockly.VARIABLE_DYNAMIC_CATEGORY_NAME */ export const VARIABLE_DYNAMIC_CATEGORY_NAME: string = @@ -539,6 +555,7 @@ export const VARIABLE_DYNAMIC_CATEGORY_NAME: string = * String for use in the "custom" attribute of a category in toolbox XML. * This string indicates that the category should be dynamically populated with * procedure blocks. + * * @alias Blockly.PROCEDURE_CATEGORY_NAME */ export const PROCEDURE_CATEGORY_NAME: string = Procedures.CATEGORY_NAME; diff --git a/core/blockly_options.ts b/core/blockly_options.ts index 6f3c352a2..0613a9fe6 100644 --- a/core/blockly_options.ts +++ b/core/blockly_options.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Object that defines user-specified options for the workspace. - */ - /** * Object that defines user-specified options for the workspace. * @namespace Blockly.BlocklyOptions diff --git a/core/blocks.ts b/core/blocks.ts index c57e5a8bd..37ad4d01a 100644 --- a/core/blocks.ts +++ b/core/blocks.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview A mapping of block type names to block prototype objects. - */ - /** * A mapping of block type names to block prototype objects. * @namespace Blockly.blocks diff --git a/core/browser_events.ts b/core/browser_events.ts index fb449e012..efed4a34d 100644 --- a/core/browser_events.ts +++ b/core/browser_events.ts @@ -4,12 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Browser event handling. - */ - /** * Browser event handling. + * * @namespace Blockly.browserEvents */ import * as goog from '../closure/goog/goog.js'; @@ -22,6 +19,7 @@ import * as userAgent from './utils/useragent.js'; /** * Blockly opaque event data used to unbind events when using * `bind` and `conditionalBind`. + * * @alias Blockly.browserEvents.Data */ export type Data = [EventTarget, string, (e: Event) => void][]; @@ -45,6 +43,7 @@ const PAGE_MODE_MULTIPLIER = 125; * touch stream. * Use this for events that either start or continue a multi-part gesture (e.g. * mousedown or mousemove, which may be part of a drag or click). + * * @param node Node upon which to listen. * @param name Event name to listen to (e.g. 'mousedown'). * @param thisObject The value of 'this' in the function. @@ -55,13 +54,17 @@ const PAGE_MODE_MULTIPLIER = 125; * @param opt_noPreventDefault True if triggering on this event should prevent * the default handler. False by default. If opt_noPreventDefault is * provided, opt_noCaptureIdentifier must also be provided. - * @return Opaque data that can be passed to unbindEvent_. + * @returns Opaque data that can be passed to unbindEvent_. * @alias Blockly.browserEvents.conditionalBind */ export function conditionalBind( node: EventTarget, name: string, thisObject: Object|null, func: Function, opt_noCaptureIdentifier?: boolean, opt_noPreventDefault?: boolean): Data { let handled = false; + /** + * + * @param e + */ function wrapFunc(e: Event) { const captureIdentifier = !opt_noCaptureIdentifier; // Handle each touch point separately. If the event was a mouse event, this @@ -119,16 +122,21 @@ export function conditionalBind( * of the active touch stream. * Use this for events that are not part of a multi-part gesture (e.g. * mouseover for tooltips). + * * @param node Node upon which to listen. * @param name Event name to listen to (e.g. 'mousedown'). * @param thisObject The value of 'this' in the function. * @param func Function to call when event is triggered. - * @return Opaque data that can be passed to unbindEvent_. + * @returns Opaque data that can be passed to unbindEvent_. * @alias Blockly.browserEvents.bind */ export function bind( node: EventTarget, name: string, thisObject: Object|null, func: Function): Data { + /** + * + * @param e + */ function wrapFunc(e: Event) { if (thisObject) { func.call(thisObject, e); @@ -179,9 +187,10 @@ export function bind( /** * Unbind one or more events event from a function call. + * * @param bindData Opaque data from bindEvent_. * This list is emptied during the course of calling this function. - * @return The function call. + * @returns The function call. * @alias Blockly.browserEvents.unbind */ export function unbind(bindData: Data): (e: Event) => void { @@ -201,8 +210,9 @@ export function unbind(bindData: Data): (e: Event) => void { /** * Returns true if this event is targeting a text input widget? + * * @param e An event. - * @return True if text input. + * @returns True if text input. * @alias Blockly.browserEvents.isTargetInput */ export function isTargetInput(e: Event): boolean { @@ -230,8 +240,9 @@ export function isTargetInput(e: Event): boolean { /** * Returns true this event is a right-click. + * * @param e Mouse event. - * @return True if right-click. + * @returns True if right-click. * @alias Blockly.browserEvents.isRightButton */ export function isRightButton(e: MouseEvent): boolean { @@ -246,10 +257,11 @@ export function isRightButton(e: MouseEvent): boolean { /** * Returns the converted coordinates of the given mouse event. * The origin (0,0) is the top-left corner of the Blockly SVG. + * * @param e Mouse event. * @param svg SVG element. * @param matrix Inverted screen CTM to use. - * @return Object with .x and .y properties. + * @returns Object with .x and .y properties. * @alias Blockly.browserEvents.mouseToSvg */ export function mouseToSvg( @@ -266,8 +278,9 @@ export function mouseToSvg( /** * Returns the scroll delta of a mouse event in pixel units. + * * @param e Mouse event. - * @return Scroll delta object with .x and .y properties. + * @returns Scroll delta object with .x and .y properties. * @alias Blockly.browserEvents.getScrollDeltaPixels */ export function getScrollDeltaPixels(e: WheelEvent): {x: number, y: number} { diff --git a/core/bubble.ts b/core/bubble.ts index 4ec2563ae..483f487f6 100644 --- a/core/bubble.ts +++ b/core/bubble.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Object representing a UI bubble. - */ - /** * Object representing a UI bubble. * @class diff --git a/core/bubble_dragger.ts b/core/bubble_dragger.ts index 789cfa0ff..5782ff673 100644 --- a/core/bubble_dragger.ts +++ b/core/bubble_dragger.ts @@ -4,12 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Methods for dragging a bubble visually. - */ - /** * Methods for dragging a bubble visually. + * * @class */ import * as goog from '../closure/goog/goog.js'; @@ -37,6 +34,7 @@ import type {WorkspaceSvg} from './workspace_svg.js'; * Class for a bubble dragger. It moves things on the bubble canvas around the * workspace when they are being dragged by a mouse or touch. These can be * block comments, mutators, warnings, or workspace comments. + * * @alias Blockly.BubbleDragger */ export class BubbleDragger { @@ -71,6 +69,7 @@ export class BubbleDragger { /** * Start dragging a bubble. This includes moving it to the drag surface. + * * @internal */ startBubbleDrag() { @@ -93,6 +92,7 @@ export class BubbleDragger { /** * Execute a step of bubble dragging, based on the given event. Update the * display accordingly. + * * @param e The most recent move event. * @param currentDragDeltaXY How far the pointer has moved from the position * at the start of the drag, in pixel units. @@ -123,8 +123,9 @@ export class BubbleDragger { /** * Whether ending the drag would delete the bubble. + * * @param dragTarget The drag target that the bubblee is currently over. - * @return Whether dropping the bubble immediately would delete the block. + * @returns Whether dropping the bubble immediately would delete the block. */ private shouldDelete_(dragTarget: IDragTarget|null): boolean { if (dragTarget) { @@ -148,6 +149,7 @@ export class BubbleDragger { /** * Finish a bubble drag and put the bubble back on the workspace. + * * @param e The mouseup/touchend event. * @param currentDragDeltaXY How far the pointer has moved from the position * at the start of the drag, in pixel units. @@ -210,8 +212,9 @@ export class BubbleDragger { * correction for mutator workspaces. * This function does not consider differing origins. It simply scales the * input's x and y values. + * * @param pixelCoord A coordinate with x and y values in CSS pixel units. - * @return The input coordinate divided by the workspace scale. + * @returns The input coordinate divided by the workspace scale. */ private pixelsToWorkspaceUnits_(pixelCoord: Coordinate): Coordinate { const result = new Coordinate( diff --git a/core/bump_objects.ts b/core/bump_objects.ts index ea247bf76..51467ae25 100644 --- a/core/bump_objects.ts +++ b/core/bump_objects.ts @@ -4,12 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Utilities for bumping objects back into worksapce bounds. - */ - /** * Utilities for bumping objects back into worksapce bounds. + * * @namespace Blockly.bumpObjects */ import * as goog from '../closure/goog/goog.js'; @@ -32,11 +29,12 @@ import type {WorkspaceSvg} from './workspace_svg.js'; /** * Bumps the given object that has passed out of bounds. + * * @param workspace The workspace containing the object. * @param scrollMetrics Scroll metrics * in workspace coordinates. * @param object The object to bump. - * @return True if block was bumped. + * @returns True if block was bumped. * @alias Blockly.bumpObjects.bumpIntoBounds */ function bumpObjectIntoBounds( @@ -86,8 +84,9 @@ export const bumpIntoBounds = bumpObjectIntoBounds; /** * Creates a handler for bumping objects when they cross fixed bounds. + * * @param workspace The workspace to handle. - * @return The event handler. + * @returns The event handler. * @alias Blockly.bumpObjects.bumpIntoBoundsHandler */ export function bumpIntoBoundsHandler(workspace: WorkspaceSvg): @@ -134,10 +133,11 @@ export function bumpIntoBoundsHandler(workspace: WorkspaceSvg): /** * Extracts the object from the given event. + * * @param workspace The workspace the event originated * from. * @param e An event containing an object. - * @return The extracted + * @returns The extracted * object. */ function extractObjectFromEvent( @@ -165,6 +165,7 @@ function extractObjectFromEvent( /** * Bumps the top objects in the given workspace into bounds. + * * @param workspace The workspace. * @alias Blockly.bumpObjects.bumpTopObjectsIntoBounds */ diff --git a/core/clipboard.ts b/core/clipboard.ts index e217af81c..6250b7359 100644 --- a/core/clipboard.ts +++ b/core/clipboard.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Blockly's internal clipboard for managing copy-paste. - */ - /** * Blockly's internal clipboard for managing copy-paste. * @namespace Blockly.clipboard diff --git a/core/comment.ts b/core/comment.ts index b408b1a69..089a62d81 100644 --- a/core/comment.ts +++ b/core/comment.ts @@ -4,12 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Object representing a code comment. - */ - /** * Object representing a code comment. + * * @class */ import * as goog from '../closure/goog/goog.js'; @@ -44,6 +41,7 @@ import * as userAgent from './utils/useragent.js'; /** * Class for a comment. + * * @alias Blockly.Comment */ export class Comment extends Icon { @@ -94,6 +92,7 @@ export class Comment extends Icon { /** * Draw the comment icon. + * * @param group The icon group. */ protected override drawIcon_(group: Element) { @@ -125,7 +124,8 @@ export class Comment extends Icon { /** * Create the editor for the comment's bubble. - * @return The top-level node of the editor. + * + * @returns The top-level node of the editor. */ private createEditor_(): SVGElement { /* Create the editor. Here's the markup that will be generated in @@ -171,7 +171,10 @@ export class Comment extends Icon { }); this.onChangeWrapper_ = browserEvents.conditionalBind( textarea, 'change', this, - /** @param _e Unused event parameter. */ + /** + * @param this + * @param _e Unused event parameter. + */ function(this: Comment, _e: Event) { if (this.cachedText_ !== this.model_.text) { eventUtils.fire(new (eventUtils.get(eventUtils.BLOCK_CHANGE))! @@ -181,7 +184,10 @@ export class Comment extends Icon { }); this.onInputWrapper_ = browserEvents.conditionalBind( textarea, 'input', this, - /** @param _e Unused event parameter. */ + /** + * @param this + * @param _e Unused event parameter. + */ function(this: Comment, _e: Event) { this.model_.text = textarea.value; }); @@ -238,6 +244,7 @@ export class Comment extends Icon { /** * Show or hide the comment bubble. + * * @param visible True if the bubble should be visible. */ override setVisible(visible: boolean) { @@ -280,6 +287,7 @@ export class Comment extends Icon { /** * Show a non-editable bubble. + * * @suppress {checkTypes} Suppress `this` type mismatch. */ private createNonEditableBubble_() { @@ -292,6 +300,7 @@ export class Comment extends Icon { /** * Dispose of the bubble. + * * @suppress {checkTypes} Suppress `this` type mismatch. */ private disposeBubble_() { @@ -323,6 +332,7 @@ export class Comment extends Icon { * * Bring the comment to the top of the stack when clicked on. Also cache the * current text so it can be used to fire a change event. + * * @param _e Mouse up event. */ private startEdit_(_e: Event) { @@ -337,7 +347,8 @@ export class Comment extends Icon { /** * Get the dimensions of this comment's bubble. - * @return Object with width and height properties. + * + * @returns Object with width and height properties. */ getBubbleSize(): Size { return this.model_.size; @@ -345,6 +356,7 @@ export class Comment extends Icon { /** * Size this comment's bubble. + * * @param width Width of the bubble. * @param height Height of the bubble. */ @@ -359,6 +371,7 @@ export class Comment extends Icon { /** * Update the comment's view to match the model. + * * @internal */ updateText() { diff --git a/core/common.ts b/core/common.ts index 1c43f84d4..6c0956da4 100644 --- a/core/common.ts +++ b/core/common.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Common functions used both internally and externally, but which - * must not be at the top level to avoid circular dependencies. - */ - /** * Common functions used both internally and externally, but which * must not be at the top level to avoid circular dependencies. diff --git a/core/component_manager.ts b/core/component_manager.ts index 12a934087..4361e899e 100644 --- a/core/component_manager.ts +++ b/core/component_manager.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Manager for all items registered with the workspace. - */ - /** * Manager for all items registered with the workspace. * @class diff --git a/core/config.ts b/core/config.ts index 64f10199c..aa8bc9f5e 100644 --- a/core/config.ts +++ b/core/config.ts @@ -4,16 +4,11 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview All the values that we expect developers to be able to change - * before injecting Blockly. Changing these values during run time is not - * generally recommended. - */ - /** * All the values that we expect developers to be able to change * before injecting Blockly. Changing these values during run time is not * generally recommended. + * * @namespace Blockly.config */ import * as goog from '../closure/goog/goog.js'; @@ -43,6 +38,7 @@ const DEFAULT_SNAP_RADIUS = 28; export const config: Config = { /** * Number of pixels the mouse must move before a drag starts. + * * @alias Blockly.config.dragRadius */ dragRadius: 5, @@ -50,17 +46,20 @@ export const config: Config = { * Number of pixels the mouse must move before a drag/scroll starts from the * flyout. Because the drag-intention is determined when this is reached, it * is larger than dragRadius so that the drag-direction is clearer. + * * @alias Blockly.config.flyoutDragRadius */ flyoutDragRadius: 10, /** * Maximum misalignment between connections for them to snap together. + * * @alias Blockly.config.snapRadius */ snapRadius: DEFAULT_SNAP_RADIUS, /** * Maximum misalignment between connections for them to snap together. * This should be the same as the snap radius. + * * @alias Blockly.config.connectingSnapRadius */ connectingSnapRadius: DEFAULT_SNAP_RADIUS, @@ -69,11 +68,13 @@ export const config: Config = { * to a new connection. The current previewed connection is considered to be * this much closer to the matching connection on the block than it actually * is. + * * @alias Blockly.config.currentConnectionPreference */ currentConnectionPreference: 8, /** * Delay in ms between trigger and bumping unconnected block out of alignment. + * * @alias Blockly.config.bumpDelay */ bumpDelay: 250, diff --git a/core/connection.ts b/core/connection.ts index 8dadd3439..e14da6d05 100644 --- a/core/connection.ts +++ b/core/connection.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Components for creating connections between blocks. - */ - /** * Components for creating connections between blocks. * @class diff --git a/core/connection_checker.ts b/core/connection_checker.ts index 151309c80..e2031262b 100644 --- a/core/connection_checker.ts +++ b/core/connection_checker.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview An object that encapsulates logic for checking whether a - * potential connection is safe and valid. - */ - /** * An object that encapsulates logic for checking whether a * potential connection is safe and valid. diff --git a/core/connection_db.ts b/core/connection_db.ts index dfde386b6..9f0dd54ae 100644 --- a/core/connection_db.ts +++ b/core/connection_db.ts @@ -4,16 +4,11 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview A database of all the rendered connections that could - * possibly be connected to (i.e. not collapsed, etc). - * Sorted by y coordinate. - */ - /** * A database of all the rendered connections that could * possibly be connected to (i.e. not collapsed, etc). * Sorted by y coordinate. + * * @class */ import * as goog from '../closure/goog/goog.js'; @@ -32,6 +27,7 @@ import type {Coordinate} from './utils/coordinate.js'; * Database of connections. * Connections are stored in order of their vertical component. This way * connections in an area may be looked up quickly using a binary search. + * * @alias Blockly.ConnectionDB */ export class ConnectionDB { @@ -46,6 +42,7 @@ export class ConnectionDB { /** * Add a connection to the database. Should not already exist in the database. + * * @param connection The connection to be added. * @param yPos The y position used to decide where to insert the connection. * @internal @@ -60,9 +57,10 @@ export class ConnectionDB { * * Starts by doing a binary search to find the approximate location, then * linearly searches nearby for the exact connection. + * * @param conn The connection to find. * @param yPos The y position used to find the index of the connection. - * @return The index of the connection, or -1 if the connection was not found. + * @returns The index of the connection, or -1 if the connection was not found. */ private findIndexOfConnection_(conn: RenderedConnection, yPos: number): number { @@ -99,8 +97,9 @@ export class ConnectionDB { /** * Finds the correct index for the given y position. + * * @param yPos The y position used to decide where to insert the connection. - * @return The candidate index. + * @returns The candidate index. */ private calculateIndexForYPos_(yPos: number): number { if (!this.connections_.length) { @@ -124,6 +123,7 @@ export class ConnectionDB { /** * Remove a connection from the database. Must already exist in DB. + * * @param connection The connection to be removed. * @param yPos The y position used to find the index of the connection. * @throws {Error} If the connection cannot be found in the database. @@ -139,9 +139,10 @@ export class ConnectionDB { /** * Find all nearby connections to the given connection. * Type checking does not apply, since this function is used for bumping. + * * @param connection The connection whose neighbours should be returned. * @param maxRadius The maximum radius to another connection. - * @return List of connections. + * @returns List of connections. */ getNeighbours(connection: RenderedConnection, maxRadius: number): RenderedConnection[] { @@ -167,8 +168,9 @@ export class ConnectionDB { * Computes if the current connection is within the allowed radius of * another connection. This function is a closure and has access to outside * variables. + * * @param yIndex The other connection's index in the database. - * @return True if the current connection's vertical distance from the other + * @returns True if the current connection's vertical distance from the other * connection is less than the allowed radius. */ function checkConnection_(yIndex: number): boolean { @@ -199,10 +201,11 @@ export class ConnectionDB { /** * Is the candidate connection close to the reference connection. * Extremely fast; only looks at Y distance. + * * @param index Index in database of candidate connection. * @param baseY Reference connection's Y value. * @param maxRadius The maximum radius to another connection. - * @return True if connection is in range. + * @returns True if connection is in range. */ private isInYRange_(index: number, baseY: number, maxRadius: number): boolean { @@ -211,11 +214,12 @@ export class ConnectionDB { /** * Find the closest compatible connection to this connection. + * * @param conn The connection searching for a compatible mate. * @param maxRadius The maximum radius to another connection. * @param dxy Offset between this connection's location in the database and * the current location (as a result of dragging). - * @return Contains two properties: 'connection' which is either another + * @returns Contains two properties: 'connection' which is either another * connection or null, and 'radius' which is the distance. */ searchForClosest( @@ -273,9 +277,10 @@ export class ConnectionDB { /** * Initialize a set of connection DBs for a workspace. + * * @param checker The workspace's connection checker, used to decide if * connections are valid during a drag. - * @return Array of databases. + * @returns Array of databases. */ static init(checker: IConnectionChecker): ConnectionDB[] { // Create four databases, one for each connection type. diff --git a/core/connection_type.ts b/core/connection_type.ts index 337fa225c..1ad69a135 100644 --- a/core/connection_type.ts +++ b/core/connection_type.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview An enum for the possible types of connections. - */ - /** * An enum for the possible types of connections. * @namespace Blockly.ConnectionType diff --git a/core/constants.ts b/core/constants.ts index 15f08f077..ad68d938a 100644 --- a/core/constants.ts +++ b/core/constants.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Blockly constants. - */ - /** * Blockly constants. * @namespace Blockly.constants diff --git a/core/contextmenu.ts b/core/contextmenu.ts index 9c16ae4f2..135c874eb 100644 --- a/core/contextmenu.ts +++ b/core/contextmenu.ts @@ -4,12 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Functionality for the right-click context menus. - */ - /** * Functionality for the right-click context menus. + * * @namespace Blockly.ContextMenu */ import * as goog from '../closure/goog/goog.js'; @@ -46,7 +43,8 @@ const dummyOwner = {}; /** * Gets the block the context menu is currently attached to. - * @return The block the context menu is attached to. + * + * @returns The block the context menu is attached to. * @alias Blockly.ContextMenu.getCurrentBlock */ export function getCurrentBlock(): Block|null { @@ -55,6 +53,7 @@ export function getCurrentBlock(): Block|null { /** * Sets the block the context menu is currently attached to. + * * @param block The block the context menu is attached to. * @alias Blockly.ContextMenu.setCurrentBlock */ @@ -69,6 +68,7 @@ let menu_: Menu|null = null; /** * Construct the menu based on the list of options and show the menu. + * * @param e Mouse event. * @param options Array of menu options. * @param rtl True if RTL, false if LTR. @@ -96,9 +96,10 @@ export function show( /** * Create the context menu object and populate it with the given options. + * * @param options Array of menu options. * @param rtl True if RTL, false if LTR. - * @return The menu that will be shown on right click. + * @returns The menu that will be shown on right click. */ function populate_( options: (ContextMenuOption|LegacyContextMenuOption)[], @@ -134,6 +135,7 @@ function populate_( /** * Add the menu to the page and position it correctly. + * * @param menu The menu to add and position. * @param e Mouse event for the right click that is making the context * menu appear. @@ -170,6 +172,7 @@ function position_(menu: Menu, e: Event, rtl: boolean) { /** * Create and render the menu widget inside Blockly's widget div. + * * @param menu The menu to add to the widget div. */ function createWidget_(menu: Menu) { @@ -188,6 +191,7 @@ function createWidget_(menu: Menu) { } /** * Halts the propagation of the event without doing anything else. + * * @param e An event. */ function haltPropagation(e: Event) { @@ -198,6 +202,7 @@ function haltPropagation(e: Event) { /** * Hide the context menu. + * * @alias Blockly.ContextMenu.hide */ export function hide() { @@ -207,6 +212,7 @@ export function hide() { /** * Dispose of the menu. + * * @alias Blockly.ContextMenu.dispose */ export function dispose() { @@ -219,9 +225,10 @@ export function dispose() { /** * Create a callback function that creates and configures a block, * then places the new block next to the original. + * * @param block Original block. * @param xml XML representation of new block. - * @return Function that creates a block. + * @returns Function that creates a block. * @alias Blockly.ContextMenu.callbackFactory */ export function callbackFactory(block: Block, xml: Element): Function { @@ -253,9 +260,10 @@ export function callbackFactory(block: Block, xml: Element): Function { /** * Make a context menu option for deleting the current workspace comment. + * * @param comment The workspace comment where the * right-click originated. - * @return A menu option, + * @returns A menu option, * containing text, enabled, and a callback. * @alias Blockly.ContextMenu.commentDeleteOption * @internal @@ -276,9 +284,10 @@ export function commentDeleteOption(comment: WorkspaceCommentSvg): /** * Make a context menu option for duplicating the current workspace comment. + * * @param comment The workspace comment where the * right-click originated. - * @return A menu option, + * @returns A menu option, * containing text, enabled, and a callback. * @alias Blockly.ContextMenu.commentDuplicateOption * @internal @@ -297,10 +306,11 @@ export function commentDuplicateOption(comment: WorkspaceCommentSvg): /** * Make a context menu option for adding a comment on the workspace. + * * @param ws The workspace where the right-click * originated. * @param e The right-click mouse event. - * @return A menu option, containing text, enabled, and a callback. + * @returns A menu option, containing text, enabled, and a callback. * @suppress {strictModuleDepCheck,checkTypes} Suppress checks while workspace * comments are not bundled in. * @alias Blockly.ContextMenu.workspaceCommentOption @@ -310,6 +320,9 @@ export function workspaceCommentOption( ws: WorkspaceSvg, e: Event): ContextMenuOption { // Helper function to create and position a comment correctly based on the // location of the mouse event. + /** + * + */ function addWsComment() { const comment = new WorkspaceCommentSvg( ws, Msg['WORKSPACE_COMMENT_DEFAULT_TEXT'], diff --git a/core/contextmenu_items.ts b/core/contextmenu_items.ts index e605a7e47..cc3a3748c 100644 --- a/core/contextmenu_items.ts +++ b/core/contextmenu_items.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Registers default context menu items. - */ - /** * Registers default context menu items. * @namespace Blockly.ContextMenuItems diff --git a/core/contextmenu_registry.ts b/core/contextmenu_registry.ts index fc0fe3ef6..ff763500a 100644 --- a/core/contextmenu_registry.ts +++ b/core/contextmenu_registry.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Registry for context menu option items. - */ - /** * Registry for context menu option items. * @class diff --git a/core/css.ts b/core/css.ts index 02300946c..02c4e2a9d 100644 --- a/core/css.ts +++ b/core/css.ts @@ -4,12 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Inject Blockly's CSS synchronously. - */ - /** * Inject Blockly's CSS synchronously. + * * @namespace Blockly.Css */ import * as goog from '../closure/goog/goog.js'; @@ -24,6 +21,7 @@ let injected = false; /** * Add some CSS to the blob that will be injected later. Allows optional * components such as fields and the toolbox to store separate CSS. + * * @param cssContent Multiline CSS string or an array of single lines of CSS. * @alias Blockly.Css.register */ @@ -49,6 +47,7 @@ export function register(cssContent: string|string[]) { * a) It loads synchronously and doesn't force a redraw later. * b) It speeds up loading by not blocking on a separate HTTP transfer. * c) The CSS content may be made dynamic depending on init options. + * * @param hasCss If false, don't inject CSS (providing CSS becomes the * document's responsibility). * @param pathToMedia Path from page to the Blockly media directory. @@ -79,6 +78,7 @@ export function inject(hasCss: boolean, pathToMedia: string) { /** * The CSS content for Blockly. + * * @alias Blockly.Css.content */ let content = ` diff --git a/core/delete_area.ts b/core/delete_area.ts index c0e6fe6d3..e57194255 100644 --- a/core/delete_area.ts +++ b/core/delete_area.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview The abstract class for a component that can delete a block or - * bubble that is dropped on top of it. - */ - /** * The abstract class for a component that can delete a block or * bubble that is dropped on top of it. diff --git a/core/dialog.ts b/core/dialog.ts index c19ab5cc1..2518e7a60 100644 --- a/core/dialog.ts +++ b/core/dialog.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Wrapper functions around JS functions for showing - * alert/confirmation dialogs. - */ - /** * Wrapper functions around JS functions for showing alert/confirmation dialogs. * @namespace Blockly.dialog diff --git a/core/drag_target.ts b/core/drag_target.ts index e35148f07..996c42519 100644 --- a/core/drag_target.ts +++ b/core/drag_target.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview The abstract class for a component with custom behaviour when a - * block or bubble is dragged over or dropped on top of it. - */ - /** * The abstract class for a component with custom behaviour when a * block or bubble is dragged over or dropped on top of it. diff --git a/core/dropdowndiv.ts b/core/dropdowndiv.ts index b6a6def74..1a7abbb53 100644 --- a/core/dropdowndiv.ts +++ b/core/dropdowndiv.ts @@ -5,11 +5,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview A div that floats on top of the workspace, for drop-down menus. - * The drop-down can be kept inside the workspace, animate in/out, etc. - */ - /** * A div that floats on top of the workspace, for drop-down menus. * @class diff --git a/core/events/events.ts b/core/events/events.ts index 25d16b946..cc0093111 100644 --- a/core/events/events.ts +++ b/core/events/events.ts @@ -4,12 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Events fired as a result of actions in Blockly's editor. - */ - /** * Events fired as a result of actions in Blockly's editor. + * * @namespace Blockly.Events */ import * as goog from '../../closure/goog/goog.js'; diff --git a/core/events/events_abstract.ts b/core/events/events_abstract.ts index 51bec3406..8602b99d7 100644 --- a/core/events/events_abstract.ts +++ b/core/events/events_abstract.ts @@ -4,14 +4,10 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Abstract class for events fired as a result of actions in - * Blockly's editor. - */ - /** * Abstract class for events fired as a result of actions in * Blockly's editor. + * * @class */ import * as goog from '../../closure/goog/goog.js'; @@ -25,6 +21,7 @@ import * as eventUtils from './utils.js'; /** * Abstract class for an event. + * * @alias Blockly.Events.Abstract */ export abstract class Abstract { @@ -57,7 +54,8 @@ export abstract class Abstract { /** * Encode the event as JSON. - * @return JSON representation. + * + * @returns JSON representation. */ toJson(): AnyDuringMigration { const json = {'type': this.type}; @@ -69,6 +67,7 @@ export abstract class Abstract { /** * Decode the JSON event. + * * @param json JSON representation. */ fromJson(json: AnyDuringMigration) { @@ -78,7 +77,8 @@ export abstract class Abstract { /** * Does this event record any change of state? - * @return True if null, false if something changed. + * + * @returns True if null, false if something changed. */ isNull(): boolean { return false; @@ -86,6 +86,7 @@ export abstract class Abstract { /** * Run an event. + * * @param _forward True if run forward, false if run backward (undo). */ run(_forward: boolean) {} @@ -93,7 +94,8 @@ export abstract class Abstract { /** * Get workspace the event belongs to. - * @return The workspace the event belongs to. + * + * @returns The workspace the event belongs to. * @throws {Error} if workspace is null. * @internal */ diff --git a/core/events/events_block_base.ts b/core/events/events_block_base.ts index b9359f4e0..079acd182 100644 --- a/core/events/events_block_base.ts +++ b/core/events/events_block_base.ts @@ -4,12 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Base class for all types of block events. - */ - /** * Base class for all types of block events. + * * @class */ import * as goog from '../../closure/goog/goog.js'; @@ -22,6 +19,7 @@ import {Abstract as AbstractEvent} from './events_abstract.js'; /** * Abstract class for a block event. + * * @alias Blockly.Events.BlockBase */ export class BlockBase extends AbstractEvent { @@ -46,7 +44,8 @@ export class BlockBase extends AbstractEvent { /** * Encode the event as JSON. - * @return JSON representation. + * + * @returns JSON representation. */ override toJson(): AnyDuringMigration { const json = super.toJson(); @@ -56,6 +55,7 @@ export class BlockBase extends AbstractEvent { /** * Decode the JSON event. + * * @param json JSON representation. */ override fromJson(json: AnyDuringMigration) { diff --git a/core/events/events_block_change.ts b/core/events/events_block_change.ts index bc3228ef8..ddf2762f1 100644 --- a/core/events/events_block_change.ts +++ b/core/events/events_block_change.ts @@ -4,12 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Class for a block change event. - */ - /** * Class for a block change event. + * * @class */ import * as goog from '../../closure/goog/goog.js'; @@ -26,6 +23,7 @@ import * as eventUtils from './utils.js'; /** * Class for a block change event. + * * @alias Blockly.Events.BlockChange */ export class BlockChange extends BlockBase { @@ -63,7 +61,8 @@ export class BlockChange extends BlockBase { /** * Encode the event as JSON. - * @return JSON representation. + * + * @returns JSON representation. */ override toJson(): AnyDuringMigration { const json = super.toJson(); @@ -78,6 +77,7 @@ export class BlockChange extends BlockBase { /** * Decode the JSON event. + * * @param json JSON representation. */ override fromJson(json: AnyDuringMigration) { @@ -90,7 +90,8 @@ export class BlockChange extends BlockBase { /** * Does this event record any change of state? - * @return False if something changed. + * + * @returns False if something changed. */ override isNull(): boolean { return this.oldValue === this.newValue; @@ -98,6 +99,7 @@ export class BlockChange extends BlockBase { /** * Run a change event. + * * @param forward True if run forward, false if run backward (undo). */ override run(forward: boolean) { @@ -157,8 +159,9 @@ export class BlockChange extends BlockBase { /** * Returns the extra state of the given block (either as XML or a JSO, * depending on the block's definition). + * * @param block The block to get the extra state of. - * @return A stringified version of the extra state of the given block. + * @returns A stringified version of the extra state of the given block. * @internal */ static getExtraBlockState_(block: BlockSvg): string { diff --git a/core/events/events_block_create.ts b/core/events/events_block_create.ts index 13413cf6f..b433560e2 100644 --- a/core/events/events_block_create.ts +++ b/core/events/events_block_create.ts @@ -4,12 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Class for a block creation event. - */ - /** * Class for a block creation event. + * * @class */ import * as goog from '../../closure/goog/goog.js'; @@ -26,6 +23,7 @@ import * as eventUtils from './utils.js'; /** * Class for a block creation event. + * * @alias Blockly.Events.BlockCreate */ export class BlockCreate extends BlockBase { @@ -61,7 +59,8 @@ export class BlockCreate extends BlockBase { /** * Encode the event as JSON. - * @return JSON representation. + * + * @returns JSON representation. */ override toJson(): AnyDuringMigration { const json = super.toJson(); @@ -76,6 +75,7 @@ export class BlockCreate extends BlockBase { /** * Decode the JSON event. + * * @param json JSON representation. */ override fromJson(json: AnyDuringMigration) { @@ -90,6 +90,7 @@ export class BlockCreate extends BlockBase { /** * Run a creation event. + * * @param forward True if run forward, false if run backward (undo). */ override run(forward: boolean) { diff --git a/core/events/events_block_delete.ts b/core/events/events_block_delete.ts index f8f3cd82d..b7a1f6f07 100644 --- a/core/events/events_block_delete.ts +++ b/core/events/events_block_delete.ts @@ -4,12 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Class for a block delete event. - */ - /** * Class for a block delete event. + * * @class */ import * as goog from '../../closure/goog/goog.js'; @@ -26,6 +23,7 @@ import * as eventUtils from './utils.js'; /** * Class for a block deletion event. + * * @alias Blockly.Events.BlockDelete */ export class BlockDelete extends BlockBase { @@ -70,7 +68,8 @@ export class BlockDelete extends BlockBase { /** * Encode the event as JSON. - * @return JSON representation. + * + * @returns JSON representation. */ override toJson(): AnyDuringMigration { const json = super.toJson(); @@ -86,6 +85,7 @@ export class BlockDelete extends BlockBase { /** * Decode the JSON event. + * * @param json JSON representation. */ override fromJson(json: AnyDuringMigration) { @@ -102,6 +102,7 @@ export class BlockDelete extends BlockBase { /** * Run a deletion event. + * * @param forward True if run forward, false if run backward (undo). */ override run(forward: boolean) { diff --git a/core/events/events_block_drag.ts b/core/events/events_block_drag.ts index 84860e737..313bf7058 100644 --- a/core/events/events_block_drag.ts +++ b/core/events/events_block_drag.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Events fired as a block drag. - */ - /** * Events fired as a block drag. * @class diff --git a/core/events/events_block_move.ts b/core/events/events_block_move.ts index f50cb8960..995f4c416 100644 --- a/core/events/events_block_move.ts +++ b/core/events/events_block_move.ts @@ -4,12 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Class for a block move event. - */ - /** * Class for a block move event. + * * @class */ import * as goog from '../../closure/goog/goog.js'; @@ -32,6 +29,7 @@ interface BlockLocation { /** * Class for a block move event. Created before the move. + * * @alias Blockly.Events.BlockMove */ export class BlockMove extends BlockBase { @@ -71,7 +69,8 @@ export class BlockMove extends BlockBase { /** * Encode the event as JSON. - * @return JSON representation. + * + * @returns JSON representation. */ override toJson(): AnyDuringMigration { const json = super.toJson(); @@ -93,6 +92,7 @@ export class BlockMove extends BlockBase { /** * Decode the JSON event. + * * @param json JSON representation. */ override fromJson(json: AnyDuringMigration) { @@ -119,7 +119,8 @@ export class BlockMove extends BlockBase { /** * Returns the parentId and input if the block is connected, * or the XY location if disconnected. - * @return Collection of location info. + * + * @returns Collection of location info. */ private currentLocation_(): BlockLocation { const workspace = this.getEventWorkspace_(); @@ -142,7 +143,8 @@ export class BlockMove extends BlockBase { /** * Does this event record any change of state? - * @return False if something changed. + * + * @returns False if something changed. */ override isNull(): boolean { return this.oldParentId === this.newParentId && @@ -152,6 +154,7 @@ export class BlockMove extends BlockBase { /** * Run a move event. + * * @param forward True if run forward, false if run backward (undo). */ override run(forward: boolean) { diff --git a/core/events/events_bubble_open.ts b/core/events/events_bubble_open.ts index aad69b133..21910fa2e 100644 --- a/core/events/events_bubble_open.ts +++ b/core/events/events_bubble_open.ts @@ -4,12 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Events fired as a result of bubble open. - */ - /** * Events fired as a result of bubble open. + * * @class */ import * as goog from '../../closure/goog/goog.js'; @@ -24,6 +21,7 @@ import * as eventUtils from './utils.js'; /** * Class for a bubble open event. + * * @alias Blockly.Events.BubbleOpen */ export class BubbleOpen extends UiBase { @@ -57,7 +55,8 @@ export class BubbleOpen extends UiBase { /** * Encode the event as JSON. - * @return JSON representation. + * + * @returns JSON representation. */ override toJson(): AnyDuringMigration { const json = super.toJson(); @@ -69,6 +68,7 @@ export class BubbleOpen extends UiBase { /** * Decode the JSON event. + * * @param json JSON representation. */ override fromJson(json: AnyDuringMigration) { diff --git a/core/events/events_click.ts b/core/events/events_click.ts index a58a7b8ac..29262b2c6 100644 --- a/core/events/events_click.ts +++ b/core/events/events_click.ts @@ -4,12 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Events fired as a result of UI click in Blockly's editor. - */ - /** * Events fired as a result of UI click in Blockly's editor. + * * @class */ import * as goog from '../../closure/goog/goog.js'; @@ -24,6 +21,7 @@ import * as eventUtils from './utils.js'; /** * Class for a click event. + * * @alias Blockly.Events.Click */ export class Click extends UiBase { @@ -59,7 +57,8 @@ export class Click extends UiBase { /** * Encode the event as JSON. - * @return JSON representation. + * + * @returns JSON representation. */ override toJson(): AnyDuringMigration { const json = super.toJson(); @@ -72,6 +71,7 @@ export class Click extends UiBase { /** * Decode the JSON event. + * * @param json JSON representation. */ override fromJson(json: AnyDuringMigration) { diff --git a/core/events/events_comment_base.ts b/core/events/events_comment_base.ts index 20ff9cb97..e65202a22 100644 --- a/core/events/events_comment_base.ts +++ b/core/events/events_comment_base.ts @@ -4,12 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Base class for comment events. - */ - /** * Base class for comment events. + * * @class */ import * as goog from '../../closure/goog/goog.js'; @@ -27,6 +24,7 @@ import * as eventUtils from './utils.js'; /** * Abstract class for a comment event. + * * @alias Blockly.Events.CommentBase */ export class CommentBase extends AbstractEvent { @@ -62,7 +60,8 @@ export class CommentBase extends AbstractEvent { /** * Encode the event as JSON. - * @return JSON representation. + * + * @returns JSON representation. */ override toJson(): AnyDuringMigration { const json = super.toJson(); @@ -74,6 +73,7 @@ export class CommentBase extends AbstractEvent { /** * Decode the JSON event. + * * @param json JSON representation. */ override fromJson(json: AnyDuringMigration) { @@ -83,6 +83,7 @@ export class CommentBase extends AbstractEvent { /** * Helper function for Comment[Create|Delete] + * * @param event The event to run. * @param create if True then Create, if False then Delete */ diff --git a/core/events/events_comment_change.ts b/core/events/events_comment_change.ts index e3eda33aa..ec98eb312 100644 --- a/core/events/events_comment_change.ts +++ b/core/events/events_comment_change.ts @@ -4,12 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Class for comment change event. - */ - /** * Class for comment change event. + * * @class */ import * as goog from '../../closure/goog/goog.js'; @@ -24,6 +21,7 @@ import * as eventUtils from './utils.js'; /** * Class for a comment change event. + * * @alias Blockly.Events.CommentChange */ export class CommentChange extends CommentBase { @@ -60,7 +58,8 @@ export class CommentChange extends CommentBase { /** * Encode the event as JSON. - * @return JSON representation. + * + * @returns JSON representation. */ override toJson(): AnyDuringMigration { const json = super.toJson(); @@ -71,6 +70,7 @@ export class CommentChange extends CommentBase { /** * Decode the JSON event. + * * @param json JSON representation. */ override fromJson(json: AnyDuringMigration) { @@ -81,7 +81,8 @@ export class CommentChange extends CommentBase { /** * Does this event record any change of state? - * @return False if something changed. + * + * @returns False if something changed. */ override isNull(): boolean { return this.oldContents_ === this.newContents_; @@ -89,6 +90,7 @@ export class CommentChange extends CommentBase { /** * Run a change event. + * * @param forward True if run forward, false if run backward (undo). */ override run(forward: boolean) { diff --git a/core/events/events_comment_create.ts b/core/events/events_comment_create.ts index 8d55e7a5f..55f7b0c9c 100644 --- a/core/events/events_comment_create.ts +++ b/core/events/events_comment_create.ts @@ -4,12 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Class for comment creation event. - */ - /** * Class for comment creation event. + * * @class */ import * as goog from '../../closure/goog/goog.js'; @@ -25,6 +22,7 @@ import * as eventUtils from './utils.js'; /** * Class for a comment creation event. + * * @alias Blockly.Events.CommentCreate */ export class CommentCreate extends CommentBase { @@ -52,7 +50,8 @@ export class CommentCreate extends CommentBase { // TODO (#1266): "Full" and "minimal" serialization. /** * Encode the event as JSON. - * @return JSON representation. + * + * @returns JSON representation. */ override toJson(): AnyDuringMigration { const json = super.toJson(); @@ -62,6 +61,7 @@ export class CommentCreate extends CommentBase { /** * Decode the JSON event. + * * @param json JSON representation. */ override fromJson(json: AnyDuringMigration) { @@ -71,6 +71,7 @@ export class CommentCreate extends CommentBase { /** * Run a creation event. + * * @param forward True if run forward, false if run backward (undo). */ override run(forward: boolean) { diff --git a/core/events/events_comment_delete.ts b/core/events/events_comment_delete.ts index fbb890e3c..8f2c79138 100644 --- a/core/events/events_comment_delete.ts +++ b/core/events/events_comment_delete.ts @@ -4,12 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Class for comment deletion event. - */ - /** * Class for comment deletion event. + * * @class */ import * as goog from '../../closure/goog/goog.js'; @@ -24,6 +21,7 @@ import * as eventUtils from './utils.js'; /** * Class for a comment deletion event. + * * @alias Blockly.Events.CommentDelete */ export class CommentDelete extends CommentBase { @@ -49,7 +47,8 @@ export class CommentDelete extends CommentBase { // TODO (#1266): "Full" and "minimal" serialization. /** * Encode the event as JSON. - * @return JSON representation. + * + * @returns JSON representation. */ override toJson(): AnyDuringMigration { const json = super.toJson(); @@ -58,6 +57,7 @@ export class CommentDelete extends CommentBase { /** * Decode the JSON event. + * * @param json JSON representation. */ override fromJson(json: AnyDuringMigration) { @@ -66,6 +66,7 @@ export class CommentDelete extends CommentBase { /** * Run a creation event. + * * @param forward True if run forward, false if run backward (undo). */ override run(forward: boolean) { diff --git a/core/events/events_comment_move.ts b/core/events/events_comment_move.ts index 49d34f5e7..44344daa6 100644 --- a/core/events/events_comment_move.ts +++ b/core/events/events_comment_move.ts @@ -4,12 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Class for comment move event. - */ - /** * Class for comment move event. + * * @class */ import * as goog from '../../closure/goog/goog.js'; @@ -25,6 +22,7 @@ import * as eventUtils from './utils.js'; /** * Class for a comment move event. Created before the move. + * * @alias Blockly.Events.CommentMove */ export class CommentMove extends CommentBase { @@ -83,6 +81,7 @@ export class CommentMove extends CommentBase { /** * Override the location before the move. Use this if you don't create the * event until the end of the move, but you know the original location. + * * @param xy The location before the move, in workspace coordinates. */ setOldCoordinate(xy: Coordinate) { @@ -92,7 +91,8 @@ export class CommentMove extends CommentBase { // TODO (#1266): "Full" and "minimal" serialization. /** * Encode the event as JSON. - * @return JSON representation. + * + * @returns JSON representation. */ override toJson(): AnyDuringMigration { const json = super.toJson(); @@ -109,6 +109,7 @@ export class CommentMove extends CommentBase { /** * Decode the JSON event. + * * @param json JSON representation. */ override fromJson(json: AnyDuringMigration) { @@ -126,7 +127,8 @@ export class CommentMove extends CommentBase { /** * Does this event record any change of state? - * @return False if something changed. + * + * @returns False if something changed. */ override isNull(): boolean { return Coordinate.equals(this.oldCoordinate_, this.newCoordinate_); @@ -134,6 +136,7 @@ export class CommentMove extends CommentBase { /** * Run a move event. + * * @param forward True if run forward, false if run backward (undo). */ override run(forward: boolean) { diff --git a/core/events/events_marker_move.ts b/core/events/events_marker_move.ts index f91246a95..a3d0d21f8 100644 --- a/core/events/events_marker_move.ts +++ b/core/events/events_marker_move.ts @@ -4,12 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Events fired as a result of a marker move. - */ - /** * Events fired as a result of a marker move. + * * @class */ import * as goog from '../../closure/goog/goog.js'; @@ -26,6 +23,7 @@ import * as eventUtils from './utils.js'; /** * Class for a marker move event. + * * @alias Blockly.Events.MarkerMove */ export class MarkerMove extends UiBase { @@ -72,7 +70,8 @@ export class MarkerMove extends UiBase { /** * Encode the event as JSON. - * @return JSON representation. + * + * @returns JSON representation. */ override toJson(): AnyDuringMigration { const json = super.toJson(); @@ -85,6 +84,7 @@ export class MarkerMove extends UiBase { /** * Decode the JSON event. + * * @param json JSON representation. */ override fromJson(json: AnyDuringMigration) { diff --git a/core/events/events_selected.ts b/core/events/events_selected.ts index 3034af1a5..a6c4b7ad0 100644 --- a/core/events/events_selected.ts +++ b/core/events/events_selected.ts @@ -4,12 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Events fired as a result of element select action. - */ - /** * Events fired as a result of element select action. + * * @class */ import * as goog from '../../closure/goog/goog.js'; @@ -23,6 +20,7 @@ import * as eventUtils from './utils.js'; /** * Class for a selected event. + * * @alias Blockly.Events.Selected */ export class Selected extends UiBase { @@ -55,7 +53,8 @@ export class Selected extends UiBase { /** * Encode the event as JSON. - * @return JSON representation. + * + * @returns JSON representation. */ override toJson(): AnyDuringMigration { const json = super.toJson(); @@ -66,6 +65,7 @@ export class Selected extends UiBase { /** * Decode the JSON event. + * * @param json JSON representation. */ override fromJson(json: AnyDuringMigration) { diff --git a/core/events/events_theme_change.ts b/core/events/events_theme_change.ts index c3648a2a4..a318a7a18 100644 --- a/core/events/events_theme_change.ts +++ b/core/events/events_theme_change.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Events fired as a result of a theme update. - */ - /** * Events fired as a result of a theme update. * @class diff --git a/core/events/events_toolbox_item_select.ts b/core/events/events_toolbox_item_select.ts index db6c3b2eb..6b26b3d3b 100644 --- a/core/events/events_toolbox_item_select.ts +++ b/core/events/events_toolbox_item_select.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Events fired as a result of selecting an item on the toolbox. - */ - /** * Events fired as a result of selecting an item on the toolbox. * @class diff --git a/core/events/events_trashcan_open.ts b/core/events/events_trashcan_open.ts index 0940517f5..f937072f4 100644 --- a/core/events/events_trashcan_open.ts +++ b/core/events/events_trashcan_open.ts @@ -4,12 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Events fired as a result of trashcan flyout open and close. - */ - /** * Events fired as a result of trashcan flyout open and close. + * * @class */ import * as goog from '../../closure/goog/goog.js'; @@ -23,6 +20,7 @@ import * as eventUtils from './utils.js'; /** * Class for a trashcan open event. + * * @alias Blockly.Events.TrashcanOpen */ export class TrashcanOpen extends UiBase { @@ -47,7 +45,8 @@ export class TrashcanOpen extends UiBase { /** * Encode the event as JSON. - * @return JSON representation. + * + * @returns JSON representation. */ override toJson(): AnyDuringMigration { const json = super.toJson(); @@ -57,6 +56,7 @@ export class TrashcanOpen extends UiBase { /** * Decode the JSON event. + * * @param json JSON representation. */ override fromJson(json: AnyDuringMigration) { diff --git a/core/events/events_ui.ts b/core/events/events_ui.ts index de647f2fb..38c7e82e2 100644 --- a/core/events/events_ui.ts +++ b/core/events/events_ui.ts @@ -4,14 +4,10 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview (Deprecated) Events fired as a result of UI actions in - * Blockly's editor. - */ - /** * (Deprecated) Events fired as a result of UI actions in * Blockly's editor. + * * @class */ import * as goog from '../../closure/goog/goog.js'; @@ -26,6 +22,7 @@ import * as eventUtils from './utils.js'; /** * Class for a UI event. + * * @deprecated December 2020. Instead use a more specific UI event. * @alias Blockly.Events.Ui */ @@ -60,7 +57,8 @@ export class Ui extends UiBase { /** * Encode the event as JSON. - * @return JSON representation. + * + * @returns JSON representation. */ override toJson(): AnyDuringMigration { const json = super.toJson(); @@ -76,6 +74,7 @@ export class Ui extends UiBase { /** * Decode the JSON event. + * * @param json JSON representation. */ override fromJson(json: AnyDuringMigration) { diff --git a/core/events/events_ui_base.ts b/core/events/events_ui_base.ts index 8f9c2fd3d..7ac36a756 100644 --- a/core/events/events_ui_base.ts +++ b/core/events/events_ui_base.ts @@ -4,14 +4,10 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Base class for events fired as a result of UI actions in - * Blockly's editor. - */ - /** * Base class for events fired as a result of UI actions in * Blockly's editor. + * * @class */ import * as goog from '../../closure/goog/goog.js'; @@ -26,6 +22,7 @@ import {Abstract as AbstractEvent} from './events_abstract.js'; * editing to work (e.g. scrolling the workspace, zooming, opening toolbox * categories). * UI events do not undo or redo. + * * @alias Blockly.Events.UiBase */ export class UiBase extends AbstractEvent { diff --git a/core/events/events_var_base.ts b/core/events/events_var_base.ts index 3ad0cbc31..2463b6bbc 100644 --- a/core/events/events_var_base.ts +++ b/core/events/events_var_base.ts @@ -4,12 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Abstract class for a variable event. - */ - /** * Abstract class for a variable event. + * * @class */ import * as goog from '../../closure/goog/goog.js'; @@ -22,6 +19,7 @@ import {Abstract as AbstractEvent} from './events_abstract.js'; /** * Abstract class for a variable event. + * * @alias Blockly.Events.VarBase */ export class VarBase extends AbstractEvent { @@ -46,7 +44,8 @@ export class VarBase extends AbstractEvent { /** * Encode the event as JSON. - * @return JSON representation. + * + * @returns JSON representation. */ override toJson(): AnyDuringMigration { const json = super.toJson(); @@ -56,6 +55,7 @@ export class VarBase extends AbstractEvent { /** * Decode the JSON event. + * * @param json JSON representation. */ override fromJson(json: AnyDuringMigration) { diff --git a/core/events/events_var_create.ts b/core/events/events_var_create.ts index 0dd40fcff..6dc0ac069 100644 --- a/core/events/events_var_create.ts +++ b/core/events/events_var_create.ts @@ -4,12 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Class for a variable creation event. - */ - /** * Class for a variable creation event. + * * @class */ import * as goog from '../../closure/goog/goog.js'; @@ -24,6 +21,7 @@ import * as eventUtils from './utils.js'; /** * Class for a variable creation event. + * * @alias Blockly.Events.VarCreate */ export class VarCreate extends VarBase { @@ -52,7 +50,8 @@ export class VarCreate extends VarBase { /** * Encode the event as JSON. - * @return JSON representation. + * + * @returns JSON representation. */ override toJson(): AnyDuringMigration { const json = super.toJson(); @@ -63,6 +62,7 @@ export class VarCreate extends VarBase { /** * Decode the JSON event. + * * @param json JSON representation. */ override fromJson(json: AnyDuringMigration) { @@ -73,6 +73,7 @@ export class VarCreate extends VarBase { /** * Run a variable creation event. + * * @param forward True if run forward, false if run backward (undo). */ override run(forward: boolean) { diff --git a/core/events/events_var_delete.ts b/core/events/events_var_delete.ts index eca7959d3..3c78e6b35 100644 --- a/core/events/events_var_delete.ts +++ b/core/events/events_var_delete.ts @@ -4,12 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Classes for all types of variable events. - */ - /** * Classes for all types of variable events. + * * @class */ import * as goog from '../../closure/goog/goog.js'; @@ -24,6 +21,7 @@ import * as eventUtils from './utils.js'; /** * Class for a variable deletion event. + * * @alias Blockly.Events.VarDelete */ export class VarDelete extends VarBase { @@ -52,7 +50,8 @@ export class VarDelete extends VarBase { /** * Encode the event as JSON. - * @return JSON representation. + * + * @returns JSON representation. */ override toJson(): AnyDuringMigration { const json = super.toJson(); @@ -63,6 +62,7 @@ export class VarDelete extends VarBase { /** * Decode the JSON event. + * * @param json JSON representation. */ override fromJson(json: AnyDuringMigration) { @@ -73,6 +73,7 @@ export class VarDelete extends VarBase { /** * Run a variable deletion event. + * * @param forward True if run forward, false if run backward (undo). */ override run(forward: boolean) { diff --git a/core/events/events_var_rename.ts b/core/events/events_var_rename.ts index 4de0ed7e1..0497f45aa 100644 --- a/core/events/events_var_rename.ts +++ b/core/events/events_var_rename.ts @@ -4,12 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Class for a variable rename event. - */ - /** * Class for a variable rename event. + * * @class */ import * as goog from '../../closure/goog/goog.js'; @@ -24,6 +21,7 @@ import * as eventUtils from './utils.js'; /** * Class for a variable rename event. + * * @alias Blockly.Events.VarRename */ export class VarRename extends VarBase { @@ -53,7 +51,8 @@ export class VarRename extends VarBase { /** * Encode the event as JSON. - * @return JSON representation. + * + * @returns JSON representation. */ override toJson(): AnyDuringMigration { const json = super.toJson(); @@ -64,6 +63,7 @@ export class VarRename extends VarBase { /** * Decode the JSON event. + * * @param json JSON representation. */ override fromJson(json: AnyDuringMigration) { @@ -74,6 +74,7 @@ export class VarRename extends VarBase { /** * Run a variable rename event. + * * @param forward True if run forward, false if run backward (undo). */ override run(forward: boolean) { diff --git a/core/events/events_viewport.ts b/core/events/events_viewport.ts index 45609717b..11912b659 100644 --- a/core/events/events_viewport.ts +++ b/core/events/events_viewport.ts @@ -4,12 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Events fired as a result of a viewport change. - */ - /** * Events fired as a result of a viewport change. + * * @class */ import * as goog from '../../closure/goog/goog.js'; @@ -23,6 +20,7 @@ import * as eventUtils from './utils.js'; /** * Class for a viewport change event. + * * @alias Blockly.Events.ViewportChange */ export class ViewportChange extends UiBase { @@ -72,7 +70,8 @@ export class ViewportChange extends UiBase { /** * Encode the event as JSON. - * @return JSON representation. + * + * @returns JSON representation. */ override toJson(): AnyDuringMigration { const json = super.toJson(); @@ -85,6 +84,7 @@ export class ViewportChange extends UiBase { /** * Decode the JSON event. + * * @param json JSON representation. */ override fromJson(json: AnyDuringMigration) { diff --git a/core/events/utils.ts b/core/events/utils.ts index b749d923f..2dea56a3f 100644 --- a/core/events/utils.ts +++ b/core/events/utils.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Helper methods for events that are fired as a result of - * actions in Blockly's editor. - */ - /** * Helper methods for events that are fired as a result of * actions in Blockly's editor. diff --git a/core/events/workspace_events.ts b/core/events/workspace_events.ts index 12acb8a7a..2e140a538 100644 --- a/core/events/workspace_events.ts +++ b/core/events/workspace_events.ts @@ -4,12 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Class for a finished loading workspace event. - */ - /** * Class for a finished loading workspace event. + * * @class */ import * as goog from '../../closure/goog/goog.js'; @@ -27,6 +24,7 @@ import * as eventUtils from './utils.js'; * Used to notify the developer when the workspace has finished loading (i.e * domToWorkspace). * Finished loading events do not record undo or redo. + * * @alias Blockly.Events.FinishedLoading */ export class FinishedLoading extends AbstractEvent { @@ -56,7 +54,8 @@ export class FinishedLoading extends AbstractEvent { /** * Encode the event as JSON. - * @return JSON representation. + * + * @returns JSON representation. */ override toJson(): AnyDuringMigration { const json = { @@ -73,6 +72,7 @@ export class FinishedLoading extends AbstractEvent { /** * Decode the JSON event. + * * @param json JSON representation. */ override fromJson(json: AnyDuringMigration) { diff --git a/core/extensions.ts b/core/extensions.ts index b448f444f..e1f38b6c8 100644 --- a/core/extensions.ts +++ b/core/extensions.ts @@ -4,13 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Extensions are functions that help initialize blocks, usually - * adding dynamic behavior such as onchange handlers and mutators. These - * are applied using Block.applyExtension(), or the JSON "extensions" - * array attribute. - */ - /** * Extensions are functions that help initialize blocks, usually * adding dynamic behavior such as onchange handlers and mutators. These diff --git a/core/field.ts b/core/field.ts index ba1de9ef2..488a07ca4 100644 --- a/core/field.ts +++ b/core/field.ts @@ -4,16 +4,11 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Field. Used for editable titles, variables, etc. - * This is an abstract class that defines the UI on the block. Actual - * instances would be FieldTextInput, FieldDropdown, etc. - */ - /** * Field. Used for editable titles, variables, etc. * This is an abstract class that defines the UI on the block. Actual * instances would be FieldTextInput, FieldDropdown, etc. + * * @class */ import * as goog from '../closure/goog/goog.js'; @@ -58,6 +53,7 @@ import * as Xml from './xml.js'; /** * Abstract class for an editable field. + * * @alias Blockly.Field */ export abstract class Field implements IASTNodeLocationSvg, @@ -140,6 +136,7 @@ export abstract class Field implements IASTNodeLocationSvg, /** * Has this field been disposed of? + * * @internal */ disposed = false; @@ -169,12 +166,14 @@ export abstract class Field implements IASTNodeLocationSvg, /** * The prefix field. + * * @internal */ prefixField: string|null = null; /** * The suffix field. + * * @internal */ suffixField: string|null = null; @@ -233,6 +232,7 @@ export abstract class Field implements IASTNodeLocationSvg, /** * Process the configuration map passed to the field. + * * @param config A map of options used to configure the field. See the * individual field's documentation for a list of properties this * parameter supports. @@ -247,6 +247,7 @@ export abstract class Field implements IASTNodeLocationSvg, /** * Attach this field to a block. + * * @param block The block containing this field. */ setSourceBlock(block: Block) { @@ -258,7 +259,8 @@ export abstract class Field implements IASTNodeLocationSvg, /** * Get the renderer constant provider. - * @return The renderer constant provider. + * + * @returns The renderer constant provider. */ getConstants(): ConstantProvider|null { if (!this.constants_ && this.sourceBlock_ && !this.sourceBlock_.disposed && @@ -272,7 +274,8 @@ export abstract class Field implements IASTNodeLocationSvg, /** * Get the block this field is attached to. - * @return The block containing this field. + * + * @returns The block containing this field. */ getSourceBlock(): Block { return this.sourceBlock_; @@ -281,6 +284,7 @@ export abstract class Field implements IASTNodeLocationSvg, /** * Initialize everything to render this field. Override * methods initModel and initView rather than this method. + * * @final * @internal */ @@ -304,6 +308,7 @@ export abstract class Field implements IASTNodeLocationSvg, /** * Create the block UI for this field. + * * @internal */ initView() { @@ -314,6 +319,7 @@ export abstract class Field implements IASTNodeLocationSvg, /** * Initializes the model of the field after it has been installed on a block. * No-op by default. + * * @internal */ initModel() {} @@ -368,6 +374,7 @@ export abstract class Field implements IASTNodeLocationSvg, /** * Sets the field's value based on the given XML element. Should only be * called by Blockly.Xml. + * * @param fieldElement The element containing info about the field's state. * @internal */ @@ -377,9 +384,10 @@ export abstract class Field implements IASTNodeLocationSvg, /** * Serializes this field's value to XML. Should only be called by Blockly.Xml. + * * @param fieldElement The element to populate with info about the field's * state. - * @return The element containing info about the field's state. + * @returns The element containing info about the field's state. * @internal */ toXml(fieldElement: Element): Element { @@ -390,10 +398,11 @@ export abstract class Field implements IASTNodeLocationSvg, /** * Saves this fields value as something which can be serialized to JSON. * Should only be called by the serialization system. + * * @param _doFullSerialization If true, this signals to the field that if it * normally just saves a reference to some state (eg variable fields) it * should instead serialize the full state of the thing being referenced. - * @return JSON serializable state. + * @returns JSON serializable state. * @internal */ saveState(_doFullSerialization?: boolean): AnyDuringMigration { @@ -407,6 +416,7 @@ export abstract class Field implements IASTNodeLocationSvg, /** * Sets the field's state based on the given state value. Should only be * called by the serialization system. + * * @param state The state we want to apply to the field. * @internal */ @@ -421,9 +431,10 @@ export abstract class Field implements IASTNodeLocationSvg, * Returns a stringified version of the XML state, if it should be used. * Otherwise this returns null, to signal the field should use its own * serialization. + * * @param callingClass The class calling this method. * Used to see if `this` has overridden any relevant hooks. - * @return The stringified version of the XML state, or null. + * @returns The stringified version of the XML state, or null. */ protected saveLegacyState(callingClass: AnyDuringMigration): string|null { if (callingClass.prototype.saveState === this.saveState && @@ -442,10 +453,11 @@ export abstract class Field implements IASTNodeLocationSvg, /** * Loads the given state using either the old XML hooks, if they should be * used. Returns true to indicate loading has been handled, false otherwise. + * * @param callingClass The class calling this method. * Used to see if `this` has overridden any relevant hooks. * @param state The state to apply to the field. - * @return Whether the state was applied or not. + * @returns Whether the state was applied or not. */ loadLegacyState(callingClass: AnyDuringMigration, state: AnyDuringMigration): boolean { @@ -461,6 +473,7 @@ export abstract class Field implements IASTNodeLocationSvg, /** * Dispose of all DOM objects and events belonging to this editable field. + * * @internal */ dispose() { @@ -497,6 +510,7 @@ export abstract class Field implements IASTNodeLocationSvg, /** * Set whether this field's value can be changed using the editor when the * source block is editable. + * * @param enabled True if enabled. */ setEnabled(enabled: boolean) { @@ -507,7 +521,8 @@ export abstract class Field implements IASTNodeLocationSvg, /** * Check whether this field's value can be changed using the editor when the * source block is editable. - * @return Whether this field is enabled. + * + * @returns Whether this field is enabled. */ isEnabled(): boolean { return this.enabled_; @@ -515,7 +530,8 @@ export abstract class Field implements IASTNodeLocationSvg, /** * Check whether this field defines the showEditor_ function. - * @return Whether this field is clickable. + * + * @returns Whether this field is clickable. */ isClickable(): boolean { return this.enabled_ && !!this.sourceBlock_ && @@ -527,7 +543,8 @@ export abstract class Field implements IASTNodeLocationSvg, * Check whether this field is currently editable. Some fields are never * EDITABLE (e.g. text labels). Other fields may be EDITABLE but may exist on * non-editable blocks or be currently disabled. - * @return Whether this field is currently enabled, editable and on an + * + * @returns Whether this field is currently enabled, editable and on an * editable block. */ isCurrentlyEditable(): boolean { @@ -538,7 +555,8 @@ export abstract class Field implements IASTNodeLocationSvg, /** * Check whether this field should be serialized by the XML renderer. * Handles the logic for backwards compatibility and incongruous states. - * @return Whether this field should be serialized or not. + * + * @returns Whether this field should be serialized or not. */ isSerializable(): boolean { let isSerializable = false; @@ -558,7 +576,8 @@ export abstract class Field implements IASTNodeLocationSvg, /** * Gets whether this editable field is visible or not. - * @return True if visible. + * + * @returns True if visible. */ isVisible(): boolean { return this.visible_; @@ -567,6 +586,7 @@ export abstract class Field implements IASTNodeLocationSvg, /** * Sets whether this editable field is visible or not. Should only be called * by input.setVisible. + * * @param visible True if visible. * @internal */ @@ -602,7 +622,8 @@ export abstract class Field implements IASTNodeLocationSvg, /** * Gets the validation function for editable fields, or null if not set. - * @return Validation function, or null. + * + * @returns Validation function, or null. */ getValidator(): Function|null { return this.validator_; @@ -611,7 +632,8 @@ export abstract class Field implements IASTNodeLocationSvg, /** * Gets the group element for this editable field. * Used for measuring the size and for positioning. - * @return The group element. + * + * @returns The group element. */ getSvgRoot(): SVGGElement { return this.fieldGroup_; @@ -620,6 +642,7 @@ export abstract class Field implements IASTNodeLocationSvg, /** * Updates the field to match the colour/style of the block. Should only be * called by BlockSvg.applyColour(). + * * @internal */ applyColour() {} @@ -641,6 +664,7 @@ export abstract class Field implements IASTNodeLocationSvg, /** * Calls showEditor_ when the field is clicked if the field is clickable. * Do not override. + * * @param opt_e Optional mouse event that triggered the field to open, or * undefined if triggered programmatically. * @final @@ -655,6 +679,7 @@ export abstract class Field implements IASTNodeLocationSvg, /** * A developer hook to create an editor for the field. This is no-op by * default, and must be overriden to create an editor. + * * @param _e Optional mouse event that triggered the field to open, or * undefined if triggered programmatically. */ @@ -663,6 +688,7 @@ export abstract class Field implements IASTNodeLocationSvg, /** * Updates the size of the field based on the text. + * * @param opt_margin margin to use when positioning the text element. */ protected updateSize_(opt_margin?: number) { @@ -694,6 +720,7 @@ export abstract class Field implements IASTNodeLocationSvg, /** * Position a field's text element after a size change. This handles both LTR * and RTL positioning. + * * @param xOffset x offset to use when positioning the text element. * @param contentWidth The content width. */ @@ -749,7 +776,8 @@ export abstract class Field implements IASTNodeLocationSvg, * Returns the height and width of the field. * * This should *in general* be the only place render_ gets called from. - * @return Height and width. + * + * @returns Height and width. */ getSize(): Size { if (!this.isVisible()) { @@ -773,7 +801,8 @@ export abstract class Field implements IASTNodeLocationSvg, /** * Returns the bounding box of the rendered field, accounting for workspace * scaling. - * @return An object with top, bottom, left, and right in pixels relative to + * + * @returns An object with top, bottom, left, and right in pixels relative to * the top left corner of the page (window coordinates). * @internal */ @@ -816,7 +845,8 @@ export abstract class Field implements IASTNodeLocationSvg, /** * Get the text from this field to display on the block. May differ from * ``getText`` due to ellipsis, and other formatting. - * @return Text to display. + * + * @returns Text to display. */ protected getDisplayText_(): string { let text = this.getText(); @@ -841,7 +871,8 @@ export abstract class Field implements IASTNodeLocationSvg, * Get the text from this field. * Override getText_ to provide a different behavior than simply casting the * value to a string. - * @return Current text. + * + * @returns Current text. * @final */ getText(): string { @@ -859,7 +890,8 @@ export abstract class Field implements IASTNodeLocationSvg, * Override if the text representation of the value of this field * is not just a string cast of its value. * Return null to resort to a string cast. - * @return Current text or null. + * + * @returns Current text or null. */ protected getText_(): string|null { return null; @@ -870,6 +902,7 @@ export abstract class Field implements IASTNodeLocationSvg, * rerender this field and adjust for any sizing changes. * Other fields on the same block will not rerender, because their sizes have * already been recorded. + * * @internal */ markDirty() { @@ -884,6 +917,7 @@ export abstract class Field implements IASTNodeLocationSvg, * rerender this field and adjust for any sizing changes. * Other fields on the same block will not rerender, because their sizes have * already been recorded. + * * @internal */ forceRerender() { @@ -899,6 +933,7 @@ export abstract class Field implements IASTNodeLocationSvg, * Used to change the value of the field. Handles validation and events. * Subclasses should override doClassValidation_ and doValueUpdate_ rather * than this method. + * * @param newValue New value. * @final */ @@ -954,9 +989,10 @@ export abstract class Field implements IASTNodeLocationSvg, /** * Process the result of validation. + * * @param newValue New value. * @param validatedValue Validated value. - * @return New value, or an Error object. + * @returns New value, or an Error object. */ private processValidation_( newValue: AnyDuringMigration, @@ -976,7 +1012,8 @@ export abstract class Field implements IASTNodeLocationSvg, /** * Get the current value of the field. - * @return Current value. + * + * @returns Current value. */ getValue(): AnyDuringMigration { return this.value_; @@ -985,8 +1022,9 @@ export abstract class Field implements IASTNodeLocationSvg, /** * Used to validate a value. Returns input by default. Can be overridden by * subclasses, see FieldDropdown. + * * @param opt_newValue The value to be validated. - * @return The validated value, same as input by default. + * @returns The validated value, same as input by default. */ protected doClassValidation_(opt_newValue?: AnyDuringMigration): AnyDuringMigration { @@ -999,6 +1037,7 @@ export abstract class Field implements IASTNodeLocationSvg, /** * Used to update the value of a field. Can be overridden by subclasses to do * custom storage of values/updating of external things. + * * @param newValue The value to be saved. */ protected doValueUpdate_(newValue: AnyDuringMigration) { @@ -1010,6 +1049,7 @@ export abstract class Field implements IASTNodeLocationSvg, * Used to notify the field an invalid value was input. Can be overridden by * subclasses, see FieldTextInput. * No-op by default. + * * @param _invalidValue The input value that was determined to be invalid. */ protected doValueInvalid_(_invalidValue: AnyDuringMigration) {} @@ -1017,6 +1057,7 @@ export abstract class Field implements IASTNodeLocationSvg, /** * Handle a mouse down event on a field. + * * @param e Mouse down event. */ protected onMouseDown_(e: Event) { @@ -1031,6 +1072,7 @@ export abstract class Field implements IASTNodeLocationSvg, /** * Sets the tooltip for this field. + * * @param newTip The text for the tooltip, a function that returns the text * for the tooltip, a parent object whose tooltip will be used, or null to * display the tooltip of the parent block. To not display a tooltip pass @@ -1051,7 +1093,8 @@ export abstract class Field implements IASTNodeLocationSvg, /** * Returns the tooltip text for this field. - * @return The tooltip text for this field. + * + * @returns The tooltip text for this field. */ getTooltip(): string { const clickTarget = this.getClickTarget_(); @@ -1066,7 +1109,8 @@ export abstract class Field implements IASTNodeLocationSvg, * The element to bind the click handler to. If not set explicitly, defaults * to the SVG root of the field. When this element is * clicked on an editable field, the editor will open. - * @return Element to bind click handler to. + * + * @returns Element to bind click handler to. */ protected getClickTarget_(): Element { return this.clickTarget_ || this.getSvgRoot(); @@ -1075,7 +1119,8 @@ export abstract class Field implements IASTNodeLocationSvg, /** * Return the absolute coordinates of the top-left corner of this field. * The origin (0,0) is the top-left corner of the page body. - * @return Object with .x and .y properties. + * + * @returns Object with .x and .y properties. */ protected getAbsoluteXY_(): Coordinate { return style.getPageOffset(this.getClickTarget_() as SVGRectElement); @@ -1085,7 +1130,8 @@ export abstract class Field implements IASTNodeLocationSvg, * Whether this field references any Blockly variables. If true it may need * to be handled differently during serialization and deserialization. * Subclasses may override this. - * @return True if this field has any variable references. + * + * @returns True if this field has any variable references. * @internal */ referencesVariables(): boolean { @@ -1095,6 +1141,7 @@ export abstract class Field implements IASTNodeLocationSvg, /** * Refresh the variable name referenced by this field if this field references * variables. + * * @internal */ refreshVariableName() {} @@ -1103,7 +1150,8 @@ export abstract class Field implements IASTNodeLocationSvg, /** * Search through the list of inputs and their fields in order to find the * parent input of a field. - * @return The input that the field belongs to. + * + * @returns The input that the field belongs to. * @internal */ getParentInput(): Input { @@ -1128,7 +1176,8 @@ export abstract class Field implements IASTNodeLocationSvg, /** * Returns whether or not we should flip the field in RTL. - * @return True if we should flip in RTL. + * + * @returns True if we should flip in RTL. */ getFlipRtl(): boolean { return false; @@ -1136,7 +1185,8 @@ export abstract class Field implements IASTNodeLocationSvg, /** * Returns whether or not the field is tab navigable. - * @return True if the field is tab navigable. + * + * @returns True if the field is tab navigable. */ isTabNavigable(): boolean { return false; @@ -1144,8 +1194,9 @@ export abstract class Field implements IASTNodeLocationSvg, /** * Handles the given keyboard shortcut. + * * @param _shortcut The shortcut to be handled. - * @return True if the shortcut has been handled, false otherwise. + * @returns True if the shortcut has been handled, false otherwise. */ onShortcut(_shortcut: KeyboardShortcut): boolean { return false; @@ -1153,6 +1204,7 @@ export abstract class Field implements IASTNodeLocationSvg, /** * Add the cursor SVG to this fields SVG group. + * * @param cursorSvg The SVG root of the cursor to be added to the field group. * @internal */ @@ -1170,6 +1222,7 @@ export abstract class Field implements IASTNodeLocationSvg, /** * Add the marker SVG to this fields SVG group. + * * @param markerSvg The SVG root of the marker to be added to the field group. * @internal */ diff --git a/core/field_angle.ts b/core/field_angle.ts index f313ee6ba..a92cfedf5 100644 --- a/core/field_angle.ts +++ b/core/field_angle.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Angle input field. - */ - /** * Angle input field. * @class diff --git a/core/field_checkbox.ts b/core/field_checkbox.ts index e1ad4bcfd..1a017be8e 100644 --- a/core/field_checkbox.ts +++ b/core/field_checkbox.ts @@ -4,12 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Checkbox field. Checked or not checked. - */ - /** * Checkbox field. Checked or not checked. + * * @class */ import * as goog from '../closure/goog/goog.js'; @@ -26,6 +23,7 @@ import type {Sentinel} from './utils/sentinel.js'; /** * Class for a checkbox field. + * * @alias Blockly.FieldCheckbox */ export class FieldCheckbox extends Field { @@ -84,6 +82,7 @@ export class FieldCheckbox extends Field { /** * Configure the field based on the given map of options. + * * @param config A map of options to configure the field based on. */ protected override configure_(config: FieldCheckboxConfig) { @@ -93,7 +92,8 @@ export class FieldCheckbox extends Field { /** * Saves this field's value. - * @return The boolean value held by this field. + * + * @returns The boolean value held by this field. * @internal */ override saveState(): AnyDuringMigration { @@ -106,6 +106,7 @@ export class FieldCheckbox extends Field { /** * Create the block UI for this checkbox. + * * @internal */ override initView() { @@ -128,6 +129,7 @@ export class FieldCheckbox extends Field { /** * Set the character used for the check mark. + * * @param character The character to use for the check mark, or null to use * the default. */ @@ -143,8 +145,9 @@ export class FieldCheckbox extends Field { /** * Ensure that the input value is valid ('TRUE' or 'FALSE'). + * * @param opt_newValue The input value. - * @return A valid value ('TRUE' or 'FALSE), or null if invalid. + * @returns A valid value ('TRUE' or 'FALSE), or null if invalid. */ protected override doClassValidation_(opt_newValue?: AnyDuringMigration): string|null { @@ -159,6 +162,7 @@ export class FieldCheckbox extends Field { /** * Update the value of the field, and update the checkElement. + * * @param newValue The value to be saved. The default validator guarantees * that this is a either 'TRUE' or 'FALSE'. */ @@ -172,7 +176,8 @@ export class FieldCheckbox extends Field { /** * Get the value of this field, either 'TRUE' or 'FALSE'. - * @return The value of this field. + * + * @returns The value of this field. */ override getValue(): string { return this.value_ ? 'TRUE' : 'FALSE'; @@ -180,7 +185,8 @@ export class FieldCheckbox extends Field { /** * Get the boolean value of this field. - * @return The boolean value of this field. + * + * @returns The boolean value of this field. */ getValueBoolean(): boolean { return this.value_ as boolean; @@ -188,7 +194,8 @@ export class FieldCheckbox extends Field { /** * Get the text of this field. Used when the block is collapsed. - * @return Text representing the value of this field ('true' or 'false'). + * + * @returns Text representing the value of this field ('true' or 'false'). */ override getText(): string { return String(this.convertValueToBool_(this.value_)); @@ -199,8 +206,9 @@ export class FieldCheckbox extends Field { * * Converts 'TRUE' to true and 'FALSE' to false correctly, everything else * is cast to a boolean. + * * @param value The value to convert. - * @return The converted value. + * @returns The converted value. */ private convertValueToBool_(value: AnyDuringMigration): boolean { if (typeof value === 'string') { @@ -212,8 +220,9 @@ export class FieldCheckbox extends Field { /** * Construct a FieldCheckbox from a JSON arg object. + * * @param options A JSON object with options (checked). - * @return The new field instance. + * @returns The new field instance. * @nocollapse * @internal */ diff --git a/core/field_colour.ts b/core/field_colour.ts index 0e91e8a19..e5b03f550 100644 --- a/core/field_colour.ts +++ b/core/field_colour.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Colour input field. - */ - /** * Colour input field. * @class diff --git a/core/field_dropdown.ts b/core/field_dropdown.ts index ffb2b6195..45d93e403 100644 --- a/core/field_dropdown.ts +++ b/core/field_dropdown.ts @@ -4,16 +4,11 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Dropdown input field. Used for editable titles and variables. - * In the interests of a consistent UI, the toolbox shares some functions and - * properties with the context menu. - */ - /** * Dropdown input field. Used for editable titles and variables. * In the interests of a consistent UI, the toolbox shares some functions and * properties with the context menu. + * * @class */ import * as goog from '../closure/goog/goog.js'; @@ -37,6 +32,7 @@ import * as userAgent from './utils/useragent.js'; /** * Class for an editable dropdown field. + * * @alias Blockly.FieldDropdown */ export class FieldDropdown extends Field { @@ -86,12 +82,14 @@ export class FieldDropdown extends Field { /** * The prefix field label, of common words set after options are trimmed. + * * @internal */ override prefixField: string|null = null; /** * The suffix field label, of common words set after options are trimmed. + * * @internal */ override suffixField: string|null = null; @@ -156,6 +154,7 @@ export class FieldDropdown extends Field { /** * Sets the field's value based on the given XML element. Should only be * called by Blockly.Xml. + * * @param fieldElement The element containing info about the field's state. * @internal */ @@ -168,6 +167,7 @@ export class FieldDropdown extends Field { /** * Sets the field's value based on the given state. + * * @param state The state to apply to the dropdown field. * @internal */ @@ -183,6 +183,7 @@ export class FieldDropdown extends Field { /** * Create the block UI for this dropdown. + * * @internal */ override initView() { @@ -208,7 +209,8 @@ export class FieldDropdown extends Field { /** * Whether or not the dropdown should add a border rect. - * @return True if the dropdown field should add a border rect. + * + * @returns True if the dropdown field should add a border rect. */ protected shouldAddBorderRect_(): boolean { return !this.getConstants()!.FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW || @@ -249,6 +251,7 @@ export class FieldDropdown extends Field { /** * Create a dropdown menu under the text. + * * @param opt_e Optional mouse event that triggered the field to open, or * undefined if triggered programmatically. */ @@ -343,6 +346,7 @@ export class FieldDropdown extends Field { /** * Handle an action in the dropdown menu. + * * @param menuItem The MenuItem selected within menu. */ private handleMenuActionEvent_(menuItem: MenuItem) { @@ -352,6 +356,7 @@ export class FieldDropdown extends Field { /** * Handle the selection of an item in the dropdown menu. + * * @param menu The Menu component clicked. * @param menuItem The MenuItem selected within menu. */ @@ -411,7 +416,7 @@ export class FieldDropdown extends Field { } /** - * @return True if the option list is generated by a function. + * @returns True if the option list is generated by a function. * Otherwise false. */ isOptionListDynamic(): boolean { @@ -420,9 +425,10 @@ export class FieldDropdown extends Field { /** * Return a list of the options for this dropdown. + * * @param opt_useCache For dynamic options, whether or not to use the cached * options or to re-generate them. - * @return A non-empty array of option tuples: + * @returns A non-empty array of option tuples: * (human-readable text or image, language-neutral name). * @throws {TypeError} If generated options are incorrectly structured. */ @@ -442,8 +448,9 @@ export class FieldDropdown extends Field { /** * Ensure that the input value is a valid language-neutral option. + * * @param opt_newValue The input value. - * @return A valid language-neutral option, or null if invalid. + * @returns A valid language-neutral option, or null if invalid. */ protected override doClassValidation_(opt_newValue?: AnyDuringMigration): string|null { @@ -470,6 +477,7 @@ export class FieldDropdown extends Field { /** * Update the value of this dropdown field. + * * @param newValue The value to be saved. The default validator guarantees * that this is one of the valid dropdown options. */ @@ -485,6 +493,7 @@ export class FieldDropdown extends Field { /** * Updates the dropdown arrow to match the colour/style of the block. + * * @internal */ override applyColour() { @@ -526,6 +535,7 @@ export class FieldDropdown extends Field { /** * Renders the selected option, which must be an image. + * * @param imageJson Selected option that must be an image. */ private renderSelectedImage_(imageJson: ImageProperties) { @@ -613,9 +623,10 @@ export class FieldDropdown extends Field { /** * Position a drop-down arrow at the appropriate location at render-time. + * * @param x X position the arrow is being rendered at, in px. * @param y Y position the arrow is being rendered at, in px. - * @return Amount of space the arrow is taking up, in px. + * @returns Amount of space the arrow is taking up, in px. */ private positionSVGArrow_(x: number, y: number): number { if (!this.svgArrow_) { @@ -636,7 +647,8 @@ export class FieldDropdown extends Field { * Use the `getText_` developer hook to override the field's text * representation. Get the selected option text. If the selected option is an * image we return the image alt text. - * @return Selected option text. + * + * @returns Selected option text. */ protected override getText_(): string|null { if (!this.selectedOption_) { @@ -651,8 +663,9 @@ export class FieldDropdown extends Field { /** * Construct a FieldDropdown from a JSON arg object. + * * @param options A JSON object with options (options). - * @return The new field instance. + * @returns The new field instance. * @nocollapse * @internal */ @@ -671,11 +684,12 @@ export class FieldDropdown extends Field { /** * Use the calculated prefix and suffix lengths to trim all of the options in * the given array. + * * @param options Array of option tuples: * (human-readable text or image, language-neutral name). * @param prefixLength The length of the common prefix. * @param suffixLength The length of the common suffix - * @return A new array with all of the option text trimmed. + * @returns A new array with all of the option text trimmed. */ static applyTrim_( options: AnyDuringMigration[][], prefixLength: number, @@ -730,6 +744,7 @@ FieldDropdown.ARROW_CHAR = userAgent.ANDROID ? '\u25BC' : '\u25BE'; /** * Validates the data structure to be processed as an options list. + * * @param options The proposed dropdown options. * @throws {TypeError} If proposed options are incorrectly structured. */ diff --git a/core/field_image.ts b/core/field_image.ts index cad0e6b1e..fd411d642 100644 --- a/core/field_image.ts +++ b/core/field_image.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Image field. Used for pictures, icons, etc. - */ - /** * Image field. Used for pictures, icons, etc. * @class diff --git a/core/field_label.ts b/core/field_label.ts index f464fef6b..4e1a97a10 100644 --- a/core/field_label.ts +++ b/core/field_label.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Non-editable, non-serializable text field. Used for titles, - * labels, etc. - */ - /** * Non-editable, non-serializable text field. Used for titles, * labels, etc. diff --git a/core/field_label_serializable.ts b/core/field_label_serializable.ts index 3ff52f262..63815e958 100644 --- a/core/field_label_serializable.ts +++ b/core/field_label_serializable.ts @@ -4,16 +4,11 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Non-editable, serializable text field. Behaves like a - * normal label but is serialized to XML. It may only be - * edited programmatically. - */ - /** * Non-editable, serializable text field. Behaves like a * normal label but is serialized to XML. It may only be * edited programmatically. + * * @class */ import * as goog from '../closure/goog/goog.js'; @@ -26,6 +21,7 @@ import * as parsing from './utils/parsing.js'; /** * Class for a non-editable, serializable text field. + * * @alias Blockly.FieldLabelSerializable */ export class FieldLabelSerializable extends FieldLabel { @@ -59,8 +55,9 @@ export class FieldLabelSerializable extends FieldLabel { /** * Construct a FieldLabelSerializable from a JSON arg object, * dereferencing any string table references. + * * @param options A JSON object with options (text, and class). - * @return The new field instance. + * @returns The new field instance. * @nocollapse * @internal */ diff --git a/core/field_multilineinput.ts b/core/field_multilineinput.ts index 7835816dd..fd663955f 100644 --- a/core/field_multilineinput.ts +++ b/core/field_multilineinput.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Text Area field. - */ - /** * Text Area field. * @class diff --git a/core/field_number.ts b/core/field_number.ts index 0285b2a15..4a80d09c5 100644 --- a/core/field_number.ts +++ b/core/field_number.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Number input field - */ - /** * Number input field * @class diff --git a/core/field_registry.ts b/core/field_registry.ts index 2cf98a32b..79e7a41da 100644 --- a/core/field_registry.ts +++ b/core/field_registry.ts @@ -4,16 +4,11 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Fields can be created based on a JSON definition. This file - * contains methods for registering those JSON definitions, and building the - * fields based on JSON. - */ - /** * Fields can be created based on a JSON definition. This file * contains methods for registering those JSON definitions, and building the * fields based on JSON. + * * @namespace Blockly.fieldRegistry */ import * as goog from '../closure/goog/goog.js'; @@ -28,6 +23,7 @@ import * as registry from './registry.js'; * Registers a field type. * fieldRegistry.fromJson uses this registry to * find the appropriate field type. + * * @param type The field type name as used in the JSON definition. * @param fieldClass The field class containing a fromJson function that can * construct an instance of the field. @@ -41,6 +37,7 @@ export function register(type: string, fieldClass: IRegistrableField) { /** * Unregisters the field registered with the given type. + * * @param type The field type name as used in the JSON definition. * @alias Blockly.fieldRegistry.unregister */ @@ -52,9 +49,10 @@ export function unregister(type: string) { * Construct a Field from a JSON arg object. * Finds the appropriate registered field by the type name as registered using * fieldRegistry.register. + * * @param options A JSON object with a type and options specific to the field * type. - * @return The new field instance or null if a field wasn't found with the given + * @returns The new field instance or null if a field wasn't found with the given * type name * @alias Blockly.fieldRegistry.fromJson * @internal @@ -65,6 +63,8 @@ export function fromJson(options: AnyDuringMigration): Field|null { /** * Private version of fromJson for stubbing in tests. + * + * @param options */ function fromJsonInternal(options: AnyDuringMigration): Field|null { const fieldObject = diff --git a/core/field_textinput.ts b/core/field_textinput.ts index ed36b6eba..89530ab1c 100644 --- a/core/field_textinput.ts +++ b/core/field_textinput.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Text input field. - */ - /** * Text input field. * @class diff --git a/core/field_variable.ts b/core/field_variable.ts index bd118ef3e..aee652561 100644 --- a/core/field_variable.ts +++ b/core/field_variable.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Variable input field. - */ - /** * Variable input field. * @class diff --git a/core/flyout_base.ts b/core/flyout_base.ts index 5a882aaaa..1ca561a8e 100644 --- a/core/flyout_base.ts +++ b/core/flyout_base.ts @@ -4,12 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Flyout tray containing blocks which may be created. - */ - /** * Flyout tray containing blocks which may be created. + * * @class */ import * as goog from '../closure/goog/goog.js'; @@ -46,6 +43,7 @@ enum FlyoutItemType { /** * Class for a flyout. + * * @alias Blockly.Flyout */ export abstract class Flyout extends DeleteArea implements IFlyout { @@ -58,14 +56,16 @@ export abstract class Flyout extends DeleteArea implements IFlyout { * Determine if a drag delta is toward the workspace, based on the position * and orientation of the flyout. This is used in determineDragIntention_ to * determine if a new block should be created or if the flyout should scroll. + * * @param currentDragDeltaXY How far the pointer has * moved from the position at mouse down, in pixel units. - * @return True if the drag is toward the workspace. + * @returns True if the drag is toward the workspace. */ abstract isDragTowardWorkspace(currentDragDeltaXY: Coordinate): boolean; /** * Sets the translation of the flyout to match the scrollbars. + * * @param xyRatio Contains a y property which is a float * between 0 and 1 specifying the degree of scrolling and a * similar x property. @@ -74,6 +74,7 @@ export abstract class Flyout extends DeleteArea implements IFlyout { /** * Lay out the blocks in the flyout. + * * @param contents The blocks and buttons to lay * out. * @param gaps The visible gaps between blocks. @@ -82,6 +83,7 @@ export abstract class Flyout extends DeleteArea implements IFlyout { /** * Scroll the flyout. + * * @param e Mouse wheel scroll event. */ protected abstract wheel_(e: WheelEvent): void; @@ -94,13 +96,15 @@ export abstract class Flyout extends DeleteArea implements IFlyout { /** * Calculates the x coordinate for the flyout position. - * @return X coordinate. + * + * @returns X coordinate. */ abstract getX(): number; /** * Calculates the y coordinate for the flyout position. - * @return Y coordinate. + * + * @returns Y coordinate. */ abstract getY(): number; @@ -118,6 +122,7 @@ export abstract class Flyout extends DeleteArea implements IFlyout { RTL: boolean; /** * Whether the flyout should be laid out horizontally or not. + * * @internal */ horizontalLayout: boolean = false; @@ -163,6 +168,7 @@ export abstract class Flyout extends DeleteArea implements IFlyout { /** * The target workspace. + * * @internal */ targetWorkspace!: WorkspaceSvg; @@ -277,6 +283,7 @@ export abstract class Flyout extends DeleteArea implements IFlyout { /** * A map from blocks to the rects which are beneath them to act as input * targets. + * * @internal */ this.rectMap_ = new WeakMap(); @@ -304,9 +311,10 @@ export abstract class Flyout extends DeleteArea implements IFlyout { * Creates the flyout's DOM. Only needs to be called once. The flyout can * either exist as its own SVG element or be a g element nested inside a * separate SVG element. + * * @param tagName The type of tag to * put the flyout in. This should be or . - * @return The flyout's SVG group. + * @returns The flyout's SVG group. */ createDom(tagName: string|Svg|Svg): SVGElement { /* @@ -331,6 +339,7 @@ export abstract class Flyout extends DeleteArea implements IFlyout { /** * Initializes the flyout. + * * @param targetWorkspace The workspace in which to * create new blocks. */ @@ -382,6 +391,7 @@ export abstract class Flyout extends DeleteArea implements IFlyout { /** * Dispose of this flyout. * Unlink from all DOM elements to prevent memory leaks. + * * @suppress {checkTypes} */ dispose() { @@ -405,7 +415,8 @@ export abstract class Flyout extends DeleteArea implements IFlyout { /** * Get the width of the flyout. - * @return The width of the flyout. + * + * @returns The width of the flyout. */ getWidth(): number { return this.width_; @@ -413,7 +424,8 @@ export abstract class Flyout extends DeleteArea implements IFlyout { /** * Get the height of the flyout. - * @return The width of the flyout. + * + * @returns The width of the flyout. */ getHeight(): number { return this.height_; @@ -422,7 +434,8 @@ export abstract class Flyout extends DeleteArea implements IFlyout { /** * Get the scale (zoom level) of the flyout. By default, * this matches the target workspace scale, but this can be overridden. - * @return Flyout workspace scale. + * + * @returns Flyout workspace scale. */ getFlyoutScale(): number { return this.targetWorkspace.scale; @@ -430,7 +443,8 @@ export abstract class Flyout extends DeleteArea implements IFlyout { /** * Get the workspace inside the flyout. - * @return The workspace inside the flyout. + * + * @returns The workspace inside the flyout. * @internal */ getWorkspace(): WorkspaceSvg { @@ -439,7 +453,8 @@ export abstract class Flyout extends DeleteArea implements IFlyout { /** * Is the flyout visible? - * @return True if visible. + * + * @returns True if visible. */ isVisible(): boolean { return this.isVisible_; @@ -449,6 +464,7 @@ export abstract class Flyout extends DeleteArea implements IFlyout { * Set whether the flyout is visible. A value of true does not necessarily * mean that the flyout is shown. It could be hidden because its container is * hidden. + * * @param visible True if visible. */ setVisible(visible: boolean) { @@ -467,6 +483,7 @@ export abstract class Flyout extends DeleteArea implements IFlyout { /** * Set whether this flyout's container is visible. + * * @param visible Whether the container is visible. */ setContainerVisible(visible: boolean) { @@ -498,6 +515,7 @@ export abstract class Flyout extends DeleteArea implements IFlyout { /** * Update the view based on coordinates calculated in position(). + * * @param width The computed width of the flyout's SVG group * @param height The computed height of the flyout's SVG group. * @param x The computed x origin of the flyout's SVG group. @@ -560,6 +578,7 @@ export abstract class Flyout extends DeleteArea implements IFlyout { /** * Show and populate the flyout. + * * @param flyoutDef Contents to display * in the flyout. This is either an array of Nodes, a NodeList, a * toolbox definition, or a string with the name of the dynamic category. @@ -583,6 +602,10 @@ export abstract class Flyout extends DeleteArea implements IFlyout { // IE 11 is an incompetent browser that fails to fire mouseout events. // When the mouse is over the background, deselect all blocks. + /** + * + * @param this + */ function deselectAll(this: Flyout) { const topBlocks = this.workspace_.getTopBlocks(false); for (let i = 0, block; block = topBlocks[i]; i++) { @@ -615,9 +638,10 @@ export abstract class Flyout extends DeleteArea implements IFlyout { /** * Create the contents array and gaps array necessary to create the layout for * the flyout. + * * @param parsedContent The array * of objects to show in the flyout. - * @return The list of contents and gaps needed to lay out the flyout. + * @returns The list of contents and gaps needed to lay out the flyout. */ private createFlyoutInfo_(parsedContent: toolbox.FlyoutItemInfoArray): {contents: FlyoutItem[], gaps: number[]} { @@ -673,8 +697,9 @@ export abstract class Flyout extends DeleteArea implements IFlyout { /** * Gets the flyout definition for the dynamic category. + * * @param categoryName The name of the dynamic category. - * @return The definition of the + * @returns The definition of the * flyout in one of its many forms. */ private getDynamicCategoryContents_(categoryName: string): @@ -694,9 +719,10 @@ export abstract class Flyout extends DeleteArea implements IFlyout { /** * Creates a flyout button or a flyout label. + * * @param btnInfo The object holding information about a button or a label. * @param isLabel True if the button is a label, false otherwise. - * @return The object used to display the button in the + * @returns The object used to display the button in the * flyout. */ private createButton_(btnInfo: toolbox.ButtonOrLabelInfo, isLabel: boolean): @@ -710,8 +736,9 @@ export abstract class Flyout extends DeleteArea implements IFlyout { /** * Create a block from the xml and permanently disable any blocks that were * defined as disabled. + * * @param blockInfo The info of the block. - * @return The block created from the blockInfo. + * @returns The block created from the blockInfo. */ private createFlyoutBlock_(blockInfo: toolbox.BlockInfo): BlockSvg { let block; @@ -745,8 +772,9 @@ export abstract class Flyout extends DeleteArea implements IFlyout { /** * Returns a block from the array of recycled blocks with the given type, or * undefined if one cannot be found. + * * @param blockType The type of the block to try to recycle. - * @return The recycled block, or undefined if + * @returns The recycled block, or undefined if * one could not be recycled. */ private getRecycledBlock_(blockType: string): BlockSvg|undefined { @@ -762,6 +790,7 @@ export abstract class Flyout extends DeleteArea implements IFlyout { /** * Adds a gap in the flyout based on block info. + * * @param blockInfo Information about a block. * @param gaps The list of gaps between items in the flyout. * @param defaultGap The default gap between one element and the @@ -783,6 +812,7 @@ export abstract class Flyout extends DeleteArea implements IFlyout { /** * Add the necessary gap in the flyout for a separator. + * * @param sepInfo The object holding * information about a separator. * @param gaps The list gaps between items in the flyout. @@ -848,8 +878,9 @@ export abstract class Flyout extends DeleteArea implements IFlyout { /** * Returns whether the given block can be recycled or not. + * * @param _block The block to check for recyclability. - * @return True if the block can be recycled. False otherwise. + * @returns True if the block can be recycled. False otherwise. */ protected blockIsRecyclable_(_block: BlockSvg): boolean { // By default, recycling is disabled. @@ -860,6 +891,7 @@ export abstract class Flyout extends DeleteArea implements IFlyout { * Puts a previously created block into the recycle bin and moves it to the * top of the workspace. Used during large workspace swaps to limit the number * of new DOM elements we need to create. + * * @param block The block to recycle. */ private recycleBlock_(block: BlockSvg) { @@ -870,6 +902,7 @@ export abstract class Flyout extends DeleteArea implements IFlyout { /** * Add listeners to a block that has been added to the flyout. + * * @param root The root node of the SVG group the block is in. * @param block The block to add listeners for. * @param rect The invisible rectangle under the block that acts @@ -893,8 +926,9 @@ export abstract class Flyout extends DeleteArea implements IFlyout { /** * Handle a mouse-down on an SVG block in a non-closing flyout. + * * @param block The flyout block to copy. - * @return Function to call when block is clicked. + * @returns Function to call when block is clicked. */ private blockMouseDown_(block: BlockSvg): Function { const flyout = this; @@ -909,6 +943,7 @@ export abstract class Flyout extends DeleteArea implements IFlyout { /** * Mouse down on the flyout background. Start a vertical scroll drag. + * * @param e Mouse down event. */ private onMouseDown_(e: MouseEvent) { @@ -921,8 +956,9 @@ export abstract class Flyout extends DeleteArea implements IFlyout { /** * Does this flyout allow you to create a new instance of the given block? * Used for deciding if a block can be "dragged out of" the flyout. + * * @param block The block to copy from the flyout. - * @return True if you can create a new instance of the block, false + * @returns True if you can create a new instance of the block, false * otherwise. * @internal */ @@ -932,8 +968,9 @@ export abstract class Flyout extends DeleteArea implements IFlyout { /** * Create a copy of this block on the workspace. + * * @param originalBlock The block to copy from the flyout. - * @return The newly created block. + * @returns The newly created block. * @throws {Error} if something went wrong with deserialization. * @internal */ @@ -978,6 +1015,7 @@ export abstract class Flyout extends DeleteArea implements IFlyout { /** * Initialize the given button: move it to the correct location, * add listeners, etc. + * * @param button The button to initialize and place. * @param x The x position of the cursor during this layout pass. * @param y The y position of the cursor during this layout pass. @@ -996,14 +1034,17 @@ export abstract class Flyout extends DeleteArea implements IFlyout { /** * Create and place a rectangle corresponding to the given block. + * * @param block The block to associate the rect to. * @param x The x position of the cursor during this layout pass. * @param y The y position of the cursor during this layout pass. * @param blockHW The height and width of * the block. + * @param blockHW.height * @param index The index into the mats list where this rect should * be placed. - * @return Newly created SVG element for the rectangle behind + * @param blockHW.width + * @returns Newly created SVG element for the rectangle behind * the block. */ protected createRect_( @@ -1031,6 +1072,7 @@ export abstract class Flyout extends DeleteArea implements IFlyout { /** * Move a rectangle to sit exactly behind a block, taking into account tabs, * hats, and any other protrusions we invent. + * * @param rect The rectangle to move directly behind the block. * @param block The block the rectangle should be behind. */ @@ -1079,7 +1121,7 @@ export abstract class Flyout extends DeleteArea implements IFlyout { } /** - * @return True if this flyout may be scrolled with a scrollbar or + * @returns True if this flyout may be scrolled with a scrollbar or * by dragging. * @internal */ @@ -1090,8 +1132,9 @@ export abstract class Flyout extends DeleteArea implements IFlyout { /** * Copy a block from the flyout to the workspace and position it correctly. + * * @param oldBlock The flyout block to copy. - * @return The new block in the main workspace. + * @returns The new block in the main workspace. */ private placeNewBlock_(oldBlock: BlockSvg): BlockSvg { const targetWorkspace = this.targetWorkspace; @@ -1113,6 +1156,7 @@ export abstract class Flyout extends DeleteArea implements IFlyout { /** * Positions a block on the target workspace. + * * @param oldBlock The flyout block being copied. * @param block The block to posiiton. */ diff --git a/core/flyout_button.ts b/core/flyout_button.ts index be13c4fb1..15ae5836c 100644 --- a/core/flyout_button.ts +++ b/core/flyout_button.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Class for a button in the flyout. - */ - /** * Class for a button in the flyout. * @class diff --git a/core/flyout_horizontal.ts b/core/flyout_horizontal.ts index 98f08f009..00f6e08cc 100644 --- a/core/flyout_horizontal.ts +++ b/core/flyout_horizontal.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Horizontal flyout tray containing blocks which may be created. - */ - /** * Horizontal flyout tray containing blocks which may be created. * @class diff --git a/core/flyout_metrics_manager.ts b/core/flyout_metrics_manager.ts index af0427704..8df321bad 100644 --- a/core/flyout_metrics_manager.ts +++ b/core/flyout_metrics_manager.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Calculates and reports flyout workspace metrics. - */ - /** * Calculates and reports flyout workspace metrics. * @class diff --git a/core/flyout_vertical.ts b/core/flyout_vertical.ts index 8f64f8f41..316021334 100644 --- a/core/flyout_vertical.ts +++ b/core/flyout_vertical.ts @@ -4,12 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Layout code for a vertical variant of the flyout. - */ - /** * Layout code for a vertical variant of the flyout. + * * @class */ import * as goog from '../closure/goog/goog.js'; @@ -35,6 +32,7 @@ import * as WidgetDiv from './widgetdiv.js'; /** * Class for a flyout. + * * @alias Blockly.VerticalFlyout */ export class VerticalFlyout extends Flyout { @@ -54,8 +52,11 @@ export class VerticalFlyout extends Flyout { /** * Sets the translation of the flyout to match the scrollbars. + * * @param xyRatio Contains a y property which is a float between 0 and 1 * specifying the degree of scrolling and a similar x property. + * @param xyRatio.x + * @param xyRatio.y */ protected override setMetrics_(xyRatio: {x: number, y: number}) { if (!this.isVisible()) { @@ -78,7 +79,8 @@ export class VerticalFlyout extends Flyout { /** * Calculates the x coordinate for the flyout position. - * @return X coordinate. + * + * @returns X coordinate. */ override getX(): number { if (!this.isVisible()) { @@ -126,7 +128,8 @@ export class VerticalFlyout extends Flyout { /** * Calculates the y coordinate for the flyout position. - * @return Y coordinate. + * + * @returns Y coordinate. */ override getY(): number { // Y is always 0 since this is a vertical flyout. @@ -155,6 +158,7 @@ export class VerticalFlyout extends Flyout { /** * Create and set the path for the visible boundaries of the flyout. + * * @param width The width of the flyout, not including the rounded corners. * @param height The height of the flyout, not including rounded corners. */ @@ -190,6 +194,7 @@ export class VerticalFlyout extends Flyout { /** * Scroll the flyout. + * * @param e Mouse wheel scroll event. */ protected override wheel_(e: WheelEvent) { @@ -215,6 +220,7 @@ export class VerticalFlyout extends Flyout { /** * Lay out the blocks in the flyout. + * * @param contents The blocks and buttons to lay out. * @param gaps The visible gaps between blocks. */ @@ -264,9 +270,10 @@ export class VerticalFlyout extends Flyout { * Determine if a drag delta is toward the workspace, based on the position * and orientation of the flyout. This is used in determineDragIntention_ to * determine if a new block should be created or if the flyout should scroll. + * * @param currentDragDeltaXY How far the pointer has moved from the position * at mouse down, in pixel units. - * @return True if the drag is toward the workspace. + * @returns True if the drag is toward the workspace. * @internal */ override isDragTowardWorkspace(currentDragDeltaXY: Coordinate): boolean { @@ -287,7 +294,8 @@ export class VerticalFlyout extends Flyout { /** * Returns the bounding rectangle of the drag target area in pixel units * relative to viewport. - * @return The component's bounding box. Null if drag target area should be + * + * @returns The component's bounding box. Null if drag target area should be * ignored. */ override getClientRect(): Rect|null { diff --git a/core/generator.ts b/core/generator.ts index 44d53e1e0..d3adaa6dd 100644 --- a/core/generator.ts +++ b/core/generator.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Utility functions for generating executable code from - * Blockly code. - */ - /** * Utility functions for generating executable code from * Blockly code. diff --git a/core/gesture.ts b/core/gesture.ts index 94b9dfc06..20262b9d6 100644 --- a/core/gesture.ts +++ b/core/gesture.ts @@ -4,14 +4,10 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview The class representing an in-progress gesture, usually a drag - * or a tap. - */ - /** * The class representing an in-progress gesture, usually a drag * or a tap. + * * @class */ import * as goog from '../closure/goog/goog.js'; @@ -50,6 +46,7 @@ import type {WorkspaceSvg} from './workspace_svg.js'; // TODO: Consider touchcancel/pointercancel. /** * Class for one gesture. + * * @alias Blockly.Gesture */ export class Gesture { @@ -190,6 +187,7 @@ export class Gesture { /** * Sever all links from this object. + * * @internal */ dispose() { @@ -215,6 +213,7 @@ export class Gesture { /** * Update internal state based on an event. + * * @param e The most recent mouse or touch event. */ private updateFromEvent_(e: Event) { @@ -234,9 +233,10 @@ export class Gesture { /** * DO MATH to set currentDragDeltaXY_ based on the most recent mouse position. + * * @param currentXY The most recent mouse/pointer position, in pixel units, * with (0, 0) at the window's top left corner. - * @return True if the drag just exceeded the drag radius for the first time. + * @returns True if the drag just exceeded the drag radius for the first time. */ private updateDragDelta_(currentXY: Coordinate): boolean { this.currentDragDeltaXY_ = @@ -263,7 +263,8 @@ export class Gesture { * gesture. If a block should be dragged from the flyout this function creates * the new block on the main workspace and updates targetBlock_ and * startWorkspace_. - * @return True if a block is being dragged from the flyout. + * + * @returns True if a block is being dragged from the flyout. */ private updateIsDraggingFromFlyout_(): boolean { if (!this.targetBlock_) { @@ -300,7 +301,8 @@ export class Gesture { * the drag radius is exceeded. It should be called no more than once per * gesture. If a bubble should be dragged this function creates the necessary * BubbleDragger and starts the drag. - * @return True if a bubble is being dragged. + * + * @returns True if a bubble is being dragged. */ private updateIsDraggingBubble_(): boolean { if (!this.startBubble_) { @@ -319,7 +321,8 @@ export class Gesture { * gesture. If a block should be dragged, either from the flyout or in the * workspace, this function creates the necessary BlockDragger and starts the * drag. - * @return True if a block is being dragged. + * + * @returns True if a block is being dragged. */ private updateIsDraggingBlock_(): boolean { if (!this.targetBlock_) { @@ -411,6 +414,7 @@ export class Gesture { /** * Start a gesture: update the workspace to indicate that a gesture is in * progress and bind mousemove and mouseup handlers. + * * @param e A mouse down or touch start event. * @internal */ @@ -471,6 +475,7 @@ export class Gesture { /** * Bind gesture events. + * * @param e A mouse down or touch start event. * @internal */ @@ -486,6 +491,7 @@ export class Gesture { /** * Handle a mouse move or touch move event. + * * @param e A mouse move or touch move event. * @internal */ @@ -505,6 +511,7 @@ export class Gesture { /** * Handle a mouse up or touch end event. + * * @param e A mouse up or touch end event. * @internal */ @@ -548,6 +555,7 @@ export class Gesture { /** * Cancel an in-progress gesture. If a workspace or block drag is in * progress, end the drag at the most recent location. + * * @internal */ cancel() { @@ -572,6 +580,7 @@ export class Gesture { /** * Handle a real or faked right-click event by showing a context menu. + * * @param e A mouse move or touch move event. * @internal */ @@ -596,6 +605,7 @@ export class Gesture { /** * Handle a mousedown/touchstart event on a workspace. + * * @param e A mouse down or touch start event. * @param ws The workspace the event hit. * @internal @@ -613,6 +623,7 @@ export class Gesture { /** * Fires a workspace click event. + * * @param ws The workspace that a user clicks on. */ private fireWorkspaceClick_(ws: WorkspaceSvg) { @@ -622,6 +633,7 @@ export class Gesture { /** * Handle a mousedown/touchstart event on a flyout. + * * @param e A mouse down or touch start event. * @param flyout The flyout the event hit. * @internal @@ -638,6 +650,7 @@ export class Gesture { /** * Handle a mousedown/touchstart event on a block. + * * @param e A mouse down or touch start event. * @param block The block the event hit. * @internal @@ -654,6 +667,7 @@ export class Gesture { /** * Handle a mousedown/touchstart event on a bubble. + * * @param e A mouse down or touch start event. * @param bubble The bubble the event hit. * @internal @@ -711,6 +725,7 @@ export class Gesture { /** * Execute a workspace click. When in accessibility mode shift clicking will * move the cursor. + * * @param _e A mouse up or touch end event. */ private doWorkspaceClick_(_e: Event) { @@ -741,6 +756,7 @@ export class Gesture { /** * Record the field that a gesture started on. + * * @param field The field the gesture started on. * @internal */ @@ -757,6 +773,7 @@ export class Gesture { /** * Record the bubble that a gesture started on + * * @param bubble The bubble the gesture started on. * @internal */ @@ -769,6 +786,7 @@ export class Gesture { /** * Record the block that a gesture started on, and set the target block * appropriately. + * * @param block The block the gesture started on. * @internal */ @@ -788,6 +806,7 @@ export class Gesture { * Record the block that a gesture targets, meaning the block that will be * dragged if this turns into a drag. If this block is a shadow, that will be * its first non-shadow parent. + * * @param block The block the gesture targets. */ private setTargetBlock_(block: BlockSvg) { @@ -802,6 +821,7 @@ export class Gesture { /** * Record the workspace that a gesture started on. + * * @param ws The workspace the gesture started on. */ private setStartWorkspace_(ws: WorkspaceSvg) { @@ -812,6 +832,7 @@ export class Gesture { /** * Record the flyout that a gesture started on. + * * @param flyout The flyout the gesture started on. */ private setStartFlyout_(flyout: IFlyout) { @@ -828,7 +849,8 @@ export class Gesture { /** * Whether this gesture is a click on a bubble. This should only be called * when ending a gesture (mouse up, touch end). - * @return Whether this gesture was a click on a bubble. + * + * @returns Whether this gesture was a click on a bubble. */ private isBubbleClick_(): boolean { // A bubble click starts on a bubble and never escapes the drag radius. @@ -839,7 +861,8 @@ export class Gesture { /** * Whether this gesture is a click on a block. This should only be called * when ending a gesture (mouse up, touch end). - * @return Whether this gesture was a click on a block. + * + * @returns Whether this gesture was a click on a block. */ private isBlockClick_(): boolean { // A block click starts on a block, never escapes the drag radius, and is @@ -852,7 +875,8 @@ export class Gesture { /** * Whether this gesture is a click on a field. This should only be called * when ending a gesture (mouse up, touch end). - * @return Whether this gesture was a click on a field. + * + * @returns Whether this gesture was a click on a field. */ private isFieldClick_(): boolean { const fieldClickable = @@ -864,7 +888,8 @@ export class Gesture { /** * Whether this gesture is a click on a workspace. This should only be called * when ending a gesture (mouse up, touch end). - * @return Whether this gesture was a click on a workspace. + * + * @returns Whether this gesture was a click on a workspace. */ private isWorkspaceClick_(): boolean { const onlyTouchedWorkspace = @@ -878,7 +903,8 @@ export class Gesture { * Whether this gesture is a drag of either a workspace or block. * This function is called externally to block actions that cannot be taken * mid-drag (e.g. using the keyboard to delete the selected blocks). - * @return True if this gesture is a drag of a workspace or block. + * + * @returns True if this gesture is a drag of a workspace or block. * @internal */ isDragging(): boolean { @@ -890,7 +916,8 @@ export class Gesture { * Whether this gesture has already been started. In theory every mouse down * has a corresponding mouse up, but in reality it is possible to lose a * mouse up, leaving an in-process gesture hanging. - * @return Whether this gesture was a click on a workspace. + * + * @returns Whether this gesture was a click on a workspace. * @internal */ hasStarted(): boolean { @@ -900,7 +927,8 @@ export class Gesture { /** * Get a list of the insertion markers that currently exist. Block drags have * 0, 1, or 2 insertion markers. - * @return A possibly empty list of insertion marker blocks. + * + * @returns A possibly empty list of insertion marker blocks. * @internal */ getInsertionMarkers(): BlockSvg[] { @@ -913,7 +941,8 @@ export class Gesture { /** * Gets the current dragger if an item is being dragged. Null if nothing is * being dragged. - * @return The dragger that is currently in use or null if no drag is in + * + * @returns The dragger that is currently in use or null if no drag is in * progress. */ getCurrentDragger(): WorkspaceDragger|BubbleDragger|IBlockDragger|null { @@ -929,7 +958,8 @@ export class Gesture { /** * Is a drag or other gesture currently in progress on any workspace? - * @return True if gesture is occurring. + * + * @returns True if gesture is occurring. */ static inProgress(): boolean { const workspaces = common.getAllWorkspaces(); diff --git a/core/grid.ts b/core/grid.ts index 1933635ba..a1255d452 100644 --- a/core/grid.ts +++ b/core/grid.ts @@ -4,14 +4,10 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Object for configuring and updating a workspace grid in - * Blockly. - */ - /** * Object for configuring and updating a workspace grid in * Blockly. + * * @class */ import * as goog from '../closure/goog/goog.js'; @@ -25,6 +21,7 @@ import {GridOptions} from './blockly_options.js'; /** * Class for a workspace's grid. + * * @alias Blockly.Grid */ export class Grid { @@ -64,7 +61,8 @@ export class Grid { /** * Whether blocks should snap to the grid, based on the initial configuration. - * @return True if blocks should snap, false otherwise. + * + * @returns True if blocks should snap, false otherwise. * @internal */ shouldSnap(): boolean { @@ -73,7 +71,8 @@ export class Grid { /** * Get the spacing of the grid points (in px). - * @return The spacing of the grid points. + * + * @returns The spacing of the grid points. * @internal */ getSpacing(): number { @@ -83,7 +82,8 @@ export class Grid { /** * Get the ID of the pattern element, which should be randomized to avoid * conflicts with other Blockly instances on the page. - * @return The pattern ID. + * + * @returns The pattern ID. * @internal */ getPatternId(): string { @@ -92,6 +92,7 @@ export class Grid { /** * Update the grid with a new scale. + * * @param scale The new workspace scale. * @internal */ @@ -118,6 +119,7 @@ export class Grid { /** * Set the attributes on one of the lines in the grid. Use this to update the * length and stroke width of the grid lines. + * * @param line Which line to update. * @param width The new stroke size (in px). * @param x1 The new x start position of the line (in px). @@ -140,6 +142,7 @@ export class Grid { /** * Move the grid to a new x and y position, and make sure that change is * visible. + * * @param x The new x position of the grid (in px). * @param y The new y position of the grid (in px). * @internal @@ -157,10 +160,11 @@ export class Grid { /** * Create the DOM for the grid described by options. + * * @param rnd A random ID to append to the pattern's ID. * @param gridOptions The object containing grid configuration. * @param defs The root SVG element for this workspace's defs. - * @return The SVG element for the grid pattern. + * @returns The SVG element for the grid pattern. * @internal */ static createDom(rnd: string, gridOptions: GridOptions, defs: SVGElement): diff --git a/core/icon.ts b/core/icon.ts index aec490590..3f734aa41 100644 --- a/core/icon.ts +++ b/core/icon.ts @@ -4,12 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Object representing an icon on a block. - */ - /** * Object representing an icon on a block. + * * @class */ import * as goog from '../closure/goog/goog.js'; @@ -27,6 +24,7 @@ import * as svgMath from './utils/svg_math.js'; /** * Class for an icon. + * * @alias Blockly.Icon */ export abstract class Icon { @@ -100,7 +98,8 @@ export abstract class Icon { /** * Is the associated bubble visible? - * @return True if the bubble is visible. + * + * @returns True if the bubble is visible. */ isVisible(): boolean { return !!this.bubble_; @@ -108,6 +107,7 @@ export abstract class Icon { /** * Clicking on the icon toggles if the bubble is visible. + * * @param e Mouse click event. */ protected iconClick_(e: MouseEvent) { @@ -129,6 +129,7 @@ export abstract class Icon { /** * Notification that the icon has moved. Update the arrow accordingly. + * * @param xy Absolute location in workspace coordinates. */ setIconLocation(xy: Coordinate) { @@ -156,7 +157,8 @@ export abstract class Icon { /** * Returns the center of the block's icon relative to the surface. - * @return Object with x and y properties in workspace coordinates. + * + * @returns Object with x and y properties in workspace coordinates. */ getIconLocation(): Coordinate|null { return this.iconXY_; @@ -166,7 +168,8 @@ export abstract class Icon { * Get the size of the icon as used for rendering. * This differs from the actual size of the icon, because it bulges slightly * out of its row rather than increasing the height of its row. - * @return Height and width. + * + * @returns Height and width. */ getCorrectedSize(): Size { // TODO (#2562): Remove getCorrectedSize. @@ -175,6 +178,7 @@ export abstract class Icon { /** * Draw the icon. + * * @param _group The icon group. */ protected drawIcon_(_group: Element) {} @@ -182,6 +186,7 @@ export abstract class Icon { /** * Show or hide the icon. + * * @param _visible True if the icon should be visible. */ setVisible(_visible: boolean) {} diff --git a/core/inject.ts b/core/inject.ts index 89c23efcc..f6ac1d06e 100644 --- a/core/inject.ts +++ b/core/inject.ts @@ -4,12 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Functions for injecting Blockly into a web page. - */ - /** * Functions for injecting Blockly into a web page. + * * @namespace Blockly.inject */ import * as goog from '../closure/goog/goog.js'; @@ -40,9 +37,10 @@ import {WorkspaceSvg} from './workspace_svg.js'; /** * Inject a Blockly editor into the specified container element (usually a div). + * * @param container Containing element, or its ID, or a CSS selector. * @param opt_options Optional dictionary of options. - * @return Newly created main workspace. + * @returns Newly created main workspace. * @alias Blockly.inject */ export function inject( @@ -101,9 +99,10 @@ export function inject( /** * Create the SVG image. + * * @param container Containing element. * @param options Dictionary of options. - * @return Newly created SVG image. + * @returns Newly created SVG image. */ function createDom(container: Element, options: Options): Element { // Sadly browsers (Chrome vs Firefox) are currently inconsistent in laying @@ -152,11 +151,12 @@ function createDom(container: Element, options: Options): Element { /** * Create a main workspace and add it to the SVG. + * * @param svg SVG element with pattern defined. * @param options Dictionary of options. * @param blockDragSurface Drag surface SVG for the blocks. * @param workspaceDragSurface Drag surface SVG for the workspace. - * @return Newly created main workspace. + * @returns Newly created main workspace. */ function createMainWorkspace( svg: Element, options: Options, blockDragSurface: BlockDragSurfaceSvg, @@ -206,6 +206,7 @@ function createMainWorkspace( /** * Initialize Blockly with various handlers. + * * @param mainWorkspace Newly created main workspace. */ function init(mainWorkspace: WorkspaceSvg) { @@ -275,6 +276,7 @@ function init(mainWorkspace: WorkspaceSvg) { /** * Handle a key-down on SVG drawing surface. Does nothing if the main workspace * is not visible. + * * @param e Key down event. */ // TODO (https://github.com/google/blockly/issues/1998) handle cases where there @@ -340,6 +342,7 @@ function bindDocumentEvents() { /** * Load sounds for the given workspace. + * * @param pathToMedia The path to the media directory. * @param workspace The workspace to load sounds for. */ @@ -369,6 +372,9 @@ function loadSounds(pathToMedia: string, workspace: WorkspaceSvg) { // Bind temporary hooks that preload the sounds. const soundBinds: AnyDuringMigration[] = []; + /** + * + */ function unbindSounds() { while (soundBinds.length) { browserEvents.unbind(soundBinds.pop()); diff --git a/core/input.ts b/core/input.ts index fe6796619..86c235942 100644 --- a/core/input.ts +++ b/core/input.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Object representing an input (value, statement, or dummy). - */ - /** * Object representing an input (value, statement, or dummy). * @class diff --git a/core/input_types.ts b/core/input_types.ts index c7ef64382..30d2a620a 100644 --- a/core/input_types.ts +++ b/core/input_types.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview An enum for the possible types of inputs. - */ - /** * An enum for the possible types of inputs. * @namespace Blockly.inputTypes diff --git a/core/insertion_marker_manager.ts b/core/insertion_marker_manager.ts index abdfca4de..41d0dfcb9 100644 --- a/core/insertion_marker_manager.ts +++ b/core/insertion_marker_manager.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Class that controls updates to connections during drags. - */ - /** * Class that controls updates to connections during drags. * @class diff --git a/core/interfaces/i_ast_node_location.ts b/core/interfaces/i_ast_node_location.ts index c9929382f..814873852 100644 --- a/core/interfaces/i_ast_node_location.ts +++ b/core/interfaces/i_ast_node_location.ts @@ -4,12 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview The interface for an AST node location. - */ - /** * The interface for an AST node location. + * * @namespace Blockly.IASTNodeLocation */ import * as goog from '../../closure/goog/goog.js'; @@ -18,6 +15,7 @@ goog.declareModuleId('Blockly.IASTNodeLocation'); /** * An AST node location interface. + * * @alias Blockly.IASTNodeLocation */ export interface IASTNodeLocation {} diff --git a/core/interfaces/i_ast_node_location_svg.ts b/core/interfaces/i_ast_node_location_svg.ts index 287e77919..8bc51ec26 100644 --- a/core/interfaces/i_ast_node_location_svg.ts +++ b/core/interfaces/i_ast_node_location_svg.ts @@ -4,12 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview The interface for an AST node location SVG. - */ - /** * The interface for an AST node location SVG. + * * @namespace Blockly.IASTNodeLocationSvg */ import * as goog from '../../closure/goog/goog.js'; @@ -20,17 +17,20 @@ import type {IASTNodeLocation} from './i_ast_node_location.js'; /** * An AST node location SVG interface. + * * @alias Blockly.IASTNodeLocationSvg */ export interface IASTNodeLocationSvg extends IASTNodeLocation { /** * Add the marker SVG to this node's SVG group. + * * @param markerSvg The SVG root of the marker to be added to the SVG group. */ setMarkerSvg(markerSvg: SVGElement|null): void; /** * Add the cursor SVG to this node's SVG group. + * * @param cursorSvg The SVG root of the cursor to be added to the SVG group. */ setCursorSvg(cursorSvg: SVGElement|null): void; diff --git a/core/interfaces/i_ast_node_location_with_block.ts b/core/interfaces/i_ast_node_location_with_block.ts index 72e5dba12..14a2e5e71 100644 --- a/core/interfaces/i_ast_node_location_with_block.ts +++ b/core/interfaces/i_ast_node_location_with_block.ts @@ -4,14 +4,10 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview The interface for an AST node location that has an associated - * block. - */ - /** * The interface for an AST node location that has an associated * block. + * * @namespace Blockly.IASTNodeLocationWithBlock */ import * as goog from '../../closure/goog/goog.js'; @@ -27,12 +23,14 @@ import type {Block} from '../block.js'; /** * An AST node location that has an associated block. + * * @alias Blockly.IASTNodeLocationWithBlock */ export interface IASTNodeLocationWithBlock extends IASTNodeLocation { /** * Get the source block associated with this node. - * @return The source block. + * + * @returns The source block. */ getSourceBlock(): Block; } diff --git a/core/interfaces/i_autohideable.ts b/core/interfaces/i_autohideable.ts index c1b81781e..542e3edf7 100644 --- a/core/interfaces/i_autohideable.ts +++ b/core/interfaces/i_autohideable.ts @@ -4,14 +4,10 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview The interface for a component that is automatically hidden - * when WorkspaceSvg.hideChaff is called. - */ - /** * The interface for a component that is automatically hidden * when WorkspaceSvg.hideChaff is called. + * * @namespace Blockly.IAutoHideable */ import * as goog from '../../closure/goog/goog.js'; @@ -22,11 +18,13 @@ import type {IComponent} from './i_component.js'; /** * Interface for a component that can be automatically hidden. + * * @alias Blockly.IAutoHideable */ export interface IAutoHideable extends IComponent { /** * Hides the component. Called in WorkspaceSvg.hideChaff. + * * @param onlyClosePopups Whether only popups should be closed. * Flyouts should not be closed if this is true. */ diff --git a/core/interfaces/i_block_dragger.ts b/core/interfaces/i_block_dragger.ts index 7aa74f15c..e70cf7f2a 100644 --- a/core/interfaces/i_block_dragger.ts +++ b/core/interfaces/i_block_dragger.ts @@ -4,12 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview The interface for a block dragger. - */ - /** * The interface for a block dragger. + * * @namespace Blockly.IBlockDragger */ import * as goog from '../../closure/goog/goog.js'; @@ -27,11 +24,13 @@ goog.declareModuleId('Blockly.IBlockDragger'); /** * A block dragger interface. + * * @alias Blockly.IBlockDragger */ export interface IBlockDragger { /** * Start dragging a block. This includes moving it to the drag surface. + * * @param currentDragDeltaXY How far the pointer has moved from the position * at mouse down, in pixel units. * @param healStack Whether or not to heal the stack after disconnecting. @@ -41,6 +40,7 @@ export interface IBlockDragger { /** * Execute a step of block dragging, based on the given event. Update the * display accordingly. + * * @param e The most recent move event. * @param currentDragDeltaXY How far the pointer has moved from the position * at the start of the drag, in pixel units. @@ -49,6 +49,7 @@ export interface IBlockDragger { /** * Finish a block drag and put the block back on the workspace. + * * @param e The mouseup/touchend event. * @param currentDragDeltaXY How far the pointer has moved from the position * at the start of the drag, in pixel units. @@ -58,7 +59,8 @@ export interface IBlockDragger { /** * Get a list of the insertion markers that currently exist. Drags have 0, 1, * or 2 insertion markers. - * @return A possibly empty list of insertion marker blocks. + * + * @returns A possibly empty list of insertion marker blocks. */ getInsertionMarkers(): BlockSvg[]; diff --git a/core/interfaces/i_bounded_element.ts b/core/interfaces/i_bounded_element.ts index 7e8f86627..00e769ca6 100644 --- a/core/interfaces/i_bounded_element.ts +++ b/core/interfaces/i_bounded_element.ts @@ -4,12 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview The interface for a bounded element. - */ - /** * The interface for a bounded element. + * * @namespace Blockly.IBoundedElement */ import * as goog from '../../closure/goog/goog.js'; @@ -23,18 +20,21 @@ goog.declareModuleId('Blockly.IBoundedElement'); /** * A bounded element interface. + * * @alias Blockly.IBoundedElement */ export interface IBoundedElement { /** * Returns the coordinates of a bounded element describing the dimensions of * the element. Coordinate system: workspace coordinates. - * @return Object with coordinates of the bounded element. + * + * @returns Object with coordinates of the bounded element. */ getBoundingRectangle(): Rect; /** * Move the element by a relative offset. + * * @param dx Horizontal offset in workspace units. * @param dy Vertical offset in workspace units. */ diff --git a/core/interfaces/i_bubble.ts b/core/interfaces/i_bubble.ts index c846ef122..2c861c325 100644 --- a/core/interfaces/i_bubble.ts +++ b/core/interfaces/i_bubble.ts @@ -4,12 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview The interface for a bubble. - */ - /** * The interface for a bubble. + * * @namespace Blockly.IBubble */ import * as goog from '../../closure/goog/goog.js'; @@ -30,19 +27,22 @@ import type {IDraggable} from './i_draggable.js'; /** * A bubble interface. + * * @alias Blockly.IBubble */ export interface IBubble extends IDraggable, IContextMenu { /** * Return the coordinates of the top-left corner of this bubble's body * relative to the drawing surface's origin (0,0), in workspace units. - * @return Object with .x and .y properties. + * + * @returns Object with .x and .y properties. */ getRelativeToSurfaceXY(): Coordinate; /** * Return the root node of the bubble's SVG group. - * @return The root SVG node of the bubble's group. + * + * @returns The root SVG node of the bubble's group. */ getSvgRoot(): SVGElement; @@ -50,12 +50,14 @@ export interface IBubble extends IDraggable, IContextMenu { * Set whether auto-layout of this bubble is enabled. The first time a bubble * is shown it positions itself to not cover any blocks. Once a user has * dragged it to reposition, it renders where the user put it. + * * @param enable True if auto-layout should be enabled, false otherwise. */ setAutoLayout(enable: boolean): void; /** * Sets whether or not this bubble is being dragged. + * * @param adding True if dragging, false otherwise. */ setDragging(dragging: boolean): void; @@ -63,6 +65,7 @@ export interface IBubble extends IDraggable, IContextMenu { /** * Move this bubble during a drag, taking into account whether or not there is * a drag surface. + * * @param dragSurface The surface that carries rendered items during a drag, * or null if no drag surface is in use. * @param newLoc The location to translate to, in workspace coordinates. @@ -72,6 +75,7 @@ export interface IBubble extends IDraggable, IContextMenu { /** * Move the bubble to the specified location in workspace coordinates. + * * @param x The x position to move to. * @param y The y position to move to. */ @@ -79,6 +83,7 @@ export interface IBubble extends IDraggable, IContextMenu { /** * Update the style of this bubble when it is dragged over a delete area. + * * @param enable True if the bubble is about to be deleted, false otherwise. */ setDeleteStyle(enable: boolean): void; diff --git a/core/interfaces/i_collapsible_toolbox_item.ts b/core/interfaces/i_collapsible_toolbox_item.ts index 48a384aa1..ea1723f53 100644 --- a/core/interfaces/i_collapsible_toolbox_item.ts +++ b/core/interfaces/i_collapsible_toolbox_item.ts @@ -4,12 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview The interface for a collapsible toolbox item. - */ - /** * The interface for a collapsible toolbox item. + * * @namespace Blockly.ICollapsibleToolboxItem */ import * as goog from '../../closure/goog/goog.js'; @@ -26,18 +23,21 @@ import type {IToolboxItem} from './i_toolbox_item.js'; /** * Interface for an item in the toolbox that can be collapsed. + * * @alias Blockly.ICollapsibleToolboxItem */ export interface ICollapsibleToolboxItem extends ISelectableToolboxItem { /** * Gets any children toolbox items. (ex. Gets the subcategories) - * @return The child toolbox items. + * + * @returns The child toolbox items. */ getChildToolboxItems(): IToolboxItem[]; /** * Whether the toolbox item is expanded to show its child subcategories. - * @return True if the toolbox item shows its children, false if it is + * + * @returns True if the toolbox item shows its children, false if it is * collapsed. */ isExpanded(): boolean; diff --git a/core/interfaces/i_component.ts b/core/interfaces/i_component.ts index 9f8a19660..115f34376 100644 --- a/core/interfaces/i_component.ts +++ b/core/interfaces/i_component.ts @@ -4,14 +4,10 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Interface for a workspace component that can be registered with - * the ComponentManager. - */ - /** * Interface for a workspace component that can be registered with * the ComponentManager. + * * @namespace Blockly.IComponent */ import * as goog from '../../closure/goog/goog.js'; @@ -21,6 +17,7 @@ goog.declareModuleId('Blockly.IComponent'); /** * The interface for a workspace component that can be registered with the * ComponentManager. + * * @alias Blockly.IComponent */ export interface IComponent { diff --git a/core/interfaces/i_connection_checker.ts b/core/interfaces/i_connection_checker.ts index 598d0f9dc..edde750a6 100644 --- a/core/interfaces/i_connection_checker.ts +++ b/core/interfaces/i_connection_checker.ts @@ -4,14 +4,10 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview The interface for an object that encapsulates logic for - * checking whether a potential connection is safe and valid. - */ - /** * The interface for an object that encapsulates logic for * checking whether a potential connection is safe and valid. + * * @namespace Blockly.IConnectionChecker */ import * as goog from '../../closure/goog/goog.js'; @@ -29,18 +25,20 @@ goog.declareModuleId('Blockly.IConnectionChecker'); /** * Class for connection type checking logic. + * * @alias Blockly.IConnectionChecker */ export interface IConnectionChecker { /** * Check whether the current connection can connect with the target * connection. + * * @param a Connection to check compatibility with. * @param b Connection to check compatibility with. * @param isDragging True if the connection is being made by dragging a block. * @param opt_distance The max allowable distance between the connections for * drag checks. - * @return Whether the connection is legal. + * @returns Whether the connection is legal. */ canConnect( a: Connection|null, b: Connection|null, isDragging: boolean, @@ -49,12 +47,13 @@ export interface IConnectionChecker { /** * Checks whether the current connection can connect with the target * connection, and return an error code if there are problems. + * * @param a Connection to check compatibility with. * @param b Connection to check compatibility with. * @param isDragging True if the connection is being made by dragging a block. * @param opt_distance The max allowable distance between the connections for * drag checks. - * @return Connection.CAN_CONNECT if the connection is legal, an error code + * @returns Connection.CAN_CONNECT if the connection is legal, an error code * otherwise. */ canConnectWithReason( @@ -63,10 +62,11 @@ export interface IConnectionChecker { /** * Helper method that translates a connection error code into a string. + * * @param errorCode The error code. * @param a One of the two connections being checked. * @param b The second of the two connections being checked. - * @return A developer-readable error string. + * @returns A developer-readable error string. */ getErrorMessage(errorCode: number, a: Connection|null, b: Connection|null): string; @@ -74,9 +74,10 @@ export interface IConnectionChecker { /** * Check that connecting the given connections is safe, meaning that it would * not break any of Blockly's basic assumptions (e.g. no self connections). + * * @param a The first of the connections to check. * @param b The second of the connections to check. - * @return An enum with the reason this connection is safe or unsafe. + * @returns An enum with the reason this connection is safe or unsafe. */ doSafetyChecks(a: Connection|null, b: Connection|null): number; @@ -84,18 +85,20 @@ export interface IConnectionChecker { * Check whether this connection is compatible with another connection with * respect to the value type system. E.g. square_root("Hello") is not * compatible. + * * @param a Connection to compare. * @param b Connection to compare against. - * @return True if the connections share a type. + * @returns True if the connections share a type. */ doTypeChecks(a: Connection, b: Connection): boolean; /** * Check whether this connection can be made by dragging. + * * @param a Connection to compare. * @param b Connection to compare against. * @param distance The maximum allowable distance between connections. - * @return True if the connection is allowed during a drag. + * @returns True if the connection is allowed during a drag. */ doDragChecks(a: RenderedConnection, b: RenderedConnection, distance: number): boolean; diff --git a/core/interfaces/i_contextmenu.ts b/core/interfaces/i_contextmenu.ts index 358290c50..b0a28630e 100644 --- a/core/interfaces/i_contextmenu.ts +++ b/core/interfaces/i_contextmenu.ts @@ -4,12 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview The interface for an object that supports a right-click. - */ - /** * The interface for an object that supports a right-click. + * * @namespace Blockly.IContextMenu */ import * as goog from '../../closure/goog/goog.js'; @@ -20,6 +17,7 @@ goog.declareModuleId('Blockly.IContextMenu'); export interface IContextMenu { /** * Show the context menu for this object. + * * @param e Mouse event. */ showContextMenu(e: Event): void; diff --git a/core/interfaces/i_copyable.ts b/core/interfaces/i_copyable.ts index b44107560..9c780a317 100644 --- a/core/interfaces/i_copyable.ts +++ b/core/interfaces/i_copyable.ts @@ -4,12 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview The interface for an object that is copyable. - */ - /** * The interface for an object that is copyable. + * * @namespace Blockly.ICopyable */ import * as goog from '../../closure/goog/goog.js'; @@ -23,7 +20,8 @@ import type {ISelectable} from './i_selectable.js'; export interface ICopyable extends ISelectable { /** * Encode for copying. - * @return Copy metadata. + * + * @returns Copy metadata. * @internal */ toCopyData(): CopyData|null; diff --git a/core/interfaces/i_deletable.ts b/core/interfaces/i_deletable.ts index e0b1deaa4..4a1683574 100644 --- a/core/interfaces/i_deletable.ts +++ b/core/interfaces/i_deletable.ts @@ -4,12 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview The interface for an object that is deletable. - */ - /** * The interface for an object that is deletable. + * * @namespace Blockly.IDeletable */ import * as goog from '../../closure/goog/goog.js'; @@ -18,12 +15,14 @@ goog.declareModuleId('Blockly.IDeletable'); /** * The interface for an object that can be deleted. + * * @alias Blockly.IDeletable */ export interface IDeletable { /** * Get whether this object is deletable or not. - * @return True if deletable. + * + * @returns True if deletable. */ isDeletable(): boolean; } diff --git a/core/interfaces/i_delete_area.ts b/core/interfaces/i_delete_area.ts index 185552dbd..b96d8afea 100644 --- a/core/interfaces/i_delete_area.ts +++ b/core/interfaces/i_delete_area.ts @@ -4,14 +4,10 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview The interface for a component that can delete a block or bubble - * that is dropped on top of it. - */ - /** * The interface for a component that can delete a block or bubble * that is dropped on top of it. + * * @namespace Blockly.IDeleteArea */ import * as goog from '../../closure/goog/goog.js'; @@ -29,6 +25,7 @@ import type {IDraggable} from './i_draggable.js'; /** * Interface for a component that can delete a block or bubble that is dropped * on top of it. + * * @alias Blockly.IDeleteArea */ export interface IDeleteArea extends IDragTarget { @@ -37,9 +34,10 @@ export interface IDeleteArea extends IDragTarget { * this area. * This method should check if the element is deletable and is always called * before onDragEnter/onDragOver/onDragExit. + * * @param element The block or bubble currently being dragged. * @param couldConnect Whether the element could could connect to another. - * @return Whether the element provided would be deleted if dropped on this + * @returns Whether the element provided would be deleted if dropped on this * area. */ wouldDelete(element: IDraggable, couldConnect: boolean): boolean; diff --git a/core/interfaces/i_drag_target.ts b/core/interfaces/i_drag_target.ts index 52c8aff0b..e7014f45a 100644 --- a/core/interfaces/i_drag_target.ts +++ b/core/interfaces/i_drag_target.ts @@ -4,14 +4,10 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview The interface for a component that has a handler for when a - * block is dropped on top of it. - */ - /** * The interface for a component that has a handler for when a * block is dropped on top of it. + * * @namespace Blockly.IDragTarget */ import * as goog from '../../closure/goog/goog.js'; @@ -35,19 +31,22 @@ import type {IComponent} from './i_component.js'; /** * Interface for a component with custom behaviour when a block or bubble is * dragged over or dropped on top of it. + * * @alias Blockly.IDragTarget */ export interface IDragTarget extends IComponent { /** * Returns the bounding rectangle of the drag target area in pixel units * relative to viewport. - * @return The component's bounding box. Null if drag target area should be + * + * @returns The component's bounding box. Null if drag target area should be * ignored. */ getClientRect(): Rect|null; /** * Handles when a cursor with a block or bubble enters this drag target. + * * @param dragElement The block or bubble currently being dragged. */ onDragEnter(dragElement: IDraggable): void; @@ -55,12 +54,14 @@ export interface IDragTarget extends IComponent { /** * Handles when a cursor with a block or bubble is dragged over this drag * target. + * * @param dragElement The block or bubble currently being dragged. */ onDragOver(dragElement: IDraggable): void; /** * Handles when a cursor with a block or bubble exits this drag target. + * * @param dragElement The block or bubble currently being dragged. */ onDragExit(dragElement: IDraggable): void; @@ -68,6 +69,7 @@ export interface IDragTarget extends IComponent { /** * Handles when a block or bubble is dropped on this component. * Should not handle delete here. + * * @param dragElement The block or bubble currently being dragged. */ onDrop(dragElement: IDraggable): void; @@ -76,8 +78,9 @@ export interface IDragTarget extends IComponent { * Returns whether the provided block or bubble should not be moved after * being dropped on this component. If true, the element will return to where * it was when the drag started. + * * @param dragElement The block or bubble currently being dragged. - * @return Whether the block or bubble provided should be returned to drag + * @returns Whether the block or bubble provided should be returned to drag * start. */ shouldPreventMove(dragElement: IDraggable): boolean; diff --git a/core/interfaces/i_draggable.ts b/core/interfaces/i_draggable.ts index bf115a5aa..313525d5e 100644 --- a/core/interfaces/i_draggable.ts +++ b/core/interfaces/i_draggable.ts @@ -4,12 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview The interface for an object that is draggable. - */ - /** * The interface for an object that is draggable. + * * @namespace Blockly.IDraggable */ import * as goog from '../../closure/goog/goog.js'; @@ -20,6 +17,7 @@ import type {IDeletable} from './i_deletable.js'; /** * The interface for an object that can be dragged. + * * @alias Blockly.IDraggable */ export interface IDraggable extends IDeletable {} diff --git a/core/interfaces/i_flyout.ts b/core/interfaces/i_flyout.ts index fac957fd8..ac2d9ca0f 100644 --- a/core/interfaces/i_flyout.ts +++ b/core/interfaces/i_flyout.ts @@ -4,12 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview The interface for a flyout. - */ - /** * The interface for a flyout. + * * @namespace Blockly.IFlyout */ import * as goog from '../../closure/goog/goog.js'; @@ -38,6 +35,7 @@ import type {IRegistrable} from './i_registrable.js'; /** * Interface for a flyout. + * * @alias Blockly.IFlyout */ export interface IFlyout extends IRegistrable { @@ -63,14 +61,16 @@ export interface IFlyout extends IRegistrable { * Creates the flyout's DOM. Only needs to be called once. The flyout can * either exist as its own svg element or be a g element nested inside a * separate svg element. + * * @param tagName The type of tag to put the flyout in. This should be * or . - * @return The flyout's SVG group. + * @returns The flyout's SVG group. */ createDom(tagName: string|Svg|Svg): SVGElement; /** * Initializes the flyout. + * * @param targetWorkspace The workspace in which to create new blocks. */ init(targetWorkspace: WorkspaceSvg): void; @@ -83,25 +83,29 @@ export interface IFlyout extends IRegistrable { /** * Get the width of the flyout. - * @return The width of the flyout. + * + * @returns The width of the flyout. */ getWidth(): number; /** * Get the height of the flyout. - * @return The height of the flyout. + * + * @returns The height of the flyout. */ getHeight(): number; /** * Get the workspace inside the flyout. - * @return The workspace inside the flyout. + * + * @returns The workspace inside the flyout. */ getWorkspace(): WorkspaceSvg; /** * Is the flyout visible? - * @return True if visible. + * + * @returns True if visible. */ isVisible(): boolean; @@ -109,12 +113,14 @@ export interface IFlyout extends IRegistrable { * Set whether the flyout is visible. A value of true does not necessarily * mean that the flyout is shown. It could be hidden because its container is * hidden. + * * @param visible True if visible. */ setVisible(visible: boolean): void; /** * Set whether this flyout's container is visible. + * * @param visible Whether the container is visible. */ setContainerVisible(visible: boolean): void; @@ -124,6 +130,7 @@ export interface IFlyout extends IRegistrable { /** * Show and populate the flyout. + * * @param flyoutDef Contents to display in the flyout. This is either an array * of Nodes, a NodeList, a toolbox definition, or a string with the name * of the dynamic category. @@ -132,8 +139,9 @@ export interface IFlyout extends IRegistrable { /** * Create a copy of this block on the workspace. + * * @param originalBlock The block to copy from the flyout. - * @return The newly created block. + * @returns The newly created block. * @throws {Error} if something went wrong with deserialization. */ createBlock(originalBlock: BlockSvg): BlockSvg; @@ -142,20 +150,22 @@ export interface IFlyout extends IRegistrable { reflow(): void; /** - * @return True if this flyout may be scrolled with a scrollbar or by + * @returns True if this flyout may be scrolled with a scrollbar or by * dragging. */ isScrollable(): boolean; /** * Calculates the x coordinate for the flyout position. - * @return X coordinate. + * + * @returns X coordinate. */ getX(): number; /** * Calculates the y coordinate for the flyout position. - * @return Y coordinate. + * + * @returns Y coordinate. */ getY(): number; @@ -166,17 +176,19 @@ export interface IFlyout extends IRegistrable { * Determine if a drag delta is toward the workspace, based on the position * and orientation of the flyout. This is used in determineDragIntention_ to * determine if a new block should be created or if the flyout should scroll. + * * @param currentDragDeltaXY How far the pointer has moved from the position * at mouse down, in pixel units. - * @return True if the drag is toward the workspace. + * @returns True if the drag is toward the workspace. */ isDragTowardWorkspace(currentDragDeltaXY: Coordinate): boolean; /** * Does this flyout allow you to create a new instance of the given block? * Used for deciding if a block can be "dragged out of" the flyout. + * * @param block The block to copy from the flyout. - * @return True if you can create a new instance of the block, false + * @returns True if you can create a new instance of the block, false * otherwise. */ isBlockCreatable(block: BlockSvg): boolean; diff --git a/core/interfaces/i_keyboard_accessible.ts b/core/interfaces/i_keyboard_accessible.ts index 327cf5d51..a91793a9a 100644 --- a/core/interfaces/i_keyboard_accessible.ts +++ b/core/interfaces/i_keyboard_accessible.ts @@ -4,12 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview The interface for objects that handle keyboard shortcuts. - */ - /** * The interface for objects that handle keyboard shortcuts. + * * @namespace Blockly.IKeyboardAccessible */ import * as goog from '../../closure/goog/goog.js'; @@ -23,13 +20,15 @@ goog.declareModuleId('Blockly.IKeyboardAccessible'); /** * An interface for an object that handles keyboard shortcuts. + * * @alias Blockly.IKeyboardAccessible */ export interface IKeyboardAccessible { /** * Handles the given keyboard shortcut. + * * @param shortcut The shortcut to be handled. - * @return True if the shortcut has been handled, false otherwise. + * @returns True if the shortcut has been handled, false otherwise. */ onShortcut(shortcut: KeyboardShortcut): boolean; } diff --git a/core/interfaces/i_metrics_manager.ts b/core/interfaces/i_metrics_manager.ts index ea0d236c9..a38bca1d5 100644 --- a/core/interfaces/i_metrics_manager.ts +++ b/core/interfaces/i_metrics_manager.ts @@ -4,12 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview The interface for a metrics manager. - */ - /** * The interface for a metrics manager. + * * @namespace Blockly.IMetricsManager */ import * as goog from '../../closure/goog/goog.js'; @@ -31,18 +28,21 @@ goog.declareModuleId('Blockly.IMetricsManager'); /** * Interface for a metrics manager. + * * @alias Blockly.IMetricsManager */ export interface IMetricsManager { /** * Returns whether the scroll area has fixed edges. - * @return Whether the scroll area has fixed edges. + * + * @returns Whether the scroll area has fixed edges. * @internal */ hasFixedEdges(): boolean; /** * Returns the metrics for the scroll area of the workspace. + * * @param opt_getWorkspaceCoordinates True to get the scroll metrics in * workspace coordinates, false to get them in pixel coordinates. * @param opt_viewMetrics The view metrics if they have been previously @@ -51,7 +51,7 @@ export interface IMetricsManager { * @param opt_contentMetrics The content metrics if they have been previously * computed. Passing in null may cause the content metrics to be computed * again, if it is needed. - * @return The metrics for the scroll container + * @returns The metrics for the scroll container */ getScrollMetrics( opt_getWorkspaceCoordinates?: boolean, opt_viewMetrics?: ContainerRegion, @@ -61,8 +61,9 @@ export interface IMetricsManager { * Gets the width and the height of the flyout on the workspace in pixel * coordinates. Returns 0 for the width and height if the workspace has a * category toolbox instead of a simple toolbox. + * * @param opt_own Whether to only return the workspace's own flyout. - * @return The width and height of the flyout. + * @returns The width and height of the flyout. */ getFlyoutMetrics(opt_own?: boolean): ToolboxMetrics; @@ -72,14 +73,16 @@ export interface IMetricsManager { * a simple toolbox instead of a category toolbox. To get the width and height * of a * simple toolbox @see {@link getFlyoutMetrics}. - * @return The object with the width, height and position of the toolbox. + * + * @returns The object with the width, height and position of the toolbox. */ getToolboxMetrics(): ToolboxMetrics; /** * Gets the width and height of the workspace's parent SVG element in pixel * coordinates. This area includes the toolbox and the visible workspace area. - * @return The width and height of the workspace's parent SVG element. + * + * @returns The width and height of the workspace's parent SVG element. */ getSvgMetrics(): Size; @@ -87,16 +90,18 @@ export interface IMetricsManager { * Gets the absolute left and absolute top in pixel coordinates. * This is where the visible workspace starts in relation to the SVG * container. - * @return The absolute metrics for the workspace. + * + * @returns The absolute metrics for the workspace. */ getAbsoluteMetrics(): AbsoluteMetrics; /** * Gets the metrics for the visible workspace in either pixel or workspace * coordinates. The visible workspace does not include the toolbox or flyout. + * * @param opt_getWorkspaceCoordinates True to get the view metrics in * workspace coordinates, false to get them in pixel coordinates. - * @return The width, height, top and left of the viewport in either workspace + * @returns The width, height, top and left of the viewport in either workspace * coordinates or pixel coordinates. */ getViewMetrics(opt_getWorkspaceCoordinates?: boolean): ContainerRegion; @@ -105,9 +110,10 @@ export interface IMetricsManager { * Gets content metrics in either pixel or workspace coordinates. * The content area is a rectangle around all the top bounded elements on the * workspace (workspace comments and blocks). + * * @param opt_getWorkspaceCoordinates True to get the content metrics in * workspace coordinates, false to get them in pixel coordinates. - * @return The metrics for the content container. + * @returns The metrics for the content container. */ getContentMetrics(opt_getWorkspaceCoordinates?: boolean): ContainerRegion; @@ -139,13 +145,15 @@ export interface IMetricsManager { * .flyoutHeight: Height of the flyout if it is always open. Otherwise zero. * .toolboxPosition: Top, bottom, left or right. Use TOOLBOX_AT constants to * compare. - * @return Contains size and position metrics of a top level workspace. + * + * @returns Contains size and position metrics of a top level workspace. */ getMetrics(): Metrics; /** * Returns common metrics used by UI elements. - * @return The UI metrics. + * + * @returns The UI metrics. */ getUiMetrics(): UiMetrics; } diff --git a/core/interfaces/i_movable.ts b/core/interfaces/i_movable.ts index 8fd4ed58a..eed624de9 100644 --- a/core/interfaces/i_movable.ts +++ b/core/interfaces/i_movable.ts @@ -4,12 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview The interface for an object that is movable. - */ - /** * The interface for an object that is movable. + * * @namespace Blockly.IMovable */ import * as goog from '../../closure/goog/goog.js'; @@ -18,12 +15,14 @@ goog.declareModuleId('Blockly.IMovable'); /** * The interface for an object that is movable. + * * @alias Blockly.IMovable */ export interface IMovable { /** * Get whether this is movable or not. - * @return True if movable. + * + * @returns True if movable. */ isMovable(): boolean; } diff --git a/core/interfaces/i_positionable.ts b/core/interfaces/i_positionable.ts index 40d770ae4..dedac7763 100644 --- a/core/interfaces/i_positionable.ts +++ b/core/interfaces/i_positionable.ts @@ -4,12 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview The interface for a positionable UI element. - */ - /** * The interface for a positionable UI element. + * * @namespace Blockly.IPositionable */ import * as goog from '../../closure/goog/goog.js'; @@ -30,11 +27,13 @@ import type {IComponent} from './i_component.js'; /** * Interface for a component that is positioned on top of the workspace. + * * @alias Blockly.IPositionable */ export interface IPositionable extends IComponent { /** * Positions the element. Called when the window is resized. + * * @param metrics The workspace metrics. * @param savedPositions List of rectangles that are already on the workspace. */ @@ -43,7 +42,8 @@ export interface IPositionable extends IComponent { /** * Returns the bounding rectangle of the UI element in pixel units relative to * the Blockly injection div. - * @return The UI elements's bounding box. Null if bounding box should be + * + * @returns The UI elements's bounding box. Null if bounding box should be * ignored by other UI elements. */ getBoundingRectangle(): Rect|null; diff --git a/core/interfaces/i_registrable.ts b/core/interfaces/i_registrable.ts index c25749244..9faa55e9a 100644 --- a/core/interfaces/i_registrable.ts +++ b/core/interfaces/i_registrable.ts @@ -4,14 +4,10 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview The interface for a Blockly component that can be registered. - * (Ex. Toolbox, Fields, Renderers) - */ - /** * The interface for a Blockly component that can be registered. * (Ex. Toolbox, Fields, Renderers) + * * @namespace Blockly.IRegistrable */ import * as goog from '../../closure/goog/goog.js'; @@ -20,6 +16,7 @@ goog.declareModuleId('Blockly.IRegistrable'); /** * The interface for a Blockly component that can be registered. + * * @alias Blockly.IRegistrable */ export interface IRegistrable {} diff --git a/core/interfaces/i_registrable_field.ts b/core/interfaces/i_registrable_field.ts index 1ae06408e..be2ad4eb0 100644 --- a/core/interfaces/i_registrable_field.ts +++ b/core/interfaces/i_registrable_field.ts @@ -4,12 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview The interface for a Blockly field that can be registered. - */ - /** * The interface for a Blockly field that can be registered. + * * @namespace Blockly.IRegistrableField */ import * as goog from '../../closure/goog/goog.js'; @@ -24,6 +21,7 @@ type fromJson = (p1: object) => Field; * A registrable field. * Note: We are not using an interface here as we are interested in defining the * static methods of a field rather than the instance methods. + * * @alias Blockly.IRegistrableField */ export interface IRegistrableField { diff --git a/core/interfaces/i_selectable.ts b/core/interfaces/i_selectable.ts index ef13bddcd..a29bdb9cb 100644 --- a/core/interfaces/i_selectable.ts +++ b/core/interfaces/i_selectable.ts @@ -4,12 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview The interface for an object that is selectable. - */ - /** * The interface for an object that is selectable. + * * @namespace Blockly.ISelectable */ import * as goog from '../../closure/goog/goog.js'; @@ -21,6 +18,7 @@ import type {IMovable} from './i_movable.js'; /** * The interface for an object that is selectable. + * * @alias Blockly.ISelectable */ export interface ISelectable extends IDeletable, IMovable { diff --git a/core/interfaces/i_selectable_toolbox_item.ts b/core/interfaces/i_selectable_toolbox_item.ts index 3fd8650a1..93cea2c6d 100644 --- a/core/interfaces/i_selectable_toolbox_item.ts +++ b/core/interfaces/i_selectable_toolbox_item.ts @@ -4,12 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview The interface for a selectable toolbox item. - */ - /** * The interface for a selectable toolbox item. + * * @namespace Blockly.ISelectableToolboxItem */ import * as goog from '../../closure/goog/goog.js'; @@ -25,24 +22,28 @@ import type {IToolboxItem} from './i_toolbox_item.js'; /** * Interface for an item in the toolbox that can be selected. + * * @alias Blockly.ISelectableToolboxItem */ export interface ISelectableToolboxItem extends IToolboxItem { /** * Gets the name of the toolbox item. Used for emitting events. - * @return The name of the toolbox item. + * + * @returns The name of the toolbox item. */ getName(): string; /** * Gets the contents of the toolbox item. These are items that are meant to be * displayed in the flyout. - * @return The definition of items to be displayed in the flyout. + * + * @returns The definition of items to be displayed in the flyout. */ getContents(): FlyoutItemInfoArray|string; /** * Sets the current toolbox item as selected. + * * @param _isSelected True if this category is selected, false otherwise. */ setSelected(_isSelected: boolean): void; @@ -52,12 +53,14 @@ export interface ISelectableToolboxItem extends IToolboxItem { * The parent toolbox element receives clicks. The parent toolbox will add an * ID to this element so it can pass the onClick event to the correct * toolboxItem. - * @return The HTML element that receives clicks. + * + * @returns The HTML element that receives clicks. */ getClickTarget(): Element; /** * Handles when the toolbox item is clicked. + * * @param _e Click event to handle. */ onClick(_e: Event): void; diff --git a/core/interfaces/i_serializer.ts b/core/interfaces/i_serializer.ts index f48758254..3bf99fe4c 100644 --- a/core/interfaces/i_serializer.ts +++ b/core/interfaces/i_serializer.ts @@ -4,14 +4,10 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview The record type for an object containing functions for - * serializing part of the workspace. - */ - /** * The record type for an object containing functions for * serializing part of the workspace. + * * @namespace Blockly.serialization.ISerializer */ import * as goog from '../../closure/goog/goog.js'; @@ -22,6 +18,7 @@ import type {Workspace} from '../workspace.js'; /** * Serializes and deserializes a plugin or system. + * * @alias Blockly.serialization.ISerializer.ISerializer */ export interface ISerializer { @@ -39,8 +36,9 @@ export interface ISerializer { /** * Saves the state of the plugin or system. + * * @param workspace The workspace the system to serialize is associated with. - * @return A JS object containing the system's state, or null if there is no + * @returns A JS object containing the system's state, or null if there is no * state to record. */ save(workspace: Workspace): Object|null; @@ -48,6 +46,7 @@ export interface ISerializer { /** * Loads the state of the plugin or system. + * * @param state The state of the system to deserialize. This will always be * non-null. * @param workspace The workspace the system to deserialize is associated @@ -57,6 +56,7 @@ export interface ISerializer { /** * Clears the state of the plugin or system. + * * @param workspace The workspace the system to clear the state of is * associated with. */ diff --git a/core/interfaces/i_styleable.ts b/core/interfaces/i_styleable.ts index 12dde97b1..7e98a6dc7 100644 --- a/core/interfaces/i_styleable.ts +++ b/core/interfaces/i_styleable.ts @@ -4,12 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview The interface for an object that a style can be added to. - */ - /** * The interface for an object that a style can be added to. + * * @namespace Blockly.IStyleable */ import * as goog from '../../closure/goog/goog.js'; @@ -18,17 +15,20 @@ goog.declareModuleId('Blockly.IStyleable'); /** * Interface for an object that a style can be added to. + * * @alias Blockly.IStyleable */ export interface IStyleable { /** * Adds a style on the toolbox. Usually used to change the cursor. + * * @param style The name of the class to add. */ addStyle(style: string): void; /** * Removes a style from the toolbox. Usually used to change the cursor. + * * @param style The name of the class to remove. */ removeStyle(style: string): void; diff --git a/core/interfaces/i_toolbox.ts b/core/interfaces/i_toolbox.ts index 2451ced6e..7d4a3bc85 100644 --- a/core/interfaces/i_toolbox.ts +++ b/core/interfaces/i_toolbox.ts @@ -4,12 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview The interface for a toolbox. - */ - /** * The interface for a toolbox. + * * @namespace Blockly.IToolbox */ import * as goog from '../../closure/goog/goog.js'; @@ -37,6 +34,7 @@ import type {WorkspaceSvg} from '../workspace_svg.js'; /** * Interface for a toolbox. + * * @alias Blockly.IToolbox */ export interface IToolbox extends IRegistrable { @@ -45,37 +43,43 @@ export interface IToolbox extends IRegistrable { /** * Fills the toolbox with new toolbox items and removes any old contents. + * * @param toolboxDef Object holding information for creating a toolbox. */ render(toolboxDef: ToolboxInfo): void; /** * Gets the width of the toolbox. - * @return The width of the toolbox. + * + * @returns The width of the toolbox. */ getWidth(): number; /** * Gets the height of the toolbox. - * @return The height of the toolbox. + * + * @returns The height of the toolbox. */ getHeight(): number; /** * Gets the toolbox flyout. - * @return The toolbox flyout. + * + * @returns The toolbox flyout. */ getFlyout(): IFlyout|null; /** * Gets the workspace for the toolbox. - * @return The parent workspace for the toolbox. + * + * @returns The parent workspace for the toolbox. */ getWorkspace(): WorkspaceSvg; /** * Gets whether or not the toolbox is horizontal. - * @return True if the toolbox is horizontal, false if the toolbox is + * + * @returns True if the toolbox is horizontal, false if the toolbox is * vertical. */ isHorizontal(): boolean; @@ -106,19 +110,22 @@ export interface IToolbox extends IRegistrable { /** * Sets the visibility of the toolbox. + * * @param isVisible True if toolbox should be visible. */ setVisible(isVisible: boolean): void; /** * Selects the toolbox item by it's position in the list of toolbox items. + * * @param position The position of the item to select. */ selectItemByPosition(position: number): void; /** * Gets the selected item. - * @return The selected item, or null if no item is currently selected. + * + * @returns The selected item, or null if no item is currently selected. */ getSelectedItem(): IToolboxItem|null; diff --git a/core/interfaces/i_toolbox_item.ts b/core/interfaces/i_toolbox_item.ts index 1b661707d..a478cae5c 100644 --- a/core/interfaces/i_toolbox_item.ts +++ b/core/interfaces/i_toolbox_item.ts @@ -4,12 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview The interface for a toolbox item. - */ - /** * The interface for a toolbox item. + * * @namespace Blockly.IToolboxItem */ import * as goog from '../../closure/goog/goog.js'; @@ -18,6 +15,7 @@ goog.declareModuleId('Blockly.IToolboxItem'); /** * Interface for an item in the toolbox. + * * @alias Blockly.IToolboxItem */ export interface IToolboxItem { @@ -30,39 +28,45 @@ export interface IToolboxItem { /** * Gets the div for the toolbox item. - * @return The div for the toolbox item. + * + * @returns The div for the toolbox item. */ getDiv(): Element|null; /** * Gets a unique identifier for this toolbox item. - * @return The ID for the toolbox item. + * + * @returns The ID for the toolbox item. */ getId(): string; /** * Gets the parent if the toolbox item is nested. - * @return The parent toolbox item, or null if this toolbox item is not + * + * @returns The parent toolbox item, or null if this toolbox item is not * nested. */ getParent(): IToolboxItem|null; /** * Gets the nested level of the category. - * @return The nested level of the category. + * + * @returns The nested level of the category. * @internal */ getLevel(): number; /** * Whether the toolbox item is selectable. - * @return True if the toolbox item can be selected. + * + * @returns True if the toolbox item can be selected. */ isSelectable(): boolean; /** * Whether the toolbox item is collapsible. - * @return True if the toolbox item is collapsible. + * + * @returns True if the toolbox item is collapsible. */ isCollapsible(): boolean; @@ -71,13 +75,15 @@ export interface IToolboxItem { /** * Gets the HTML element that is clickable. - * @return The HTML element that receives clicks. + * + * @returns The HTML element that receives clicks. */ getClickTarget(): Element|null; /** * Sets whether the category is visible or not. * For a category to be visible its parent category must also be expanded. + * * @param isVisible True if category should be visible. */ setVisible_(isVisible: boolean): void; diff --git a/core/internal_constants.ts b/core/internal_constants.ts index 3a53ee55e..d1bd27b48 100644 --- a/core/internal_constants.ts +++ b/core/internal_constants.ts @@ -4,14 +4,10 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Module that provides constants for use inside Blockly. Do not - * use these constants outside of the core library. - */ - /** * Module that provides constants for use inside Blockly. Do not * use these constants outside of the core library. + * * @namespace Blockly.internalConstants */ import * as goog from '../closure/goog/goog.js'; @@ -22,6 +18,7 @@ import {ConnectionType} from './connection_type.js'; /** * Number of characters to truncate a collapsed block to. + * * @alias Blockly.internalConstants.COLLAPSE_CHARS * @internal */ @@ -30,6 +27,7 @@ export const COLLAPSE_CHARS = 30; /** * When dragging a block out of a stack, split the stack in two (true), or drag * out the block healing the stack (false). + * * @alias Blockly.internalConstants.DRAG_STACK * @internal */ @@ -37,6 +35,7 @@ export const DRAG_STACK = true; /** * Lookup table for determining the opposite type of a connection. + * * @alias Blockly.internalConstants.OPPOSITE_TYPE * @internal */ @@ -52,6 +51,7 @@ OPPOSITE_TYPE[ConnectionType.PREVIOUS_STATEMENT] = * String for use in the dropdown created in field_variable. * This string indicates that this option in the dropdown is 'Rename * variable...' and if selected, should trigger the prompt to rename a variable. + * * @alias Blockly.internalConstants.RENAME_VARIABLE_ID * @internal */ @@ -61,6 +61,7 @@ export const RENAME_VARIABLE_ID = 'RENAME_VARIABLE_ID'; * String for use in the dropdown created in field_variable. * This string indicates that this option in the dropdown is 'Delete the "%1" * variable' and if selected, should trigger the prompt to delete a variable. + * * @alias Blockly.internalConstants.DELETE_VARIABLE_ID * @internal */ diff --git a/core/keyboard_nav/ast_node.ts b/core/keyboard_nav/ast_node.ts index 45cd785e3..f668f8d41 100644 --- a/core/keyboard_nav/ast_node.ts +++ b/core/keyboard_nav/ast_node.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview The class representing an AST node. - * Used to traverse the Blockly AST. - */ - /** * The class representing an AST node. * Used to traverse the Blockly AST. diff --git a/core/keyboard_nav/basic_cursor.ts b/core/keyboard_nav/basic_cursor.ts index 53416da04..7bbad93b6 100644 --- a/core/keyboard_nav/basic_cursor.ts +++ b/core/keyboard_nav/basic_cursor.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview The class representing a basic cursor. - * Used to demo switching between different cursors. - */ - /** * The class representing a basic cursor. * Used to demo switching between different cursors. diff --git a/core/keyboard_nav/cursor.ts b/core/keyboard_nav/cursor.ts index 2db5007a5..ca3653e8d 100644 --- a/core/keyboard_nav/cursor.ts +++ b/core/keyboard_nav/cursor.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview The class representing a cursor. - * Used primarily for keyboard navigation. - */ - /** * The class representing a cursor. * Used primarily for keyboard navigation. diff --git a/core/keyboard_nav/marker.ts b/core/keyboard_nav/marker.ts index be79d745d..c76b14e1e 100644 --- a/core/keyboard_nav/marker.ts +++ b/core/keyboard_nav/marker.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview The class representing a marker. - * Used primarily for keyboard navigation to show a marked location. - */ - /** * The class representing a marker. * Used primarily for keyboard navigation to show a marked location. diff --git a/core/keyboard_nav/tab_navigate_cursor.ts b/core/keyboard_nav/tab_navigate_cursor.ts index 16b565b43..26bb9b0f2 100644 --- a/core/keyboard_nav/tab_navigate_cursor.ts +++ b/core/keyboard_nav/tab_navigate_cursor.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview The class representing a cursor that is used to navigate - * between tab navigable fields. - */ - /** * The class representing a cursor that is used to navigate * between tab navigable fields. diff --git a/core/marker_manager.ts b/core/marker_manager.ts index a0a3c8640..2a6d16dbf 100644 --- a/core/marker_manager.ts +++ b/core/marker_manager.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Object in charge of managing markers and the cursor. - */ - /** * Object in charge of managing markers and the cursor. * @class diff --git a/core/menu.ts b/core/menu.ts index 9795b48fe..57e9e0ad7 100644 --- a/core/menu.ts +++ b/core/menu.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Blockly menu similar to Closure's goog.ui.Menu - */ - /** * Blockly menu similar to Closure's goog.ui.Menu * @class diff --git a/core/menuitem.ts b/core/menuitem.ts index c85e649a7..6182ea684 100644 --- a/core/menuitem.ts +++ b/core/menuitem.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Blockly menu item similar to Closure's goog.ui.MenuItem - */ - /** * Blockly menu item similar to Closure's goog.ui.MenuItem * @class diff --git a/core/metrics_manager.ts b/core/metrics_manager.ts index 21bea4204..177e3c954 100644 --- a/core/metrics_manager.ts +++ b/core/metrics_manager.ts @@ -4,12 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Calculates and reports workspace metrics. - */ - /** * Calculates and reports workspace metrics. + * * @class */ import * as goog from '../closure/goog/goog.js'; @@ -27,6 +24,7 @@ import type {WorkspaceSvg} from './workspace_svg.js'; /** * The manager for all workspace metrics calculations. + * * @alias Blockly.MetricsManager */ export class MetricsManager implements IMetricsManager { @@ -40,9 +38,10 @@ export class MetricsManager implements IMetricsManager { /** * Gets the dimensions of the given workspace component, in pixel coordinates. + * * @param elem The element to get the dimensions of, or null. It should be a * toolbox or flyout, and should implement getWidth() and getHeight(). - * @return An object containing width and height attributes, which will both + * @returns An object containing width and height attributes, which will both * be zero if elem did not exist. */ protected getDimensionsPx_(elem: IToolbox|null|IFlyout): Size { @@ -59,8 +58,9 @@ export class MetricsManager implements IMetricsManager { * Gets the width and the height of the flyout on the workspace in pixel * coordinates. Returns 0 for the width and height if the workspace has a * category toolbox instead of a simple toolbox. + * * @param opt_own Whether to only return the workspace's own flyout. - * @return The width and height of the flyout. + * @returns The width and height of the flyout. */ getFlyoutMetrics(opt_own?: boolean): ToolboxMetrics { const flyoutDimensions = @@ -78,7 +78,8 @@ export class MetricsManager implements IMetricsManager { * a simple toolbox instead of a category toolbox. To get the width and height * of a * simple toolbox @see {@link getFlyoutMetrics}. - * @return The object with the width, height and position of the toolbox. + * + * @returns The object with the width, height and position of the toolbox. */ getToolboxMetrics(): ToolboxMetrics { const toolboxDimensions = @@ -94,7 +95,8 @@ export class MetricsManager implements IMetricsManager { /** * Gets the width and height of the workspace's parent SVG element in pixel * coordinates. This area includes the toolbox and the visible workspace area. - * @return The width and height of the workspace's parent SVG element. + * + * @returns The width and height of the workspace's parent SVG element. */ getSvgMetrics(): Size { return this.workspace_.getCachedParentSvgSize(); @@ -104,7 +106,8 @@ export class MetricsManager implements IMetricsManager { * Gets the absolute left and absolute top in pixel coordinates. * This is where the visible workspace starts in relation to the SVG * container. - * @return The absolute metrics for the workspace. + * + * @returns The absolute metrics for the workspace. */ getAbsoluteMetrics(): AbsoluteMetrics { let absoluteLeft = 0; @@ -138,9 +141,10 @@ export class MetricsManager implements IMetricsManager { /** * Gets the metrics for the visible workspace in either pixel or workspace * coordinates. The visible workspace does not include the toolbox or flyout. + * * @param opt_getWorkspaceCoordinates True to get the view metrics in * workspace coordinates, false to get them in pixel coordinates. - * @return The width, height, top and left of the viewport in either workspace + * @returns The width, height, top and left of the viewport in either workspace * coordinates or pixel coordinates. */ getViewMetrics(opt_getWorkspaceCoordinates?: boolean): ContainerRegion { @@ -183,9 +187,10 @@ export class MetricsManager implements IMetricsManager { * Gets content metrics in either pixel or workspace coordinates. * The content area is a rectangle around all the top bounded elements on the * workspace (workspace comments and blocks). + * * @param opt_getWorkspaceCoordinates True to get the content metrics in * workspace coordinates, false to get them in pixel coordinates. - * @return The metrics for the content container. + * @returns The metrics for the content container. */ getContentMetrics(opt_getWorkspaceCoordinates?: boolean): ContainerRegion { const scale = opt_getWorkspaceCoordinates ? 1 : this.workspace_.scale; @@ -202,7 +207,8 @@ export class MetricsManager implements IMetricsManager { /** * Returns whether the scroll area has fixed edges. - * @return Whether the scroll area has fixed edges. + * + * @returns Whether the scroll area has fixed edges. * @internal */ hasFixedEdges(): boolean { @@ -213,10 +219,11 @@ export class MetricsManager implements IMetricsManager { /** * Computes the fixed edges of the scroll area. + * * @param opt_viewMetrics The view metrics if they have been previously * computed. Passing in null may cause the view metrics to be computed * again, if it is needed. - * @return The fixed edges of the scroll area. + * @returns The fixed edges of the scroll area. */ protected getComputedFixedEdges_(opt_viewMetrics?: ContainerRegion): FixedEdges { @@ -244,9 +251,10 @@ export class MetricsManager implements IMetricsManager { /** * Returns the content area with added padding. + * * @param viewMetrics The view metrics. * @param contentMetrics The content metrics. - * @return The padded content area. + * @returns The padded content area. */ protected getPaddedContent_( viewMetrics: ContainerRegion, contentMetrics: ContainerRegion): @@ -275,6 +283,7 @@ export class MetricsManager implements IMetricsManager { /** * Returns the metrics for the scroll area of the workspace. + * * @param opt_getWorkspaceCoordinates True to get the scroll metrics in * workspace coordinates, false to get them in pixel coordinates. * @param opt_viewMetrics The view metrics if they have been previously @@ -283,7 +292,7 @@ export class MetricsManager implements IMetricsManager { * @param opt_contentMetrics The content metrics if they have been previously * computed. Passing in null may cause the content metrics to be computed * again, if it is needed. - * @return The metrics for the scroll container. + * @returns The metrics for the scroll container. */ getScrollMetrics( opt_getWorkspaceCoordinates?: boolean, opt_viewMetrics?: ContainerRegion, @@ -316,7 +325,8 @@ export class MetricsManager implements IMetricsManager { /** * Returns common metrics used by UI elements. - * @return The UI metrics. + * + * @returns The UI metrics. */ getUiMetrics(): UiMetrics { return { @@ -358,7 +368,8 @@ export class MetricsManager implements IMetricsManager { * .flyoutHeight: Height of the flyout if it is always open. Otherwise zero. * .toolboxPosition: Top, bottom, left or right. Use TOOLBOX_AT constants to * compare. - * @return Contains size and position metrics of a top level workspace. + * + * @returns Contains size and position metrics of a top level workspace. */ getMetrics(): Metrics { const toolboxMetrics = this.getToolboxMetrics(); diff --git a/core/msg.ts b/core/msg.ts index d4c9be7b4..4d4c440d5 100644 --- a/core/msg.ts +++ b/core/msg.ts @@ -4,12 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Empty name space for the Message singleton. - */ - /** * Empty name space for the Message singleton. + * * @namespace Blockly.Msg */ import * as goog from '../closure/goog/goog.js'; diff --git a/core/mutator.ts b/core/mutator.ts index f0554ba1d..a143e56fd 100644 --- a/core/mutator.ts +++ b/core/mutator.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Object representing a mutator dialog. A mutator allows the - * user to change the shape of a block using a nested blocks editor. - */ - /** * Object representing a mutator dialog. A mutator allows the * user to change the shape of a block using a nested blocks editor. diff --git a/core/names.ts b/core/names.ts index d138ec39a..5eb95fb38 100644 --- a/core/names.ts +++ b/core/names.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Utility functions for handling variable and procedure names. - */ - /** * Utility functions for handling variable and procedure names. * @class diff --git a/core/options.ts b/core/options.ts index b36021a40..0a63f5862 100644 --- a/core/options.ts +++ b/core/options.ts @@ -4,12 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Object that controls settings for the workspace. - */ - /** * Object that controls settings for the workspace. + * * @class */ import * as goog from '../closure/goog/goog.js'; @@ -29,6 +26,7 @@ import type {WorkspaceSvg} from './workspace_svg.js'; /** * Parse the user-specified options, using reasonable defaults where behaviour * is unspecified. + * * @alias Blockly.Options */ export class Options { @@ -197,9 +195,10 @@ export class Options { /** * Parse the user-specified move options, using reasonable defaults where * behaviour is unspecified. + * * @param options Dictionary of options. * @param hasCategories Whether the workspace has categories or not. - * @return Normalized move options. + * @returns Normalized move options. */ private static parseMoveOptions_( options: BlocklyOptions, hasCategories: boolean): MoveOptions { @@ -249,8 +248,9 @@ export class Options { * Parse the user-specified zoom options, using reasonable defaults where * behaviour is unspecified. See zoom documentation: * https://developers.google.com/blockly/guides/configure/web/zoom + * * @param options Dictionary of options. - * @return Normalized zoom options. + * @returns Normalized zoom options. */ private static parseZoomOptions_(options: BlocklyOptions): ZoomOptions { const zoom = options['zoom'] || {}; @@ -297,8 +297,9 @@ export class Options { * Parse the user-specified grid options, using reasonable defaults where * behaviour is unspecified. See grid documentation: * https://developers.google.com/blockly/guides/configure/web/grid + * * @param options Dictionary of options. - * @return Normalized grid options. + * @returns Normalized grid options. */ private static parseGridOptions_(options: BlocklyOptions): GridOptions { const grid = options['grid'] || {}; @@ -314,8 +315,9 @@ export class Options { /** * Parse the user-specified theme options, using the classic theme as a * default. https://developers.google.com/blockly/guides/configure/web/themes + * * @param options Dictionary of options. - * @return A Blockly Theme. + * @returns A Blockly Theme. */ private static parseThemeOptions_(options: BlocklyOptions): Theme { const theme = options['theme'] || Classic; diff --git a/core/positionable_helpers.ts b/core/positionable_helpers.ts index d5f251b10..6a957b324 100644 --- a/core/positionable_helpers.ts +++ b/core/positionable_helpers.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Utility functions for positioning UI elements. - */ - /** * Utility functions for positioning UI elements. * @namespace Blockly.uiPosition diff --git a/core/procedures.ts b/core/procedures.ts index f5ac72f73..e0b1db6e6 100644 --- a/core/procedures.ts +++ b/core/procedures.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Utility functions for handling procedures. - */ - /** * Utility functions for handling procedures. * @namespace Blockly.Procedures diff --git a/core/registry.ts b/core/registry.ts index 358014a7a..96c40d004 100644 --- a/core/registry.ts +++ b/core/registry.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview This file is a universal registry that provides generic methods - * for registering and unregistering different types of classes. - */ - /** * This file is a universal registry that provides generic methods * for registering and unregistering different types of classes. diff --git a/core/rendered_connection.ts b/core/rendered_connection.ts index 5b92e5ee4..d33ba250e 100644 --- a/core/rendered_connection.ts +++ b/core/rendered_connection.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Components for creating connections between blocks. - */ - /** * Components for creating connections between blocks. * @class diff --git a/core/renderers/common/block_rendering.ts b/core/renderers/common/block_rendering.ts index 6aaad19a5..6561c2c65 100644 --- a/core/renderers/common/block_rendering.ts +++ b/core/renderers/common/block_rendering.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Namespace for block rendering functionality. - */ - /** * Namespace for block rendering functionality. * @namespace Blockly.blockRendering diff --git a/core/renderers/common/constants.ts b/core/renderers/common/constants.ts index 1257fdedc..984844992 100644 --- a/core/renderers/common/constants.ts +++ b/core/renderers/common/constants.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview An object that provides constants for rendering blocks. - */ - /** * An object that provides constants for rendering blocks. * @class diff --git a/core/renderers/common/debug.ts b/core/renderers/common/debug.ts index 7b4407fde..2e6bdf005 100644 --- a/core/renderers/common/debug.ts +++ b/core/renderers/common/debug.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Block rendering debugging functionality. - */ - /** * Block rendering debugging functionality. * @namespace Blockly.blockRendering.debug diff --git a/core/renderers/common/debugger.ts b/core/renderers/common/debugger.ts index e21342f57..971e6e638 100644 --- a/core/renderers/common/debugger.ts +++ b/core/renderers/common/debugger.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Methods for rendering debug graphics. - */ - /** * Methods for rendering debug graphics. * @class diff --git a/core/renderers/common/drawer.ts b/core/renderers/common/drawer.ts index 16561fdc8..48eb502b5 100644 --- a/core/renderers/common/drawer.ts +++ b/core/renderers/common/drawer.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Methods for graphically rendering a block as SVG. - */ - /** * Methods for graphically rendering a block as SVG. * @class diff --git a/core/renderers/common/i_path_object.ts b/core/renderers/common/i_path_object.ts index 3ca303160..7c89039d9 100644 --- a/core/renderers/common/i_path_object.ts +++ b/core/renderers/common/i_path_object.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview The interface for an object that owns a block's rendering SVG - * elements. - */ - /** * The interface for an object that owns a block's rendering SVG * elements. diff --git a/core/renderers/common/info.ts b/core/renderers/common/info.ts index b7ca215e4..170e970df 100644 --- a/core/renderers/common/info.ts +++ b/core/renderers/common/info.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Methods for graphically rendering a block as SVG. - */ - /** * Methods for graphically rendering a block as SVG. * @class diff --git a/core/renderers/common/marker_svg.ts b/core/renderers/common/marker_svg.ts index 4fedc87b5..a1f2996dc 100644 --- a/core/renderers/common/marker_svg.ts +++ b/core/renderers/common/marker_svg.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Methods for graphically rendering a marker as SVG. - */ - /** * Methods for graphically rendering a marker as SVG. * @class diff --git a/core/renderers/common/path_object.ts b/core/renderers/common/path_object.ts index 521b9cb4f..da6b0d05a 100644 --- a/core/renderers/common/path_object.ts +++ b/core/renderers/common/path_object.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview An object that owns a block's rendering SVG elements. - */ - /** * An object that owns a block's rendering SVG elements. * @class diff --git a/core/renderers/common/renderer.ts b/core/renderers/common/renderer.ts index 28c62d9b1..a166b4cb1 100644 --- a/core/renderers/common/renderer.ts +++ b/core/renderers/common/renderer.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Base renderer. - */ - /** * Base renderer. * @class diff --git a/core/renderers/geras/constants.ts b/core/renderers/geras/constants.ts index d4f997a41..beb269d3c 100644 --- a/core/renderers/geras/constants.ts +++ b/core/renderers/geras/constants.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview An object that provides constants for rendering blocks in Geras - * mode. - */ - /** * An object that provides constants for rendering blocks in Geras * mode. diff --git a/core/renderers/geras/drawer.ts b/core/renderers/geras/drawer.ts index 6c8fcdaa1..d07ad61aa 100644 --- a/core/renderers/geras/drawer.ts +++ b/core/renderers/geras/drawer.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Renderer that preserves the look and feel of Blockly pre-2019. - */ - /** * Renderer that preserves the look and feel of Blockly pre-2019. * @class diff --git a/core/renderers/geras/highlight_constants.ts b/core/renderers/geras/highlight_constants.ts index 579af32c4..f9ef7e6aa 100644 --- a/core/renderers/geras/highlight_constants.ts +++ b/core/renderers/geras/highlight_constants.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Objects for rendering highlights on blocks. - */ - /** * Objects for rendering highlights on blocks. * @class diff --git a/core/renderers/geras/highlighter.ts b/core/renderers/geras/highlighter.ts index 3a8cab3f9..232db801f 100644 --- a/core/renderers/geras/highlighter.ts +++ b/core/renderers/geras/highlighter.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Methods for adding highlights on block, for rendering in - * compatibility mode. - */ - /** * Methods for adding highlights on block, for rendering in * compatibility mode. diff --git a/core/renderers/geras/info.ts b/core/renderers/geras/info.ts index d2df8ee4b..a5a6edffd 100644 --- a/core/renderers/geras/info.ts +++ b/core/renderers/geras/info.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Old (compatibility) renderer. - * Geras: spirit of old age. - */ - /** * Old (compatibility) renderer. * Geras: spirit of old age. diff --git a/core/renderers/geras/measurables/inline_input.ts b/core/renderers/geras/measurables/inline_input.ts index 76dacf56b..1ba4d7e44 100644 --- a/core/renderers/geras/measurables/inline_input.ts +++ b/core/renderers/geras/measurables/inline_input.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Objects representing inline inputs with connections on a - * rendered block. - */ - /** * Objects representing inline inputs with connections on a * rendered block. diff --git a/core/renderers/geras/measurables/statement_input.ts b/core/renderers/geras/measurables/statement_input.ts index f002a5bcb..494f320c7 100644 --- a/core/renderers/geras/measurables/statement_input.ts +++ b/core/renderers/geras/measurables/statement_input.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Objects representing statement inputs with connections on a - * rendered block. - */ - /** * Objects representing statement inputs with connections on a * rendered block. diff --git a/core/renderers/geras/path_object.ts b/core/renderers/geras/path_object.ts index 78b6177a7..78758e986 100644 --- a/core/renderers/geras/path_object.ts +++ b/core/renderers/geras/path_object.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview An object that owns a block's rendering SVG elements. - */ - /** * An object that owns a block's rendering SVG elements. * @class diff --git a/core/renderers/geras/renderer.ts b/core/renderers/geras/renderer.ts index 6ecb10262..4a3cb907f 100644 --- a/core/renderers/geras/renderer.ts +++ b/core/renderers/geras/renderer.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Geras renderer. - */ - /** * Geras renderer. * @class diff --git a/core/renderers/measurables/base.ts b/core/renderers/measurables/base.ts index c57cf76f6..0d5e560bb 100644 --- a/core/renderers/measurables/base.ts +++ b/core/renderers/measurables/base.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Methods for graphically rendering a block as SVG. - */ - /** * Methods for graphically rendering a block as SVG. * @class diff --git a/core/renderers/measurables/bottom_row.ts b/core/renderers/measurables/bottom_row.ts index 897411edc..7d1d0ce94 100644 --- a/core/renderers/measurables/bottom_row.ts +++ b/core/renderers/measurables/bottom_row.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Object representing a bottom row on a rendered block. - * of its subcomponents. - */ - /** * Object representing a bottom row on a rendered block. * of its subcomponents. diff --git a/core/renderers/measurables/connection.ts b/core/renderers/measurables/connection.ts index 84a121b2a..790dc0930 100644 --- a/core/renderers/measurables/connection.ts +++ b/core/renderers/measurables/connection.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Base class representing the space a connection takes up during - * rendering. - */ - /** * Base class representing the space a connection takes up during * rendering. diff --git a/core/renderers/measurables/external_value_input.ts b/core/renderers/measurables/external_value_input.ts index f7cf459b5..deb1ccd9e 100644 --- a/core/renderers/measurables/external_value_input.ts +++ b/core/renderers/measurables/external_value_input.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Class representing external value inputs with connections on a - * rendered block. - */ - /** * Class representing external value inputs with connections on a * rendered block. diff --git a/core/renderers/measurables/field.ts b/core/renderers/measurables/field.ts index 39a5b24d8..f8f4992ce 100644 --- a/core/renderers/measurables/field.ts +++ b/core/renderers/measurables/field.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Objects representing a field in a row of a rendered - * block. - */ - /** * Objects representing a field in a row of a rendered * block. diff --git a/core/renderers/measurables/hat.ts b/core/renderers/measurables/hat.ts index 141a461f1..fe519becd 100644 --- a/core/renderers/measurables/hat.ts +++ b/core/renderers/measurables/hat.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Objects representing a hat in a row of a rendered - * block. - */ - /** * Objects representing a hat in a row of a rendered * block. diff --git a/core/renderers/measurables/icon.ts b/core/renderers/measurables/icon.ts index 80437c4fb..0b1d6d473 100644 --- a/core/renderers/measurables/icon.ts +++ b/core/renderers/measurables/icon.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Objects representing an icon in a row of a rendered - * block. - */ - /** * Objects representing an icon in a row of a rendered * block. diff --git a/core/renderers/measurables/in_row_spacer.ts b/core/renderers/measurables/in_row_spacer.ts index 97110c24c..f72a75b94 100644 --- a/core/renderers/measurables/in_row_spacer.ts +++ b/core/renderers/measurables/in_row_spacer.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Objects representing a spacer in a row of a rendered - * block. - */ - /** * Objects representing a spacer in a row of a rendered * block. diff --git a/core/renderers/measurables/inline_input.ts b/core/renderers/measurables/inline_input.ts index ce24540d3..6eec6706a 100644 --- a/core/renderers/measurables/inline_input.ts +++ b/core/renderers/measurables/inline_input.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Class representing inline inputs with connections on a rendered - * block. - */ - /** * Class representing inline inputs with connections on a rendered * block. diff --git a/core/renderers/measurables/input_connection.ts b/core/renderers/measurables/input_connection.ts index b5afb574b..9d2761096 100644 --- a/core/renderers/measurables/input_connection.ts +++ b/core/renderers/measurables/input_connection.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Class representing inputs with connections on a rendered block. - */ - /** * Class representing inputs with connections on a rendered block. * @class diff --git a/core/renderers/measurables/input_row.ts b/core/renderers/measurables/input_row.ts index 3c58e6e61..6045759db 100644 --- a/core/renderers/measurables/input_row.ts +++ b/core/renderers/measurables/input_row.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Object representing a row that holds one or more inputs on a - * rendered block. - */ - /** * Object representing a row that holds one or more inputs on a * rendered block. diff --git a/core/renderers/measurables/jagged_edge.ts b/core/renderers/measurables/jagged_edge.ts index b6c155c72..2c1368588 100644 --- a/core/renderers/measurables/jagged_edge.ts +++ b/core/renderers/measurables/jagged_edge.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Objects representing a jagged edge in a row of a rendered - * block. - */ - /** * Objects representing a jagged edge in a row of a rendered * block. diff --git a/core/renderers/measurables/next_connection.ts b/core/renderers/measurables/next_connection.ts index 03aa76bb9..cc8186ef8 100644 --- a/core/renderers/measurables/next_connection.ts +++ b/core/renderers/measurables/next_connection.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Class representing the space a next connection takes up during - * rendering. - */ - /** * Class representing the space a next connection takes up during * rendering. diff --git a/core/renderers/measurables/output_connection.ts b/core/renderers/measurables/output_connection.ts index 119a50cee..705235a3d 100644 --- a/core/renderers/measurables/output_connection.ts +++ b/core/renderers/measurables/output_connection.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Class representing the space a output connection takes up - * during rendering. - */ - /** * Class representing the space a output connection takes up * during rendering. diff --git a/core/renderers/measurables/previous_connection.ts b/core/renderers/measurables/previous_connection.ts index cdd4e4cda..157c34816 100644 --- a/core/renderers/measurables/previous_connection.ts +++ b/core/renderers/measurables/previous_connection.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Class representing the space a previous connection takes up - * during rendering. - */ - /** * Class representing the space a previous connection takes up * during rendering. diff --git a/core/renderers/measurables/round_corner.ts b/core/renderers/measurables/round_corner.ts index ad6b81a95..31fcca87a 100644 --- a/core/renderers/measurables/round_corner.ts +++ b/core/renderers/measurables/round_corner.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Objects representing a round corner in a row of a rendered - * block. - */ - /** * Objects representing a round corner in a row of a rendered * block. diff --git a/core/renderers/measurables/row.ts b/core/renderers/measurables/row.ts index e3f69231a..744938353 100644 --- a/core/renderers/measurables/row.ts +++ b/core/renderers/measurables/row.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Object representing a single row on a rendered block. - */ - /** * Object representing a single row on a rendered block. * @class diff --git a/core/renderers/measurables/spacer_row.ts b/core/renderers/measurables/spacer_row.ts index bdf1baa4e..d22cd2b68 100644 --- a/core/renderers/measurables/spacer_row.ts +++ b/core/renderers/measurables/spacer_row.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Object representing a spacer between two rows. - */ - /** * Object representing a spacer between two rows. * @class diff --git a/core/renderers/measurables/square_corner.ts b/core/renderers/measurables/square_corner.ts index 8f3f1cb90..f0b015b8b 100644 --- a/core/renderers/measurables/square_corner.ts +++ b/core/renderers/measurables/square_corner.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Objects representing a square corner in a row of a rendered - * block. - */ - /** * Objects representing a square corner in a row of a rendered * block. diff --git a/core/renderers/measurables/statement_input.ts b/core/renderers/measurables/statement_input.ts index dad532055..76ea0ac86 100644 --- a/core/renderers/measurables/statement_input.ts +++ b/core/renderers/measurables/statement_input.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Class representing statement inputs with connections on a - * rendered block. - */ - /** * Class representing statement inputs with connections on a * rendered block. diff --git a/core/renderers/measurables/top_row.ts b/core/renderers/measurables/top_row.ts index 6c1e1978c..f804304c0 100644 --- a/core/renderers/measurables/top_row.ts +++ b/core/renderers/measurables/top_row.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Object representing a top row on a rendered block. - */ - /** * Object representing a top row on a rendered block. * @class diff --git a/core/renderers/measurables/types.ts b/core/renderers/measurables/types.ts index 1faffd329..a42099177 100644 --- a/core/renderers/measurables/types.ts +++ b/core/renderers/measurables/types.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Measurable types. - */ - /** * Measurable types. * @namespace Blockly.blockRendering.Types diff --git a/core/renderers/minimalist/constants.ts b/core/renderers/minimalist/constants.ts index 2db269754..f928c4333 100644 --- a/core/renderers/minimalist/constants.ts +++ b/core/renderers/minimalist/constants.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview An object that provides constants for rendering blocks in the - * minimalist renderer. - */ - /** * An object that provides constants for rendering blocks in the * minimalist renderer. diff --git a/core/renderers/minimalist/drawer.ts b/core/renderers/minimalist/drawer.ts index d43e1ae1d..5fa9264eb 100644 --- a/core/renderers/minimalist/drawer.ts +++ b/core/renderers/minimalist/drawer.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Minimalist rendering drawer. - */ - /** * Minimalist rendering drawer. * @class diff --git a/core/renderers/minimalist/info.ts b/core/renderers/minimalist/info.ts index 832255ff7..95a39ac14 100644 --- a/core/renderers/minimalist/info.ts +++ b/core/renderers/minimalist/info.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Minimalist render info object. - */ - /** * Minimalist render info object. * @class diff --git a/core/renderers/minimalist/renderer.ts b/core/renderers/minimalist/renderer.ts index adbc20f38..f62141095 100644 --- a/core/renderers/minimalist/renderer.ts +++ b/core/renderers/minimalist/renderer.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Minimalist renderer. - */ - /** * Minimalist renderer. * @class diff --git a/core/renderers/thrasos/info.ts b/core/renderers/thrasos/info.ts index 0d0a0ffd4..b898dbe98 100644 --- a/core/renderers/thrasos/info.ts +++ b/core/renderers/thrasos/info.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview New (evolving) renderer. - * Thrasos: spirit of boldness. - */ - /** * New (evolving) renderer. * Thrasos: spirit of boldness. diff --git a/core/renderers/thrasos/renderer.ts b/core/renderers/thrasos/renderer.ts index 19cf7879f..7a0017798 100644 --- a/core/renderers/thrasos/renderer.ts +++ b/core/renderers/thrasos/renderer.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Thrasos renderer. - */ - /** * Thrasos renderer. * @class diff --git a/core/renderers/zelos/constants.ts b/core/renderers/zelos/constants.ts index fbc98ef5a..d9d481406 100644 --- a/core/renderers/zelos/constants.ts +++ b/core/renderers/zelos/constants.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview An object that provides constants for rendering blocks in Zelos - * mode. - */ - /** * An object that provides constants for rendering blocks in Zelos * mode. diff --git a/core/renderers/zelos/drawer.ts b/core/renderers/zelos/drawer.ts index 652c3bdeb..63b08d706 100644 --- a/core/renderers/zelos/drawer.ts +++ b/core/renderers/zelos/drawer.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Zelos renderer. - */ - /** * Zelos renderer. * @class diff --git a/core/renderers/zelos/info.ts b/core/renderers/zelos/info.ts index 36d42964e..731c96455 100644 --- a/core/renderers/zelos/info.ts +++ b/core/renderers/zelos/info.ts @@ -1,8 +1,3 @@ -/** - * @fileoverview Makecode/scratch-style renderer. - * Zelos: spirit of eager rivalry, emulation, envy, jealousy, and zeal. - */ - /** * @license * Copyright 2019 Google LLC diff --git a/core/renderers/zelos/marker_svg.ts b/core/renderers/zelos/marker_svg.ts index 0d591b8df..3fd1c0ee6 100644 --- a/core/renderers/zelos/marker_svg.ts +++ b/core/renderers/zelos/marker_svg.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Methods for graphically rendering a marker as SVG. - */ - /** * Methods for graphically rendering a marker as SVG. * @class diff --git a/core/renderers/zelos/measurables/bottom_row.ts b/core/renderers/zelos/measurables/bottom_row.ts index 17f3e460f..9b45615b4 100644 --- a/core/renderers/zelos/measurables/bottom_row.ts +++ b/core/renderers/zelos/measurables/bottom_row.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview An object representing the bottom row of a rendered block. - */ - /** * An object representing the bottom row of a rendered block. * @class diff --git a/core/renderers/zelos/measurables/inputs.ts b/core/renderers/zelos/measurables/inputs.ts index ffe32bf2d..9ca0c5eb8 100644 --- a/core/renderers/zelos/measurables/inputs.ts +++ b/core/renderers/zelos/measurables/inputs.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Zelos specific objects representing inputs with connections on - * a rendered block. - */ - /** * Zelos specific objects representing inputs with connections on * a rendered block. diff --git a/core/renderers/zelos/measurables/row_elements.ts b/core/renderers/zelos/measurables/row_elements.ts index 277bb0287..80b713433 100644 --- a/core/renderers/zelos/measurables/row_elements.ts +++ b/core/renderers/zelos/measurables/row_elements.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Zelos specific objects representing elements in a row of a - * rendered block. - */ - /** * Zelos specific objects representing elements in a row of a * rendered block. diff --git a/core/renderers/zelos/measurables/top_row.ts b/core/renderers/zelos/measurables/top_row.ts index 360ef885f..a27ec6713 100644 --- a/core/renderers/zelos/measurables/top_row.ts +++ b/core/renderers/zelos/measurables/top_row.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview An object representing the top row of a rendered block. - */ - /** * An object representing the top row of a rendered block. * @class diff --git a/core/renderers/zelos/path_object.ts b/core/renderers/zelos/path_object.ts index b87a99a47..d10bcc0b5 100644 --- a/core/renderers/zelos/path_object.ts +++ b/core/renderers/zelos/path_object.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview An object that owns a block's rendering SVG elements. - */ - /** * An object that owns a block's rendering SVG elements. * @class diff --git a/core/renderers/zelos/renderer.ts b/core/renderers/zelos/renderer.ts index ae70ddff2..1c3d1cba3 100644 --- a/core/renderers/zelos/renderer.ts +++ b/core/renderers/zelos/renderer.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Zelos renderer. - */ - /** * Zelos renderer. * @class diff --git a/core/scrollbar.ts b/core/scrollbar.ts index a50501353..e32a35cb2 100644 --- a/core/scrollbar.ts +++ b/core/scrollbar.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Object representing a scrollbar. - */ - /** * Object representing a scrollbar. * @class diff --git a/core/scrollbar_pair.ts b/core/scrollbar_pair.ts index b19aed8bf..b3323ddda 100644 --- a/core/scrollbar_pair.ts +++ b/core/scrollbar_pair.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Object representing a pair of scrollbars. - */ - /** * Object representing a pair of scrollbars. * @class diff --git a/core/serialization/blocks.ts b/core/serialization/blocks.ts index 8d1045963..8d357eabd 100644 --- a/core/serialization/blocks.ts +++ b/core/serialization/blocks.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Handles serializing blocks to plain JavaScript objects only - * containing state. - */ - /** * Handles serializing blocks to plain JavaScript objects only containing state. * @namespace Blockly.serialization.blocks diff --git a/core/serialization/exceptions.ts b/core/serialization/exceptions.ts index 928a27a66..a1c462299 100644 --- a/core/serialization/exceptions.ts +++ b/core/serialization/exceptions.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Contains custom errors thrown by the serialization system. - */ - /** * Contains custom errors thrown by the serialization system. * @namespace Blockly.serialization.exceptions diff --git a/core/serialization/priorities.ts b/core/serialization/priorities.ts index 8aa79d977..5ebeee690 100644 --- a/core/serialization/priorities.ts +++ b/core/serialization/priorities.ts @@ -4,12 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview The top level namespace for priorities of plugin serializers. - * Includes constants for the priorities of different plugin - * serializers. Higher priorities are deserialized first. - */ - /** * The top level namespace for priorities of plugin serializers. * Includes constants for the priorities of different plugin serializers. Higher diff --git a/core/serialization/registry.ts b/core/serialization/registry.ts index 745eefe62..cd87b1930 100644 --- a/core/serialization/registry.ts +++ b/core/serialization/registry.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Contains functions registering serializers (eg blocks, - * variables, plugins, etc). - */ - /** * Contains functions registering serializers (eg blocks, variables, plugins, * etc). diff --git a/core/serialization/variables.ts b/core/serialization/variables.ts index d70e0bc96..19cef5bea 100644 --- a/core/serialization/variables.ts +++ b/core/serialization/variables.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Handles serializing variables to plain JavaScript objects, only - * containing state. - */ - /** * Handles serializing variables to plain JavaScript objects, only containing * state. diff --git a/core/serialization/workspaces.ts b/core/serialization/workspaces.ts index 4a3417924..d561397e5 100644 --- a/core/serialization/workspaces.ts +++ b/core/serialization/workspaces.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Contains top-level functions for serializing workspaces to - * plain JavaScript objects. - */ - /** * Contains top-level functions for serializing workspaces to plain JavaScript * objects. diff --git a/core/shortcut_items.ts b/core/shortcut_items.ts index a41f8069e..c9d364945 100644 --- a/core/shortcut_items.ts +++ b/core/shortcut_items.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Registers default keyboard shortcuts. - */ - /** * Registers default keyboard shortcuts. * @namespace Blockly.ShortcutItems diff --git a/core/shortcut_registry.ts b/core/shortcut_registry.ts index 6a7ad1625..b48ef416a 100644 --- a/core/shortcut_registry.ts +++ b/core/shortcut_registry.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview The namespace used to keep track of keyboard shortcuts and the - * key codes used to execute those shortcuts. - */ - /** * The namespace used to keep track of keyboard shortcuts and the * key codes used to execute those shortcuts. diff --git a/core/sprites.ts b/core/sprites.ts index 13e256121..da4bf1958 100644 --- a/core/sprites.ts +++ b/core/sprites.ts @@ -4,19 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Holds constants that have to do with the sprites that create - * the trashcan and zoom controls. - */ -import * as goog from '../closure/goog/goog.js'; -goog.declareModuleId('Blockly.sprite'); - - -/** - * Holds constants that have to do with the sprites that create the trashcan - * and zoom controls. - */ - /** * Contains the path to a single png tat holds the images for the trashcan * as well as the zoom controls. diff --git a/core/theme.ts b/core/theme.ts index ed594f0df..2c544ef7b 100644 --- a/core/theme.ts +++ b/core/theme.ts @@ -4,12 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview The class representing a theme. - */ - /** * The class representing a theme. + * * @class */ import * as goog from '../closure/goog/goog.js'; @@ -31,6 +28,7 @@ export interface ITheme { /** * Class for a theme. + * * @alias Blockly.Theme */ export class Theme implements ITheme { @@ -46,6 +44,7 @@ export class Theme implements ITheme { /** * Whether or not to add a 'hat' on top of all blocks with no previous or * output connections. + * * @internal */ startHats: boolean|null = null; @@ -81,7 +80,8 @@ export class Theme implements ITheme { /** * Gets the class name that identifies this theme. - * @return The CSS class name. + * + * @returns The CSS class name. * @internal */ getClassName(): string { @@ -90,6 +90,7 @@ export class Theme implements ITheme { /** * Overrides or adds a style to the blockStyles map. + * * @param blockStyleName The name of the block style. * @param blockStyle The block style. */ @@ -99,6 +100,7 @@ export class Theme implements ITheme { /** * Overrides or adds a style to the categoryStyles map. + * * @param categoryStyleName The name of the category style. * @param categoryStyle The category style. */ @@ -109,8 +111,9 @@ export class Theme implements ITheme { /** * Gets the style for a given Blockly UI component. If the style value is a * string, we attempt to find the value of any named references. + * * @param componentName The name of the component. - * @return The style value. + * @returns The style value. */ getComponentStyle(componentName: string): string|null { const style = (this.componentStyles as AnyDuringMigration)[componentName]; @@ -122,6 +125,7 @@ export class Theme implements ITheme { /** * Configure a specific Blockly UI component with a style value. + * * @param componentName The name of the component. * @param styleValue The style value. */ @@ -131,6 +135,7 @@ export class Theme implements ITheme { /** * Configure a theme's font style. + * * @param fontStyle The font style. */ setFontStyle(fontStyle: FontStyle) { @@ -139,6 +144,7 @@ export class Theme implements ITheme { /** * Configure a theme's start hats. + * * @param startHats True if the theme enables start hats, false otherwise. */ setStartHats(startHats: boolean) { @@ -147,9 +153,10 @@ export class Theme implements ITheme { /** * Define a new Blockly theme. + * * @param name The name of the theme. * @param themeObj An object containing theme properties. - * @return A new Blockly theme. + * @returns A new Blockly theme. */ static defineTheme(name: string, themeObj: ITheme): Theme { name = name.toLowerCase(); diff --git a/core/theme/classic.ts b/core/theme/classic.ts index 2d5475faf..367504da7 100644 --- a/core/theme/classic.ts +++ b/core/theme/classic.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Classic theme. - * Contains multi-coloured border to create shadow effect. - */ - /** * Classic theme. * Contains multi-coloured border to create shadow effect. diff --git a/core/theme/themes.ts b/core/theme/themes.ts index ebc813ac4..576b1ad43 100644 --- a/core/theme/themes.ts +++ b/core/theme/themes.ts @@ -4,12 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Namespace for themes. - */ - /** * Namespace for themes. + * * @namespace Blockly.Themes */ import * as goog from '../../closure/goog/goog.js'; diff --git a/core/theme/zelos.ts b/core/theme/zelos.ts index bb415c063..6b7c3cefd 100644 --- a/core/theme/zelos.ts +++ b/core/theme/zelos.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Zelos theme. - */ - /** * Zelos theme. * @namespace Blockly.Themes.Zelos diff --git a/core/theme_manager.ts b/core/theme_manager.ts index 56f902596..6c90d05b7 100644 --- a/core/theme_manager.ts +++ b/core/theme_manager.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Object in charge of storing and updating a workspace theme - * and UI components. - */ - /** * Object in charge of storing and updating a workspace theme * and UI components. diff --git a/core/toolbox/category.ts b/core/toolbox/category.ts index 6c2818ea6..2b4dbe9b5 100644 --- a/core/toolbox/category.ts +++ b/core/toolbox/category.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview A toolbox category used to organize blocks in the toolbox. - */ - /** * A toolbox category used to organize blocks in the toolbox. * @class diff --git a/core/toolbox/collapsible_category.ts b/core/toolbox/collapsible_category.ts index bf5886adb..fc0d0d573 100644 --- a/core/toolbox/collapsible_category.ts +++ b/core/toolbox/collapsible_category.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview A toolbox category used to organize blocks in the toolbox. - */ - /** * A toolbox category used to organize blocks in the toolbox. * @class diff --git a/core/toolbox/separator.ts b/core/toolbox/separator.ts index 1083a433c..7eb7c30bb 100644 --- a/core/toolbox/separator.ts +++ b/core/toolbox/separator.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview A separator used for separating toolbox categories. - */ - /** * A separator used for separating toolbox categories. * @class diff --git a/core/toolbox/toolbox.ts b/core/toolbox/toolbox.ts index 69fe4e863..b2944a946 100644 --- a/core/toolbox/toolbox.ts +++ b/core/toolbox/toolbox.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Toolbox from whence to create blocks. - */ - /** * Toolbox from whence to create blocks. * @class diff --git a/core/toolbox/toolbox_item.ts b/core/toolbox/toolbox_item.ts index 8601bc690..0770f5327 100644 --- a/core/toolbox/toolbox_item.ts +++ b/core/toolbox/toolbox_item.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview An item in the toolbox. - */ - /** * An item in the toolbox. * @class diff --git a/core/touch.ts b/core/touch.ts index 99ae53cde..ea1b8e3f2 100644 --- a/core/touch.ts +++ b/core/touch.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Touch handling for Blockly. - */ - /** * Touch handling for Blockly. * @namespace Blockly.Touch diff --git a/core/touch_gesture.ts b/core/touch_gesture.ts index 191fbbcb2..3fe02db04 100644 --- a/core/touch_gesture.ts +++ b/core/touch_gesture.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview The class extends Gesture to support pinch to zoom - * for both pointer and touch events. - */ - /** * The class extends Gesture to support pinch to zoom * for both pointer and touch events. diff --git a/core/trashcan.ts b/core/trashcan.ts index a034c8a00..9e2741d70 100644 --- a/core/trashcan.ts +++ b/core/trashcan.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Object representing a trash can icon. - */ - /** * Object representing a trash can icon. * @class diff --git a/core/utils.ts b/core/utils.ts index c09834b76..5e31ffaa6 100644 --- a/core/utils.ts +++ b/core/utils.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Utility methods. - */ - /** * Utility methods. * @namespace Blockly.utils diff --git a/core/utils/aria.ts b/core/utils/aria.ts index daef600b6..65f787cfc 100644 --- a/core/utils/aria.ts +++ b/core/utils/aria.ts @@ -4,12 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview ARIA-related constants and utilities. - * These methods are not specific to Blockly, and could be factored out into - * a JavaScript framework such as Closure. - */ - /** * ARIA-related constants and utilities. * These methods are not specific to Blockly, and could be factored out into diff --git a/core/utils/array.ts b/core/utils/array.ts index 12a0cadda..7e192c5b0 100644 --- a/core/utils/array.ts +++ b/core/utils/array.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Utility methods related to arrays. - */ - /** @namespace Blockly.utils.array */ import * as goog from '../../closure/goog/goog.js'; goog.declareModuleId('Blockly.utils.array'); diff --git a/core/utils/colour.ts b/core/utils/colour.ts index a669bce65..6d5f1b9df 100644 --- a/core/utils/colour.ts +++ b/core/utils/colour.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Utility methods for colour manipulation. - */ - /** * Utility methods for colour manipulation. * @namespace Blockly.utils.colour diff --git a/core/utils/coordinate.ts b/core/utils/coordinate.ts index 58390cdbf..9068a9624 100644 --- a/core/utils/coordinate.ts +++ b/core/utils/coordinate.ts @@ -4,12 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Utility methods for coordinate manipulation. - * These methods are not specific to Blockly, and could be factored out into - * a JavaScript framework such as Closure. - */ - /** * Utility methods for coordinate manipulation. * These methods are not specific to Blockly, and could be factored out into diff --git a/core/utils/deprecation.ts b/core/utils/deprecation.ts index d4917e667..a45d2cc93 100644 --- a/core/utils/deprecation.ts +++ b/core/utils/deprecation.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Helper function for warning developers about deprecations. - * This method is not specific to Blockly. - */ - /** * Helper function for warning developers about deprecations. * This method is not specific to Blockly. diff --git a/core/utils/dom.ts b/core/utils/dom.ts index 52dde1e5c..c44fe050e 100644 --- a/core/utils/dom.ts +++ b/core/utils/dom.ts @@ -4,12 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Utility methods for DOM manipulation. - * These methods are not specific to Blockly, and could be factored out into - * a JavaScript framework such as Closure. - */ - /** * Utility methods for DOM manipulation. * These methods are not specific to Blockly, and could be factored out into diff --git a/core/utils/idgenerator.ts b/core/utils/idgenerator.ts index d292deec3..ac016000b 100644 --- a/core/utils/idgenerator.ts +++ b/core/utils/idgenerator.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Generators for unique IDs. - */ - /** * Generators for unique IDs. * @namespace Blockly.utils.idGenerator diff --git a/core/utils/keycodes.ts b/core/utils/keycodes.ts index 06d8c7b61..bb6cafd47 100644 --- a/core/utils/keycodes.ts +++ b/core/utils/keycodes.ts @@ -4,12 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Constant declarations for common key codes. - * These methods are not specific to Blockly, and could be factored out into - * a JavaScript framework such as Closure. - */ - /** * Constant declarations for common key codes. * These methods are not specific to Blockly, and could be factored out into diff --git a/core/utils/math.ts b/core/utils/math.ts index c930b2627..0b6040694 100644 --- a/core/utils/math.ts +++ b/core/utils/math.ts @@ -4,12 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Utility methods for math. - * These methods are not specific to Blockly, and could be factored out into - * a JavaScript framework such as Closure. - */ - /** * Utility methods for math. * These methods are not specific to Blockly, and could be factored out into diff --git a/core/utils/metrics.ts b/core/utils/metrics.ts index 2ec83b7e0..4d80391b9 100644 --- a/core/utils/metrics.ts +++ b/core/utils/metrics.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Workspace metrics definitions. - */ - /** * Workspace metrics definitions. * @namespace Blockly.utils.Metrics diff --git a/core/utils/object.ts b/core/utils/object.ts index 364759f03..9c41b473c 100644 --- a/core/utils/object.ts +++ b/core/utils/object.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Utility methods for objects. - */ - /** * Utility methods for objects. * @namespace Blockly.utils.object diff --git a/core/utils/parsing.ts b/core/utils/parsing.ts index 3b9e616d5..7aeebdf90 100644 --- a/core/utils/parsing.ts +++ b/core/utils/parsing.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Utility methods related to block and message parsing. - */ - /** * @namespace Blockly.utils.parsing */ diff --git a/core/utils/rect.ts b/core/utils/rect.ts index 9364bcc66..8ac77e017 100644 --- a/core/utils/rect.ts +++ b/core/utils/rect.ts @@ -4,12 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Utility methods for rectangle manipulation. - * These methods are not specific to Blockly, and could be factored out into - * a JavaScript framework such as Closure. - */ - /** * Utility methods for rectangle manipulation. * These methods are not specific to Blockly, and could be factored out into diff --git a/core/utils/sentinel.ts b/core/utils/sentinel.ts index ab1636a81..f6b8da26d 100644 --- a/core/utils/sentinel.ts +++ b/core/utils/sentinel.ts @@ -4,12 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview A type used to create flag values (e.g. SKIP_SETUP). - */ - /** * A type used to create flag values. + * * @class */ import * as goog from '../../closure/goog/goog.js'; @@ -18,6 +15,7 @@ goog.declareModuleId('Blockly.utils.Sentinel'); /** * A type used to create flag values. + * * @alias Blockly.utils.Sentinel */ export class Sentinel {} diff --git a/core/utils/size.ts b/core/utils/size.ts index d2a236e0d..0a671b342 100644 --- a/core/utils/size.ts +++ b/core/utils/size.ts @@ -4,12 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Utility methods for size calculation. - * These methods are not specific to Blockly, and could be factored out into - * a JavaScript framework such as Closure. - */ - /** * Utility methods for size calculation. * These methods are not specific to Blockly, and could be factored out into diff --git a/core/utils/string.ts b/core/utils/string.ts index 4df1acbda..3530e4c75 100644 --- a/core/utils/string.ts +++ b/core/utils/string.ts @@ -4,12 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Utility methods for string manipulation. - * These methods are not specific to Blockly, and could be factored out into - * a JavaScript framework such as Closure. - */ - /** * Utility methods for string manipulation. * These methods are not specific to Blockly, and could be factored out into diff --git a/core/utils/style.ts b/core/utils/style.ts index 909415979..830566610 100644 --- a/core/utils/style.ts +++ b/core/utils/style.ts @@ -4,12 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Utilities for element styles. - * These methods are not specific to Blockly, and could be factored out into - * a JavaScript framework such as Closure. - */ - /** * Utilities for element styles. * These methods are not specific to Blockly, and could be factored out into diff --git a/core/utils/svg.ts b/core/utils/svg.ts index 02972f1ad..c36b85964 100644 --- a/core/utils/svg.ts +++ b/core/utils/svg.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Defines the Svg class. Its constants enumerate - * all SVG tag names used by Blockly. - */ - /** * Defines the Svg class. Its constants enumerate * all SVG tag names used by Blockly. diff --git a/core/utils/svg_math.ts b/core/utils/svg_math.ts index 686766c6c..d03840236 100644 --- a/core/utils/svg_math.ts +++ b/core/utils/svg_math.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Utility methods for SVG math. - */ - /** * Utility methods realted to figuring out positions of SVG elements. * @namespace Blockly.utils.svgMath diff --git a/core/utils/svg_paths.ts b/core/utils/svg_paths.ts index c13a4d839..e85e8aa7f 100644 --- a/core/utils/svg_paths.ts +++ b/core/utils/svg_paths.ts @@ -1,8 +1,3 @@ -/** - * @fileoverview Methods for creating parts of SVG path strings. See - * developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths - */ - /** * @license * Copyright 2019 Google LLC diff --git a/core/utils/toolbox.ts b/core/utils/toolbox.ts index abd8286dd..1d00e8ac9 100644 --- a/core/utils/toolbox.ts +++ b/core/utils/toolbox.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Utility functions for the toolbox and flyout. - */ - /** * Utility functions for the toolbox and flyout. * @namespace Blockly.utils.toolbox diff --git a/core/utils/useragent.ts b/core/utils/useragent.ts index 587936e9a..daf5cd65f 100644 --- a/core/utils/useragent.ts +++ b/core/utils/useragent.ts @@ -4,12 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Useragent detection. - * These methods are not specific to Blockly, and could be factored out into - * a JavaScript framework such as Closure. - */ - /** * Useragent detection. * These methods are not specific to Blockly, and could be factored out into diff --git a/core/utils/xml.ts b/core/utils/xml.ts index 169e78086..f698095bd 100644 --- a/core/utils/xml.ts +++ b/core/utils/xml.ts @@ -4,12 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview XML element manipulation. - * These methods are not specific to Blockly, and could be factored out into - * a JavaScript framework such as Closure. - */ - /** * XML element manipulation. * These methods are not specific to Blockly, and could be factored out into diff --git a/core/variable_map.ts b/core/variable_map.ts index d72163b76..03790e4bc 100644 --- a/core/variable_map.ts +++ b/core/variable_map.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Object representing a map of variables and their types. - */ - /** * Object representing a map of variables and their types. * @class diff --git a/core/variable_model.ts b/core/variable_model.ts index ef65603fb..dc72094dd 100644 --- a/core/variable_model.ts +++ b/core/variable_model.ts @@ -4,12 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Components for the variable model. - */ - /** * Components for the variable model. + * * @class */ import * as goog from '../closure/goog/goog.js'; @@ -26,6 +23,7 @@ import type {Workspace} from './workspace.js'; /** * Class for a variable model. * Holds information for the variable including name, ID, and type. + * * @see {Blockly.FieldVariable} * @alias Blockly.VariableModel */ @@ -49,6 +47,7 @@ export class VariableModel { * The type of the variable, such as 'int' or 'sound_effect'. This may be * used to build a list of variables of a specific type. By default this is * the empty string '', which is a specific type. + * * @see {Blockly.FieldVariable} */ this.type = opt_type || ''; @@ -63,16 +62,17 @@ export class VariableModel { eventUtils.fire(new (eventUtils.get(eventUtils.VAR_CREATE))!(this)); } - /** @return The ID for the variable. */ + /** @returns The ID for the variable. */ getId(): string { return this.id_; } /** * A custom compare function for the VariableModel objects. + * * @param var1 First variable to compare. * @param var2 Second variable to compare. - * @return -1 if name of var1 is less than name of var2, 0 if equal, and 1 if + * @returns -1 if name of var1 is less than name of var2, 0 if equal, and 1 if * greater. * @internal */ diff --git a/core/variables.ts b/core/variables.ts index 5b9c7db18..600b1bbc2 100644 --- a/core/variables.ts +++ b/core/variables.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Utility functions for handling variables. - */ - /** * Utility functions for handling variables. * @namespace Blockly.Variables diff --git a/core/variables_dynamic.ts b/core/variables_dynamic.ts index 59884a612..1ac5d67da 100644 --- a/core/variables_dynamic.ts +++ b/core/variables_dynamic.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Utility functions for handling typed variables. - */ - /** * Utility functions for handling typed variables. * diff --git a/core/warning.ts b/core/warning.ts index 49b9248cb..4aef917aa 100644 --- a/core/warning.ts +++ b/core/warning.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Object representing a warning. - */ - /** * Object representing a warning. * @class diff --git a/core/widgetdiv.ts b/core/widgetdiv.ts index 36a3bc485..1ede8077a 100644 --- a/core/widgetdiv.ts +++ b/core/widgetdiv.ts @@ -4,12 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview A div that floats on top of Blockly. This singleton contains - * temporary HTML UI widgets that the user is currently interacting with. - * E.g. text input areas, colour pickers, context menus. - */ - /** * A div that floats on top of Blockly. This singleton contains * temporary HTML UI widgets that the user is currently interacting with. diff --git a/core/workspace.ts b/core/workspace.ts index 9e1c7306a..9cb3862ee 100644 --- a/core/workspace.ts +++ b/core/workspace.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Object representing a workspace. - */ - /** * Object representing a workspace. * @class diff --git a/core/workspace_audio.ts b/core/workspace_audio.ts index 6fe43e3d9..e27322b53 100644 --- a/core/workspace_audio.ts +++ b/core/workspace_audio.ts @@ -4,14 +4,10 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Object in charge of loading, storing, and playing audio for a - * workspace. - */ - /** * Object in charge of loading, storing, and playing audio for a * workspace. + * * @class */ import * as goog from '../closure/goog/goog.js'; @@ -29,6 +25,7 @@ const SOUND_LIMIT = 100; /** * Class for loading, storing, and playing audio for a workspace. + * * @alias Blockly.WorkspaceAudio */ export class WorkspaceAudio { @@ -47,6 +44,7 @@ export class WorkspaceAudio { /** * Dispose of this audio manager. + * * @internal */ dispose() { @@ -58,6 +56,7 @@ export class WorkspaceAudio { /** * Load an audio file. Cache it, ready for instantaneous playing. + * * @param filenames List of file types in decreasing order of preference (i.e. * increasing size). E.g. ['media/go.mp3', 'media/go.wav'] Filenames * include path from Blockly's root. File extensions matter. @@ -92,6 +91,7 @@ export class WorkspaceAudio { /** * Preload all the audio files so that they play quickly when asked for. + * * @internal */ preload() { @@ -124,6 +124,7 @@ export class WorkspaceAudio { /** * Play a named sound at specified volume. If volume is not specified, * use full volume (1). + * * @param name Name of sound. * @param opt_volume Volume of sound (0-1). */ diff --git a/core/workspace_comment.ts b/core/workspace_comment.ts index 8d0403ada..410f36945 100644 --- a/core/workspace_comment.ts +++ b/core/workspace_comment.ts @@ -4,12 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Object representing a code comment on the workspace. - */ - /** * Object representing a code comment on the workspace. + * * @class */ import * as goog from '../closure/goog/goog.js'; @@ -32,6 +29,7 @@ import type {Workspace} from './workspace.js'; /** * Class for a workspace comment. + * * @alias Blockly.WorkspaceComment */ export class WorkspaceComment { @@ -97,6 +95,7 @@ export class WorkspaceComment { /** * Dispose of this comment. + * * @internal */ dispose() { @@ -117,7 +116,8 @@ export class WorkspaceComment { /** * Get comment height. - * @return Comment height. + * + * @returns Comment height. * @internal */ getHeight(): number { @@ -126,6 +126,7 @@ export class WorkspaceComment { /** * Set comment height. + * * @param height Comment height. * @internal */ @@ -135,7 +136,8 @@ export class WorkspaceComment { /** * Get comment width. - * @return Comment width. + * + * @returns Comment width. * @internal */ getWidth(): number { @@ -144,6 +146,7 @@ export class WorkspaceComment { /** * Set comment width. + * * @param width comment width. * @internal */ @@ -153,7 +156,8 @@ export class WorkspaceComment { /** * Get stored location. - * @return The comment's stored location. + * + * @returns The comment's stored location. * This is not valid if the comment is currently being dragged. * @internal */ @@ -163,6 +167,7 @@ export class WorkspaceComment { /** * Move a comment by a relative offset. + * * @param dx Horizontal offset, in workspace units. * @param dy Vertical offset, in workspace units. * @internal @@ -177,7 +182,8 @@ export class WorkspaceComment { /** * Get whether this comment is deletable or not. - * @return True if deletable. + * + * @returns True if deletable. * @internal */ isDeletable(): boolean { @@ -187,6 +193,7 @@ export class WorkspaceComment { /** * Set whether this comment is deletable or not. + * * @param deletable True if deletable. * @internal */ @@ -196,7 +203,8 @@ export class WorkspaceComment { /** * Get whether this comment is movable or not. - * @return True if movable. + * + * @returns True if movable. * @internal */ isMovable(): boolean { @@ -206,6 +214,7 @@ export class WorkspaceComment { /** * Set whether this comment is movable or not. + * * @param movable True if movable. * @internal */ @@ -215,7 +224,8 @@ export class WorkspaceComment { /** * Get whether this comment is editable or not. - * @return True if editable. + * + * @returns True if editable. */ isEditable(): boolean { return this.editable_ && @@ -224,6 +234,7 @@ export class WorkspaceComment { /** * Set whether this comment is editable or not. + * * @param editable True if editable. */ setEditable(editable: boolean) { @@ -232,7 +243,8 @@ export class WorkspaceComment { /** * Returns this comment's text. - * @return Comment text. + * + * @returns Comment text. * @internal */ getContent(): string { @@ -241,6 +253,7 @@ export class WorkspaceComment { /** * Set this comment's content. + * * @param content Comment content. * @internal */ @@ -254,8 +267,9 @@ export class WorkspaceComment { /** * Encode a comment subtree as XML with XY coordinates. + * * @param opt_noId True if the encoder should skip the comment ID. - * @return Tree of XML elements. + * @returns Tree of XML elements. * @internal */ toXmlWithXY(opt_noId?: boolean): Element { @@ -279,8 +293,9 @@ export class WorkspaceComment { * Encode a comment subtree as XML, but don't serialize the XY coordinates. * This method avoids some expensive metrics-related calls that are made in * toXmlWithXY(). + * * @param opt_noId True if the encoder should skip the comment ID. - * @return Tree of XML elements. + * @returns Tree of XML elements. * @internal */ toXml(opt_noId?: boolean): Element { @@ -295,6 +310,7 @@ export class WorkspaceComment { /** * Fire a create event for the given workspace comment, if comments are * enabled. + * * @param comment The comment that was just created. * @internal */ @@ -317,9 +333,10 @@ export class WorkspaceComment { /** * Decode an XML comment tag and create a comment on the workspace. + * * @param xmlComment XML comment element. * @param workspace The workspace. - * @return The created workspace comment. + * @returns The created workspace comment. * @internal */ static fromXml(xmlComment: Element, workspace: Workspace): WorkspaceComment { @@ -346,8 +363,9 @@ export class WorkspaceComment { /** * Decode an XML comment tag and return the results in an object. + * * @param xml XML comment element. - * @return An object containing the id, size, position, and comment string. + * @returns An object containing the id, size, position, and comment string. * @internal */ static parseAttributes(xml: Element): { diff --git a/core/workspace_comment_svg.ts b/core/workspace_comment_svg.ts index 528dc88fe..a71af912b 100644 --- a/core/workspace_comment_svg.ts +++ b/core/workspace_comment_svg.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Object representing a code comment on a rendered workspace. - */ - /** * Object representing a code comment on a rendered workspace. * @class diff --git a/core/workspace_drag_surface_svg.ts b/core/workspace_drag_surface_svg.ts index 3873c4c95..fe2e8cfd9 100644 --- a/core/workspace_drag_surface_svg.ts +++ b/core/workspace_drag_surface_svg.ts @@ -4,13 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview An SVG that floats on top of the workspace. - * Blocks are moved into this SVG during a drag, improving performance. - * The entire SVG is translated using CSS translation instead of SVG so the - * blocks are never repainted during drag improving performance. - */ - /** * An SVG that floats on top of the workspace. * Blocks are moved into this SVG during a drag, improving performance. diff --git a/core/workspace_dragger.ts b/core/workspace_dragger.ts index 72ea43e37..0fc016f10 100644 --- a/core/workspace_dragger.ts +++ b/core/workspace_dragger.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Methods for dragging a workspace visually. - */ - /** * Methods for dragging a workspace visually. * @class diff --git a/core/workspace_svg.ts b/core/workspace_svg.ts index 731994362..7073761d1 100644 --- a/core/workspace_svg.ts +++ b/core/workspace_svg.ts @@ -4,12 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Object representing a workspace rendered as SVG. - */ - /** * Object representing a workspace rendered as SVG. + * * @class */ import * as goog from '../closure/goog/goog.js'; @@ -110,6 +107,7 @@ const ZOOM_TO_FIT_MARGIN = 20; /** * Class for a workspace. This is an onscreen area with optional trashcan, * scrollbars, bubbles, and dragging. + * * @alias Blockly.WorkspaceSvg */ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { @@ -252,6 +250,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * The current gesture in progress on this workspace, if any. + * * @internal */ // AnyDuringMigration because: Type 'null' is not assignable to type @@ -305,6 +304,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { * Developers may define this function to add custom menu options to the * workspace's context menu or edit the workspace-created set of menu * options. + * * @param options List of menu options to add to. * @param e The right-click event that triggered the context menu. */ @@ -313,6 +313,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * In a flyout, the target workspace where blocks should be placed after a * drag. Otherwise null. + * * @internal */ // AnyDuringMigration because: Type 'null' is not assignable to type @@ -475,7 +476,8 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Get the marker manager for this workspace. - * @return The marker manager. + * + * @returns The marker manager. */ getMarkerManager(): MarkerManager { return this.markerManager_; @@ -483,7 +485,8 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Gets the metrics manager for this workspace. - * @return The metrics manager. + * + * @returns The metrics manager. */ getMetricsManager(): IMetricsManager { return this.metricsManager_; @@ -491,6 +494,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Sets the metrics manager for the workspace. + * * @param metricsManager The metrics manager. * @internal */ @@ -502,7 +506,8 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Gets the component manager for this workspace. - * @return The component manager. + * + * @returns The component manager. */ getComponentManager(): ComponentManager { return this.componentManager_; @@ -510,6 +515,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Add the cursor SVG to this workspaces SVG group. + * * @param cursorSvg The SVG root of the cursor to be added to the workspace * SVG group. * @internal @@ -520,6 +526,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Add the marker SVG to this workspaces SVG group. + * * @param markerSvg The SVG root of the marker to be added to the workspace * SVG group. * @internal @@ -530,8 +537,9 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Get the marker with the given ID. + * * @param id The ID of the marker. - * @return The marker with the given ID or null if no marker with the given ID + * @returns The marker with the given ID or null if no marker with the given ID * exists. * @internal */ @@ -544,7 +552,8 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * The cursor for this workspace. - * @return The cursor for the workspace. + * + * @returns The cursor for the workspace. */ getCursor(): Cursor|null { if (this.markerManager_) { @@ -555,7 +564,8 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Get the block renderer attached to this workspace. - * @return The renderer attached to this workspace. + * + * @returns The renderer attached to this workspace. */ getRenderer(): Renderer { return this.renderer_; @@ -563,7 +573,8 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Get the theme manager for this workspace. - * @return The theme manager for this workspace. + * + * @returns The theme manager for this workspace. * @internal */ getThemeManager(): ThemeManager { @@ -572,7 +583,8 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Get the workspace theme object. - * @return The workspace theme object. + * + * @returns The workspace theme object. */ getTheme(): Theme { return this.themeManager_.getTheme(); @@ -581,6 +593,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Set the workspace theme object. * If no theme is passed, default to the `Classic` theme. + * * @param theme The workspace theme object. */ setTheme(theme: Theme) { @@ -623,6 +636,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Updates all the blocks with new style. + * * @param blocks List of blocks to update the style on. */ private updateBlockStyles_(blocks: Block[]) { @@ -640,7 +654,8 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Getter for the inverted screen CTM. - * @return The matrix to use in mouseToSvg + * + * @returns The matrix to use in mouseToSvg */ getInverseScreenCTM(): SVGMatrix|null { // Defer getting the screen CTM until we actually need it, this should @@ -663,7 +678,8 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Getter for isVisible - * @return Whether the workspace is visible. + * + * @returns Whether the workspace is visible. * False if the workspace has been hidden by calling `setVisible(false)`. */ isVisible(): boolean { @@ -674,8 +690,9 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { * Return the absolute coordinates of the top-left corner of this element, * scales that after canvas SVG element, if it's a descendant. * The origin (0,0) is the top-left corner of the Blockly SVG. + * * @param element SVG element to find the coordinates of. - * @return Object with .x and .y properties. + * @returns Object with .x and .y properties. * @internal */ getSvgXY(element: SVGElement): Coordinate { @@ -703,7 +720,8 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Gets the size of the workspace's parent SVG element. - * @return The cached width and height of the workspace's parent SVG element. + * + * @returns The cached width and height of the workspace's parent SVG element. * @internal */ getCachedParentSvgSize(): Size { @@ -716,7 +734,8 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { * origin in pixels. * The workspace origin is where a block would render at position (0, 0). * It is not the upper left corner of the workspace SVG. - * @return Offset in pixels. + * + * @returns Offset in pixels. * @internal */ getOriginOffsetInPixels(): Coordinate { @@ -728,7 +747,8 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { * Walks the DOM the first time it's called, then returns a cached value. * Note: We assume this is only called after the workspace has been injected * into the DOM. - * @return The first parent div with 'injectionDiv' in the name. + * + * @returns The first parent div with 'injectionDiv' in the name. * @internal */ getInjectionDiv(): Element { @@ -750,7 +770,8 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Get the SVG block canvas for the workspace. - * @return The SVG group for the workspace. + * + * @returns The SVG group for the workspace. * @internal */ getBlockCanvas(): SVGElement|null { @@ -759,6 +780,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Save resize handler data so we can delete it later in dispose. + * * @param handler Data that can be passed to eventHandling.unbind. */ setResizeHandlerWrapper(handler: browserEvents.Data) { @@ -767,9 +789,10 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Create the workspace DOM elements. + * * @param opt_backgroundClass Either 'blocklyMainBackground' or * 'blocklyMutatorBackground'. - * @return The workspace's SVG group. + * @returns The workspace's SVG group. */ createDom(opt_backgroundClass?: string): Element { /** @@ -838,6 +861,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Dispose of this workspace. * Unlink from all DOM elements to prevent memory leaks. + * * @suppress {checkTypes} */ override dispose() { @@ -950,6 +974,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Add a trashcan. + * * @internal */ addTrashcan() { @@ -959,6 +984,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { } /** + * @param _workspace * @internal */ static newTrashcan(_workspace: WorkspaceSvg): Trashcan { @@ -969,6 +995,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Add zoom controls. + * * @internal */ addZoomControls() { @@ -979,8 +1006,9 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Add a flyout element in an element with the given tag name. + * * @param tagName What type of tag the flyout belongs in. - * @return The element containing the flyout DOM. + * @returns The element containing the flyout DOM. * @internal */ addFlyout(tagName: string|Svg|Svg): Element { @@ -1018,8 +1046,9 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { * Getter for the flyout associated with this workspace. This flyout may be * owned by either the toolbox or the workspace, depending on toolbox * configuration. It will be null if there is no flyout. + * * @param opt_own Whether to only return the workspace's own flyout. - * @return The flyout on this workspace. + * @returns The flyout on this workspace. * @internal */ getFlyout(opt_own?: boolean): IFlyout|null { @@ -1034,7 +1063,8 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Getter for the toolbox associated with this workspace, if one exists. - * @return The toolbox on this workspace. + * + * @returns The toolbox on this workspace. * @internal */ getToolbox(): IToolbox|null { @@ -1054,6 +1084,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { * If enabled, resize the parts of the workspace that change when the * workspace contents (e.g. block positions) change. This will also scroll * the workspace contents if needed. + * * @internal */ resizeContents() { @@ -1102,6 +1133,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Resizes and repositions workspace chrome if the page has a new * scroll position. + * * @internal */ updateScreenCalculationsIfScrolled() { @@ -1116,7 +1148,8 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Get the SVG element that forms the drawing surface. - * @return SVG group element. + * + * @returns SVG group element. */ getCanvas(): SVGGElement { return this.svgBlockCanvas_ as SVGGElement; @@ -1125,6 +1158,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Caches the width and height of the workspace's parent SVG element for use * with getSvgMetrics. + * * @param width The width of the parent SVG element. * @param height The height of the parent SVG element * @internal @@ -1151,7 +1185,8 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Get the SVG element that forms the bubble surface. - * @return SVG group element. + * + * @returns SVG group element. */ getBubbleCanvas(): SVGGElement { return this.svgBubbleCanvas_ as SVGGElement; @@ -1161,7 +1196,8 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { * Get the SVG element that contains this workspace. * Note: We assume this is only called after the workspace has been injected * into the DOM. - * @return SVG element. + * + * @returns SVG element. */ getParentSvg(): SVGSVGElement { if (!this.cachedParentSvg_) { @@ -1180,6 +1216,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Fires a viewport event if events are enabled and there is a change in * viewport values. + * * @internal */ maybeFireViewportChangeEvent() { @@ -1205,6 +1242,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Translate this workspace to new coordinates. + * * @param x Horizontal translation, in pixel units relative to the top left of * the Blockly div. * @param y Vertical translation, in pixel units relative to the top left of @@ -1235,6 +1273,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { * Called at the end of a workspace drag to take the contents * out of the drag surface and put them back into the workspace SVG. * Does nothing if the workspace drag surface is not enabled. + * * @internal */ resetDragSurface() { @@ -1257,6 +1296,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { * Called at the beginning of a workspace drag to move contents of * the workspace to the drag surface. * Does nothing if the drag surface is not enabled. + * * @internal */ setupDragSurface() { @@ -1296,7 +1336,8 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Gets the drag surface blocks are moved to when a drag is started. - * @return This workspace's block drag surface, if one is in use. + * + * @returns This workspace's block drag surface, if one is in use. * @internal */ getBlockDragSurface(): BlockDragSurfaceSvg|null { @@ -1306,7 +1347,8 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Returns the horizontal offset of the workspace. * Intended for LTR/RTL compatibility in XML. - * @return Width. + * + * @returns Width. */ override getWidth(): number { const metrics = this.getMetrics(); @@ -1316,6 +1358,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Toggles the visibility of the workspace. * Currently only intended for main workspace. + * * @param isVisible True if workspace should be visible. */ setVisible(isVisible: boolean) { @@ -1379,6 +1422,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Highlight or unhighlight a block in the workspace. Block highlighting is * often used to visually mark blocks currently being executed. + * * @param id ID of block to highlight/unhighlight, or null for no block (used * to unhighlight all blocks). * @param opt_state If undefined, highlight specified block and automatically @@ -1411,8 +1455,9 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { * Pastes the provided block or workspace comment onto the workspace. * Does not check whether there is remaining capacity for the object, that * should be done before calling this method. + * * @param state The representation of the thing to paste. - * @return The pasted thing, or null if the paste was not successful. + * @returns The pasted thing, or null if the paste was not successful. */ paste(state: AnyDuringMigration|Element|DocumentFragment): ICopyable|null { if (!this.rendered || !state['type'] && !state['tagName']) { @@ -1446,9 +1491,10 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Paste the provided block onto the workspace. + * * @param xmlBlock XML block element. * @param jsonBlock JSON block representation. - * @return The pasted block. + * @returns The pasted block. */ private pasteBlock_(xmlBlock: Element|null, jsonBlock: blocks.State|null): BlockSvg { @@ -1536,8 +1582,9 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Paste the provided comment onto the workspace. + * * @param xmlComment XML workspace comment element. - * @return The pasted workspace comment. + * @returns The pasted workspace comment. * @suppress {checkTypes} Suppress checks while workspace comments are not * bundled in. */ @@ -1583,6 +1630,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Refresh the toolbox unless there's a drag in progress. + * * @internal */ refreshToolboxSelection() { @@ -1595,6 +1643,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Rename a variable by updating its name in the variable map. Update the * flyout to show the renamed variable immediately. + * * @param id ID of the variable to rename. * @param newName New variable name. */ @@ -1606,6 +1655,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Delete a variable by the passed in ID. Update the flyout to show * immediately that the variable is deleted. + * * @param id ID of variable to delete. */ override deleteVariableById(id: string) { @@ -1616,12 +1666,13 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Create a new variable with the given name. Update the flyout to show the * new variable immediately. + * * @param name The new variable's name. * @param opt_type The type of the variable like 'int' or 'string'. * Does not need to be unique. Field_variable can filter variables based * on their type. This will default to '' which is a specific type. * @param opt_id The unique ID of the variable. This will default to a UUID. - * @return The newly created variable. + * @returns The newly created variable. */ override createVariable( name: string, opt_type?: string|null, @@ -1633,6 +1684,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Make a list of all the delete areas for this workspace. + * * @deprecated Use workspace.recordDragTargets. (2021 June) */ recordDeleteAreas() { @@ -1664,11 +1716,12 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Obtain a newly created block. + * * @param prototypeName Name of the language object containing type-specific * functions for this block. * @param opt_id Optional ID. Use this ID if provided, otherwise create a new * ID. - * @return The created block. + * @returns The created block. */ // eslint-disable-next-line @typescript-eslint/no-unused-vars override newBlock(prototypeName: string, opt_id?: string): BlockSvg { @@ -1679,8 +1732,9 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Returns the drag target the mouse event is over. + * * @param e Mouse move event. - * @return Null if not over a drag target, or the drag target the event is + * @returns Null if not over a drag target, or the drag target the event is * over. */ getDragTarget(e: Event): IDragTarget|null { @@ -1699,6 +1753,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Handle a mouse-down on SVG drawing surface. + * * @param e Mouse down event. */ private onMouseDown_(e: MouseEvent) { @@ -1710,6 +1765,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Start tracking a drag of an object on this workspace. + * * @param e Mouse down event. * @param xy Starting location of object. */ @@ -1725,8 +1781,9 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Track a drag of an object on this workspace. + * * @param e Mouse move event. - * @return New location of object. + * @returns New location of object. */ moveDrag(e: MouseEvent): Coordinate { const point = browserEvents.mouseToSvg( @@ -1739,7 +1796,8 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Is the user currently dragging a block or scrolling the flyout/workspace? - * @return True if currently dragging or scrolling. + * + * @returns True if currently dragging or scrolling. */ isDragging(): boolean { return this.currentGesture_ !== null && this.currentGesture_.isDragging(); @@ -1747,7 +1805,8 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Is this workspace draggable? - * @return True if this workspace may be dragged. + * + * @returns True if this workspace may be dragged. */ isDraggable(): boolean { return this.options.moveOptions && this.options.moveOptions.drag; @@ -1761,7 +1820,8 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { * through zooming with the scroll wheel or pinch (since the zoom is centered * on the mouse position). This does not include zooming with the zoom * controls since the X Y coordinates are decided programmatically. - * @return True if the workspace is movable, false otherwise. + * + * @returns True if the workspace is movable, false otherwise. */ isMovable(): boolean { return this.options.moveOptions && !!this.options.moveOptions.scrollbars || @@ -1773,7 +1833,8 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Is this workspace movable horizontally? - * @return True if the workspace is movable horizontally, false otherwise. + * + * @returns True if the workspace is movable horizontally, false otherwise. */ isMovableHorizontally(): boolean { const hasScrollbars = !!this.scrollbar; @@ -1784,7 +1845,8 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Is this workspace movable vertically? - * @return True if the workspace is movable vertically, false otherwise. + * + * @returns True if the workspace is movable vertically, false otherwise. */ isMovableVertically(): boolean { const hasScrollbars = !!this.scrollbar; @@ -1795,6 +1857,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Handle a mouse-wheel on SVG drawing surface. + * * @param e Mouse wheel event. */ private onMouseWheel_(e: WheelEvent) { @@ -1851,7 +1914,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { * Calculate the bounding box for the blocks on the workspace. * Coordinate system: workspace coordinates. * - * @return Contains the position and size of the bounding box containing the + * @returns Contains the position and size of the bounding box containing the * blocks on the workspace. */ getBlocksBoundingBox(): Rect { @@ -1911,6 +1974,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Show the context menu for the workspace. + * * @param e Mouse event. * @internal */ @@ -1934,6 +1998,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Modify the block tree on the existing toolbox. + * * @param toolboxDef DOM tree of toolbox contents, string of toolbox contents, * or JSON representing toolbox definition. */ @@ -2018,6 +2083,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Zooms the workspace in or out relative to/centered on the given (x, y) * coordinate. + * * @param x X coordinate of center, in pixel units relative to the top-left * corner of the parentSVG. * @param y Y coordinate of center, in pixel units relative to the top-left @@ -2070,6 +2136,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Zooming the blocks centered in the center of view with zooming in or out. + * * @param type Type of zooming (-1 zooming out and 1 zooming in). */ zoomCenter(type: number) { @@ -2142,6 +2209,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Add a transition class to the block and bubble canvas, to animate any * transform changes. + * * @internal */ beginCanvasTransition() { @@ -2151,6 +2219,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Remove transition class from the block and bubble canvas. + * * @internal */ endCanvasTransition() { @@ -2180,6 +2249,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Scroll the workspace to center on the given block. If the block has other * blocks stacked below it, the workspace will be centered on the stack. + * * @param id ID of block center on. */ centerOnBlock(id: string|null) { @@ -2235,6 +2305,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Set the workspace's zoom factor. + * * @param newScale Zoom factor. Units: (pixels / workspaceUnit). */ setScale(newScale: number) { @@ -2284,7 +2355,8 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Get the workspace's zoom factor. If the workspace has a parent, we call * into the parent to get the workspace scale. - * @return The workspace zoom factor. Units: (pixels / workspaceUnit). + * + * @returns The workspace zoom factor. Units: (pixels / workspaceUnit). */ getScale(): number { if (this.options.parentWorkspace) { @@ -2297,6 +2369,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { * Scroll the workspace to a specified offset (in pixels), keeping in the * workspace bounds. See comment on workspaceSvg.scrollX for more detail on * the meaning of these values. + * * @param x Target X to scroll to. * @param y Target Y to scroll to. * @internal @@ -2341,8 +2414,9 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Find the block on this workspace with the specified ID. + * * @param id ID of block to find. - * @return The sought after block, or null if not found. + * @returns The sought after block, or null if not found. */ override getBlockById(id: string): BlockSvg|null { return super.getBlockById(id) as BlockSvg; @@ -2351,8 +2425,9 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Find all blocks in workspace. Blocks are optionally sorted * by position; top to bottom (with slight LTR or RTL bias). + * * @param ordered Sort the list if true. - * @return Array of blocks. + * @returns Array of blocks. */ override getAllBlocks(ordered: boolean): BlockSvg[] { return super.getAllBlocks(ordered) as BlockSvg[]; @@ -2361,8 +2436,9 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Finds the top-level blocks and returns them. Blocks are optionally sorted * by position; top to bottom (with slight LTR or RTL bias). + * * @param ordered Sort the list if true. - * @return The top-level block objects. + * @returns The top-level block objects. */ override getTopBlocks(ordered: boolean): BlockSvg[] { return super.getTopBlocks(ordered) as BlockSvg[]; @@ -2370,6 +2446,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Adds a block to the list of top blocks. + * * @param block Block to add. */ override addTopBlock(block: Block) { @@ -2379,6 +2456,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Removes a block from the list of top blocks. + * * @param block Block to remove. */ override removeTopBlock(block: Block) { @@ -2388,6 +2466,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Adds a comment to the list of top comments. + * * @param comment comment to add. */ override addTopComment(comment: WorkspaceComment) { @@ -2397,6 +2476,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Removes a comment from the list of top comments. + * * @param comment comment to remove. */ override removeTopComment(comment: WorkspaceComment) { @@ -2406,6 +2486,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Adds a bounded element to the list of top bounded elements. + * * @param element Bounded element to add. */ addTopBoundedElement(element: IBoundedElement) { @@ -2414,6 +2495,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Removes a bounded element from the list of top bounded elements. + * * @param element Bounded element to remove. */ removeTopBoundedElement(element: IBoundedElement) { @@ -2422,7 +2504,8 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Finds the top-level bounded elements and returns them. - * @return The top-level bounded elements. + * + * @returns The top-level bounded elements. */ getTopBoundedElements(): IBoundedElement[] { return (new Array()).concat(this.topBoundedElements_); @@ -2433,6 +2516,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { * If enabled, workspace will resize when appropriate. * If disabled, workspace will not resize until re-enabled. * Use to avoid resizing during a batch operation, for performance. + * * @param enabled Whether resizes should be enabled. */ setResizesEnabled(enabled: boolean) { @@ -2462,6 +2546,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { * * should be matched by a call to * registerButtonCallback("CREATE_VARIABLE", yourCallbackFunction). + * * @param key The name to use to look up this function. * @param func The function to call when the given button is clicked. */ @@ -2476,8 +2561,9 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Get the callback function associated with a given key, for clicks on * buttons and labels in the flyout. + * * @param key The name to use to look up the function. - * @return The function corresponding to the given key for this workspace; + * @returns The function corresponding to the given key for this workspace; * null if no callback is registered. */ getButtonCallback(key: string): @@ -2488,6 +2574,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Remove a callback for a click on a button in the flyout. + * * @param key The name associated with the callback function. */ removeButtonCallback(key: string) { @@ -2498,6 +2585,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { * Register a callback function associated with a given key, for populating * custom toolbox categories in this workspace. See the variable and * procedure categories as an example. + * * @param key The name to use to look up this function. * @param func The function to call when the given toolbox category is opened. */ @@ -2512,8 +2600,9 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Get the callback function associated with a given key, for populating * custom toolbox categories in this workspace. + * * @param key The name to use to look up the function. - * @return The function corresponding to the given key for this workspace, or + * @returns The function corresponding to the given key for this workspace, or * null if no function is registered. */ getToolboxCategoryCallback(key: string): @@ -2523,6 +2612,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Remove a callback for a click on a custom category's name in the toolbox. + * * @param key The name associated with the callback function. */ removeToolboxCategoryCallback(key: string) { @@ -2532,8 +2622,9 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Look up the gesture that is tracking this touch stream on this workspace. * May create a new gesture. + * * @param e Mouse event or touch event. - * @return The gesture that is tracking this touch stream, or null if no valid + * @returns The gesture that is tracking this touch stream, or null if no valid * gesture exists. * @internal */ @@ -2565,6 +2656,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Clear the reference to the current gesture. + * * @internal */ clearGesture() { @@ -2575,6 +2667,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Cancel the current gesture, if one exists. + * * @internal */ cancelCurrentGesture() { @@ -2585,7 +2678,8 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Get the audio manager for this workspace. - * @return The audio manager for this workspace. + * + * @returns The audio manager for this workspace. */ getAudioManager(): WorkspaceAudio { return this.audioManager_; @@ -2593,7 +2687,8 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Get the grid object for this workspace, or null if there is none. - * @return The grid object for this workspace. + * + * @returns The grid object for this workspace. * @internal */ getGrid(): Grid|null { @@ -2602,6 +2697,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Close tooltips, context menus, dropdown selections, etc. + * * @param opt_onlyClosePopups Whether only popups should be closed. */ hideChaff(opt_onlyClosePopups?: boolean) { @@ -2618,6 +2714,8 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Sets the X/Y translations of a top level workspace. + * + * @param this * @param xyRatio Contains an x and/or y property which is a float between 0 * and 1 specifying the degree of scrolling. */ @@ -2647,6 +2745,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { /** * Size the workspace when the contents change. This also updates * scrollbars accordingly. + * * @param workspace The workspace to resize. * @alias Blockly.WorkspaceSvg.resizeSvgContents * @internal diff --git a/core/xml.ts b/core/xml.ts index 725f4cf71..3daf990d1 100644 --- a/core/xml.ts +++ b/core/xml.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview XML reader and writer. - */ - /** * XML reader and writer. * @namespace Blockly.Xml diff --git a/core/zoom_controls.ts b/core/zoom_controls.ts index e8947a157..3b681f87a 100644 --- a/core/zoom_controls.ts +++ b/core/zoom_controls.ts @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @fileoverview Object representing a zoom icons. - */ - /** * Object representing a zoom icons. * @class