Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Lint TsDoc. #6353

Merged
merged 21 commits into from
Aug 23, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
c08528c
chore: add linting for tsdoc
maribethb Aug 16, 2022
8556a22
chore: don't require types on return
maribethb Aug 16, 2022
169959b
chore: remove redundant fileoverview from ts
maribethb Aug 16, 2022
d6d8656
chore: change return to returns and add some newlines
maribethb Aug 16, 2022
1734555
chore: remove license tag
maribethb Aug 16, 2022
5ed2e9c
chore: don't require params/return docs
maribethb Aug 16, 2022
78d7f07
chore: remove spurious struct tags
maribethb Aug 16, 2022
894361f
Merge branch 'develop' of github.com:google/blockly into lint-tsdoc
maribethb Aug 16, 2022
e043d55
Revert "chore: change return to returns and add some newlines"
maribethb Aug 17, 2022
048be74
chore: don't auto-add param names
maribethb Aug 17, 2022
bf16641
chore: disable require-param bc it breaks on this
maribethb Aug 17, 2022
f704323
return to returns and add line breaks
maribethb Aug 17, 2022
a9e7e5d
chore: configure additional jsdoc rules
maribethb Aug 17, 2022
d688d72
chore: run format
maribethb Aug 17, 2022
9f64c4c
Revert "chore: remove license tag"
maribethb Aug 18, 2022
1358755
chore: allow license tag format
maribethb Aug 18, 2022
a00eb45
chore: only require jsdoc on exported items
maribethb Aug 18, 2022
3ce05d9
chore: add missing jsdoc or silence where needed
maribethb Aug 18, 2022
efcf7b6
chore: run format
maribethb Aug 18, 2022
85f487e
chore: lint fixes
maribethb Aug 23, 2022
1951782
Merge branch 'develop' of github.com:google/blockly into lint-tsdoc
maribethb Aug 23, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions core/block.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
* SPDX-License-Identifier: Apache-2.0
*/

/**
* @fileoverview The class representing one block.
*/

/**
* The class representing one block.
* @class
Expand Down
12 changes: 8 additions & 4 deletions core/block_animations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -37,6 +34,7 @@ let disconnectGroup: SVGElement|null = null;

/**
* Play some UI effects (sound, animation) when disposing of a block.
*
cpcallen marked this conversation as resolved.
Show resolved Hide resolved
* @param block The block being disposed of.
* @alias Blockly.blockAnimations.disposeUiEffect
* @internal
Expand All @@ -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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand All @@ -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
Expand All @@ -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.
Expand All @@ -190,6 +193,7 @@ function disconnectUiStep(group: SVGElement, magnitude: number, start: Date) {

/**
* Stop the disconnect UI animation immediately.
*
* @alias Blockly.blockAnimations.disconnectUiStop
* @internal
*/
Expand Down
9 changes: 0 additions & 9 deletions core/block_drag_surface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions core/block_dragger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
* SPDX-License-Identifier: Apache-2.0
*/

/**
* @fileoverview Methods for dragging a block visually.
*/

/**
* Methods for dragging a block visually.
* @class
Expand Down
4 changes: 0 additions & 4 deletions core/block_svg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
39 changes: 28 additions & 11 deletions core/blockly.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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
*/
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -310,20 +310,23 @@ 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
*/
export const getMainWorkspace = common.getMainWorkspace;

/**
* Returns the currently selected copyable object.
*
* @alias Blockly.common.getSelected
*/
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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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_
Expand All @@ -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_
Expand All @@ -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.
Expand All @@ -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_
Expand Down Expand Up @@ -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;
Expand All @@ -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 =
Expand All @@ -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;
Expand Down
4 changes: 0 additions & 4 deletions core/blockly_options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions core/blocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading