mirror of
https://github.com/google/blockly.git
synced 2026-01-07 17:10:11 +01:00
fix: Move @alias onto classes instead of constructors (#6003)
* fix: Move @alias onto classes instead of constructors * fix: Fix JSDoc for constructors.
This commit is contained in:
@@ -25,6 +25,7 @@ const {Workspace} = goog.requireType('Blockly.Workspace');
|
||||
/**
|
||||
* Abstract class for an event.
|
||||
* @abstract
|
||||
* @alias Blockly.Events.Abstract
|
||||
*/
|
||||
class Abstract {
|
||||
/**
|
||||
|
||||
@@ -23,12 +23,12 @@ const {Block} = goog.requireType('Blockly.Block');
|
||||
/**
|
||||
* Abstract class for a block event.
|
||||
* @extends {AbstractEvent}
|
||||
* @alias Blockly.Events.BlockBase
|
||||
*/
|
||||
class BlockBase extends AbstractEvent {
|
||||
/**
|
||||
* @param {!Block=} opt_block The block this event corresponds to.
|
||||
* Undefined for a blank event.
|
||||
* @alias Blockly.Events.BlockBase
|
||||
*/
|
||||
constructor(opt_block) {
|
||||
super();
|
||||
|
||||
@@ -28,6 +28,7 @@ const {Block} = goog.requireType('Blockly.Block');
|
||||
/**
|
||||
* Class for a block change event.
|
||||
* @extends {BlockBase}
|
||||
* @alias Blockly.Events.BlockChange
|
||||
*/
|
||||
class BlockChange extends BlockBase {
|
||||
/**
|
||||
@@ -37,7 +38,6 @@ class BlockChange extends BlockBase {
|
||||
* @param {?string=} opt_name Name of input or field affected, or null.
|
||||
* @param {*=} opt_oldValue Previous value of element.
|
||||
* @param {*=} opt_newValue New value of element.
|
||||
* @alias Blockly.Events.BlockChange
|
||||
*/
|
||||
constructor(opt_block, opt_element, opt_name, opt_oldValue, opt_newValue) {
|
||||
super(opt_block);
|
||||
|
||||
@@ -27,12 +27,12 @@ const {Block} = goog.requireType('Blockly.Block');
|
||||
/**
|
||||
* Class for a block creation event.
|
||||
* @extends {BlockBase}
|
||||
* @alias Blockly.Events.BlockCreate
|
||||
*/
|
||||
class BlockCreate extends BlockBase {
|
||||
/**
|
||||
* @param {!Block=} opt_block The created block. Undefined for a blank
|
||||
* event.
|
||||
* @alias Blockly.Events.BlockCreate
|
||||
*/
|
||||
constructor(opt_block) {
|
||||
super(opt_block);
|
||||
|
||||
@@ -27,12 +27,12 @@ const {Block} = goog.requireType('Blockly.Block');
|
||||
/**
|
||||
* Class for a block deletion event.
|
||||
* @extends {BlockBase}
|
||||
* @alias Blockly.Events.BlockDelete
|
||||
*/
|
||||
class BlockDelete extends BlockBase {
|
||||
/**
|
||||
* @param {!Block=} opt_block The deleted block. Undefined for a blank
|
||||
* event.
|
||||
* @alias Blockly.Events.BlockDelete
|
||||
*/
|
||||
constructor(opt_block) {
|
||||
super(opt_block);
|
||||
|
||||
@@ -25,6 +25,7 @@ const {UiBase} = goog.require('Blockly.Events.UiBase');
|
||||
/**
|
||||
* Class for a block drag event.
|
||||
* @extends {UiBase}
|
||||
* @alias Blockly.Events.BlockDrag
|
||||
*/
|
||||
class BlockDrag extends UiBase {
|
||||
/**
|
||||
@@ -34,7 +35,6 @@ class BlockDrag extends UiBase {
|
||||
* Undefined for a blank event.
|
||||
* @param {!Array<!Block>=} opt_blocks The blocks affected by this
|
||||
* drag. Undefined for a blank event.
|
||||
* @alias Blockly.Events.BlockDrag
|
||||
*/
|
||||
constructor(opt_block, opt_isStart, opt_blocks) {
|
||||
const workspaceId = opt_block ? opt_block.workspace.id : undefined;
|
||||
|
||||
@@ -27,12 +27,12 @@ const {Coordinate} = goog.require('Blockly.utils.Coordinate');
|
||||
/**
|
||||
* Class for a block move event. Created before the move.
|
||||
* @extends {BlockBase}
|
||||
* @alias Blockly.Events.BlockMove
|
||||
*/
|
||||
class BlockMove extends BlockBase {
|
||||
/**
|
||||
* @param {!Block=} opt_block The moved block. Undefined for a blank
|
||||
* event.
|
||||
* @alias Blockly.Events.BlockMove
|
||||
*/
|
||||
constructor(opt_block) {
|
||||
super(opt_block);
|
||||
|
||||
@@ -25,6 +25,7 @@ const {UiBase} = goog.require('Blockly.Events.UiBase');
|
||||
/**
|
||||
* Class for a bubble open event.
|
||||
* @extends {UiBase}
|
||||
* @alias Blockly.Events.BubbleOpen
|
||||
*/
|
||||
class BubbleOpen extends UiBase {
|
||||
/**
|
||||
@@ -35,7 +36,6 @@ class BubbleOpen extends UiBase {
|
||||
* @param {string=} opt_bubbleType The type of bubble. One of 'mutator',
|
||||
* 'comment'
|
||||
* or 'warning'. Undefined for a blank event.
|
||||
* @alias Blockly.Events.BubbleOpen
|
||||
*/
|
||||
constructor(opt_block, opt_isOpen, opt_bubbleType) {
|
||||
const workspaceId = opt_block ? opt_block.workspace.id : undefined;
|
||||
|
||||
@@ -25,6 +25,7 @@ const {UiBase} = goog.require('Blockly.Events.UiBase');
|
||||
/**
|
||||
* Class for a click event.
|
||||
* @extends {UiBase}
|
||||
* @alias Blockly.Events.Click
|
||||
*/
|
||||
class Click extends UiBase {
|
||||
/**
|
||||
@@ -35,7 +36,6 @@ class Click extends UiBase {
|
||||
* Not used if block is passed. Undefined for a blank event.
|
||||
* @param {string=} opt_targetType The type of element targeted by this click
|
||||
* event. Undefined for a blank event.
|
||||
* @alias Blockly.Events.Click
|
||||
*/
|
||||
constructor(opt_block, opt_workspaceId, opt_targetType) {
|
||||
let workspaceId = opt_block ? opt_block.workspace.id : opt_workspaceId;
|
||||
|
||||
@@ -30,12 +30,12 @@ const {WorkspaceComment} = goog.requireType('Blockly.WorkspaceComment');
|
||||
/**
|
||||
* Abstract class for a comment event.
|
||||
* @extends {AbstractEvent}
|
||||
* @alias Blockly.Events.CommentBase
|
||||
*/
|
||||
class CommentBase extends AbstractEvent {
|
||||
/**
|
||||
* @param {!WorkspaceComment=} opt_comment The comment this event
|
||||
* corresponds to. Undefined for a blank event.
|
||||
* @alias Blockly.Events.CommentBase
|
||||
*/
|
||||
constructor(opt_comment) {
|
||||
super();
|
||||
|
||||
@@ -25,6 +25,7 @@ const {WorkspaceComment} = goog.requireType('Blockly.WorkspaceComment');
|
||||
/**
|
||||
* Class for a comment change event.
|
||||
* @extends {CommentBase}
|
||||
* @alias Blockly.Events.CommentChange
|
||||
*/
|
||||
class CommentChange extends CommentBase {
|
||||
/**
|
||||
@@ -32,7 +33,6 @@ class CommentChange extends CommentBase {
|
||||
* changed. Undefined for a blank event.
|
||||
* @param {string=} opt_oldContents Previous contents of the comment.
|
||||
* @param {string=} opt_newContents New contents of the comment.
|
||||
* @alias Blockly.Events.CommentChange
|
||||
*/
|
||||
constructor(opt_comment, opt_oldContents, opt_newContents) {
|
||||
super(opt_comment);
|
||||
|
||||
@@ -26,12 +26,12 @@ const {WorkspaceComment} = goog.requireType('Blockly.WorkspaceComment');
|
||||
/**
|
||||
* Class for a comment creation event.
|
||||
* @extends {CommentBase}
|
||||
* @alias Blockly.Events.CommentCreate
|
||||
*/
|
||||
class CommentCreate extends CommentBase {
|
||||
/**
|
||||
* @param {!WorkspaceComment=} opt_comment The created comment.
|
||||
* Undefined for a blank event.
|
||||
* @alias Blockly.Events.CommentCreate
|
||||
*/
|
||||
constructor(opt_comment) {
|
||||
super(opt_comment);
|
||||
|
||||
@@ -25,12 +25,12 @@ const {WorkspaceComment} = goog.requireType('Blockly.WorkspaceComment');
|
||||
/**
|
||||
* Class for a comment deletion event.
|
||||
* @extends {CommentBase}
|
||||
* @alias Blockly.Events.CommentDelete
|
||||
*/
|
||||
class CommentDelete extends CommentBase {
|
||||
/**
|
||||
* @param {!WorkspaceComment=} opt_comment The deleted comment.
|
||||
* Undefined for a blank event.
|
||||
* @alias Blockly.Events.CommentDelete
|
||||
*/
|
||||
constructor(opt_comment) {
|
||||
super(opt_comment);
|
||||
|
||||
@@ -26,12 +26,12 @@ const {WorkspaceComment} = goog.requireType('Blockly.WorkspaceComment');
|
||||
/**
|
||||
* Class for a comment move event. Created before the move.
|
||||
* @extends {CommentBase}
|
||||
* @alias Blockly.Events.CommentMove
|
||||
*/
|
||||
class CommentMove extends CommentBase {
|
||||
/**
|
||||
* @param {!WorkspaceComment=} opt_comment The comment that is being
|
||||
* moved. Undefined for a blank event.
|
||||
* @alias Blockly.Events.CommentMove
|
||||
*/
|
||||
constructor(opt_comment) {
|
||||
super(opt_comment);
|
||||
|
||||
@@ -28,6 +28,7 @@ const {Workspace} = goog.requireType('Blockly.Workspace');
|
||||
/**
|
||||
* Class for a marker move event.
|
||||
* @extends {UiBase}
|
||||
* @alias Blockly.Events.MarkerMove
|
||||
*/
|
||||
class MarkerMove extends UiBase {
|
||||
/**
|
||||
@@ -39,7 +40,6 @@ class MarkerMove extends UiBase {
|
||||
* Undefined for a blank event.
|
||||
* @param {!ASTNode=} opt_newNode The new node the marker is now on.
|
||||
* Undefined for a blank event.
|
||||
* @alias Blockly.Events.MarkerMove
|
||||
*/
|
||||
constructor(opt_block, isCursor, opt_oldNode, opt_newNode) {
|
||||
let workspaceId = opt_block ? opt_block.workspace.id : undefined;
|
||||
|
||||
@@ -23,6 +23,7 @@ const {UiBase} = goog.require('Blockly.Events.UiBase');
|
||||
/**
|
||||
* Class for a selected event.
|
||||
* @extends {UiBase}
|
||||
* @alias Blockly.Events.Selected
|
||||
*/
|
||||
class Selected extends UiBase {
|
||||
/**
|
||||
@@ -32,7 +33,6 @@ class Selected extends UiBase {
|
||||
* no element currently selected (deselect). Undefined for a blank event.
|
||||
* @param {string=} opt_workspaceId The workspace identifier for this event.
|
||||
* Null if no element previously selected. Undefined for a blank event.
|
||||
* @alias Blockly.Events.Selected
|
||||
*/
|
||||
constructor(opt_oldElementId, opt_newElementId, opt_workspaceId) {
|
||||
super(opt_workspaceId);
|
||||
|
||||
@@ -23,13 +23,13 @@ const {UiBase} = goog.require('Blockly.Events.UiBase');
|
||||
/**
|
||||
* Class for a theme change event.
|
||||
* @extends {UiBase}
|
||||
* @alias Blockly.Events.ThemeChange
|
||||
*/
|
||||
class ThemeChange extends UiBase {
|
||||
/**
|
||||
* @param {string=} opt_themeName The theme name. Undefined for a blank event.
|
||||
* @param {string=} opt_workspaceId The workspace identifier for this event.
|
||||
* event. Undefined for a blank event.
|
||||
* @alias Blockly.Events.ThemeChange
|
||||
*/
|
||||
constructor(opt_themeName, opt_workspaceId) {
|
||||
super(opt_workspaceId);
|
||||
|
||||
@@ -23,6 +23,7 @@ const {UiBase} = goog.require('Blockly.Events.UiBase');
|
||||
/**
|
||||
* Class for a toolbox item select event.
|
||||
* @extends {UiBase}
|
||||
* @alias Blockly.Events.ToolboxItemSelect
|
||||
*/
|
||||
class ToolboxItemSelect extends UiBase {
|
||||
/**
|
||||
@@ -32,7 +33,6 @@ class ToolboxItemSelect extends UiBase {
|
||||
* for a blank event.
|
||||
* @param {string=} opt_workspaceId The workspace identifier for this event.
|
||||
* Undefined for a blank event.
|
||||
* @alias Blockly.Events.ToolboxItemSelect
|
||||
*/
|
||||
constructor(opt_oldItem, opt_newItem, opt_workspaceId) {
|
||||
super(opt_workspaceId);
|
||||
|
||||
@@ -23,6 +23,7 @@ const {UiBase} = goog.require('Blockly.Events.UiBase');
|
||||
/**
|
||||
* Class for a trashcan open event.
|
||||
* @extends {UiBase}
|
||||
* @alias Blockly.Events.TrashcanOpen
|
||||
*/
|
||||
class TrashcanOpen extends UiBase {
|
||||
/**
|
||||
@@ -30,7 +31,6 @@ class TrashcanOpen extends UiBase {
|
||||
* if opening). Undefined for a blank event.
|
||||
* @param {string=} opt_workspaceId The workspace identifier for this event.
|
||||
* Undefined for a blank event.
|
||||
* @alias Blockly.Events.TrashcanOpen
|
||||
*/
|
||||
constructor(opt_isOpen, opt_workspaceId) {
|
||||
super(opt_workspaceId);
|
||||
|
||||
@@ -28,6 +28,7 @@ const {UiBase} = goog.require('Blockly.Events.UiBase');
|
||||
* Class for a UI event.
|
||||
* @extends {UiBase}
|
||||
* @deprecated December 2020. Instead use a more specific UI event.
|
||||
* @alias Blockly.Events.Ui
|
||||
*/
|
||||
class Ui extends UiBase {
|
||||
/**
|
||||
@@ -37,7 +38,6 @@ class Ui extends UiBase {
|
||||
* etc.
|
||||
* @param {*=} opt_oldValue Previous value of element.
|
||||
* @param {*=} opt_newValue New value of element.
|
||||
* @alias Blockly.Events.Ui
|
||||
*/
|
||||
constructor(opt_block, opt_element, opt_oldValue, opt_newValue) {
|
||||
const workspaceId = opt_block ? opt_block.workspace.id : undefined;
|
||||
|
||||
@@ -27,12 +27,12 @@ const {Abstract: AbstractEvent} = goog.require('Blockly.Events.Abstract');
|
||||
* categories).
|
||||
* UI events do not undo or redo.
|
||||
* @extends {AbstractEvent}
|
||||
* @alias Blockly.Events.UiBase
|
||||
*/
|
||||
class UiBase extends AbstractEvent {
|
||||
/**
|
||||
* @param {string=} opt_workspaceId The workspace identifier for this event.
|
||||
* Undefined for a blank event.
|
||||
* @alias Blockly.Events.UiBase
|
||||
*/
|
||||
constructor(opt_workspaceId) {
|
||||
super();
|
||||
|
||||
@@ -23,12 +23,12 @@ const {VariableModel} = goog.requireType('Blockly.VariableModel');
|
||||
/**
|
||||
* Abstract class for a variable event.
|
||||
* @extends {AbstractEvent}
|
||||
* @alias Blockly.Events.VarBase
|
||||
*/
|
||||
class VarBase extends AbstractEvent {
|
||||
/**
|
||||
* @param {!VariableModel=} opt_variable The variable this event
|
||||
* corresponds to. Undefined for a blank event.
|
||||
* @alias Blockly.Events.VarBase
|
||||
*/
|
||||
constructor(opt_variable) {
|
||||
super();
|
||||
|
||||
@@ -25,12 +25,12 @@ const {VariableModel} = goog.requireType('Blockly.VariableModel');
|
||||
/**
|
||||
* Class for a variable creation event.
|
||||
* @extends {VarBase}
|
||||
* @alias Blockly.Events.VarCreate
|
||||
*/
|
||||
class VarCreate extends VarBase {
|
||||
/**
|
||||
* @param {!VariableModel=} opt_variable The created variable. Undefined
|
||||
* for a blank event.
|
||||
* @alias Blockly.Events.VarCreate
|
||||
*/
|
||||
constructor(opt_variable) {
|
||||
super(opt_variable);
|
||||
|
||||
@@ -25,12 +25,12 @@ const {VariableModel} = goog.requireType('Blockly.VariableModel');
|
||||
/**
|
||||
* Class for a variable deletion event.
|
||||
* @extends {VarBase}
|
||||
* @alias Blockly.Events.VarDelete
|
||||
*/
|
||||
class VarDelete extends VarBase {
|
||||
/**
|
||||
* @param {!VariableModel=} opt_variable The deleted variable. Undefined
|
||||
* for a blank event.
|
||||
* @alias Blockly.Events.VarDelete
|
||||
*/
|
||||
constructor(opt_variable) {
|
||||
super(opt_variable);
|
||||
|
||||
@@ -25,13 +25,13 @@ const {VariableModel} = goog.requireType('Blockly.VariableModel');
|
||||
/**
|
||||
* Class for a variable rename event.
|
||||
* @extends {VarBase}
|
||||
* @alias Blockly.Events.VarRename
|
||||
*/
|
||||
class VarRename extends VarBase {
|
||||
/**
|
||||
* @param {!VariableModel=} opt_variable The renamed variable. Undefined
|
||||
* for a blank event.
|
||||
* @param {string=} newName The new name the variable will be changed to.
|
||||
* @alias Blockly.Events.VarRename
|
||||
*/
|
||||
constructor(opt_variable, newName) {
|
||||
super(opt_variable);
|
||||
|
||||
@@ -23,6 +23,7 @@ const {UiBase} = goog.require('Blockly.Events.UiBase');
|
||||
/**
|
||||
* Class for a viewport change event.
|
||||
* @extends {UiBase}
|
||||
* @alias Blockly.Events.ViewportChange
|
||||
*/
|
||||
class ViewportChange extends UiBase {
|
||||
/**
|
||||
@@ -37,7 +38,6 @@ class ViewportChange extends UiBase {
|
||||
* Undefined for a blank event.
|
||||
* @param {number=} opt_oldScale The old scale of the workspace. Undefined for
|
||||
* a blank event.
|
||||
* @alias Blockly.Events.ViewportChange
|
||||
*/
|
||||
constructor(opt_top, opt_left, opt_scale, opt_workspaceId, opt_oldScale) {
|
||||
super(opt_workspaceId);
|
||||
|
||||
@@ -28,12 +28,12 @@ const {Workspace} = goog.requireType('Blockly.Workspace');
|
||||
* domToWorkspace).
|
||||
* Finished loading events do not record undo or redo.
|
||||
* @extends {AbstractEvent}
|
||||
* @alias Blockly.Events.FinishedLoading
|
||||
*/
|
||||
class FinishedLoading extends AbstractEvent {
|
||||
/**
|
||||
* @param {!Workspace=} opt_workspace The workspace that has finished
|
||||
* loading. Undefined for a blank event.
|
||||
* @alias Blockly.Events.FinishedLoading
|
||||
*/
|
||||
constructor(opt_workspace) {
|
||||
super();
|
||||
|
||||
Reference in New Issue
Block a user