mirror of
https://github.com/google/blockly.git
synced 2026-01-08 01:20:12 +01:00
chore: Lint TsDoc. (#6353)
* chore: add linting for tsdoc * chore: don't require types on return * chore: remove redundant fileoverview from ts * chore: change return to returns and add some newlines * chore: remove license tag * chore: don't require params/return docs * chore: remove spurious struct tags * Revert "chore: change return to returns and add some newlines" This reverts commitd6d8656a45. * chore: don't auto-add param names * chore: disable require-param bc it breaks on this * return to returns and add line breaks * chore: configure additional jsdoc rules * chore: run format * Revert "chore: remove license tag" This reverts commit173455588a. * chore: allow license tag format * chore: only require jsdoc on exported items * chore: add missing jsdoc or silence where needed * chore: run format * chore: lint fixes
This commit is contained in:
committed by
GitHub
parent
bb37d1b7aa
commit
037eb59b89
@@ -4,12 +4,9 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* @fileoverview Components for creating connections between blocks.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Components for creating connections between blocks.
|
||||
*
|
||||
* @class
|
||||
*/
|
||||
import * as goog from '../closure/goog/goog.js';
|
||||
@@ -46,6 +43,7 @@ const BUMP_RANDOMNESS = 10;
|
||||
|
||||
/**
|
||||
* Class for a connection between blocks that may be rendered on screen.
|
||||
*
|
||||
* @alias Blockly.RenderedConnection
|
||||
*/
|
||||
export class RenderedConnection extends Connection {
|
||||
@@ -90,6 +88,7 @@ export class RenderedConnection extends Connection {
|
||||
/**
|
||||
* Dispose of this connection. Remove it from the database (if it is
|
||||
* tracked) and call the super-function to deal with connected blocks.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
override dispose() {
|
||||
@@ -101,7 +100,8 @@ export class RenderedConnection extends Connection {
|
||||
|
||||
/**
|
||||
* Get the source block for this connection.
|
||||
* @return The source block.
|
||||
*
|
||||
* @returns The source block.
|
||||
*/
|
||||
override getSourceBlock(): BlockSvg {
|
||||
return super.getSourceBlock() as BlockSvg;
|
||||
@@ -109,7 +109,8 @@ export class RenderedConnection extends Connection {
|
||||
|
||||
/**
|
||||
* Returns the block that this connection connects to.
|
||||
* @return The connected block or null if none is connected.
|
||||
*
|
||||
* @returns The connected block or null if none is connected.
|
||||
*/
|
||||
override targetBlock(): BlockSvg|null {
|
||||
return super.targetBlock() as BlockSvg;
|
||||
@@ -118,8 +119,9 @@ export class RenderedConnection extends Connection {
|
||||
/**
|
||||
* Returns the distance between this connection and another connection in
|
||||
* workspace units.
|
||||
*
|
||||
* @param otherConnection The other connection to measure the distance to.
|
||||
* @return The distance between connections, in workspace units.
|
||||
* @returns The distance between connections, in workspace units.
|
||||
*/
|
||||
distanceFrom(otherConnection: Connection): number {
|
||||
const xDiff = this.x - otherConnection.x;
|
||||
@@ -130,6 +132,7 @@ export class RenderedConnection extends Connection {
|
||||
/**
|
||||
* Move the block(s) belonging to the connection to a point where they don't
|
||||
* visually interfere with the specified connection.
|
||||
*
|
||||
* @param staticConnection The connection to move away from.
|
||||
* @internal
|
||||
*/
|
||||
@@ -178,6 +181,7 @@ export class RenderedConnection extends Connection {
|
||||
|
||||
/**
|
||||
* Change the connection's coordinates.
|
||||
*
|
||||
* @param x New absolute x coordinate, in workspace coordinates.
|
||||
* @param y New absolute y coordinate, in workspace coordinates.
|
||||
*/
|
||||
@@ -195,6 +199,7 @@ export class RenderedConnection extends Connection {
|
||||
|
||||
/**
|
||||
* Change the connection's coordinates.
|
||||
*
|
||||
* @param dx Change to x coordinate, in workspace units.
|
||||
* @param dy Change to y coordinate, in workspace units.
|
||||
*/
|
||||
@@ -205,6 +210,7 @@ export class RenderedConnection extends Connection {
|
||||
/**
|
||||
* Move this connection to the location given by its offset within the block
|
||||
* and the location of the block's top left corner.
|
||||
*
|
||||
* @param blockTL The location of the top left corner of the block, in
|
||||
* workspace coordinates.
|
||||
*/
|
||||
@@ -215,6 +221,7 @@ export class RenderedConnection extends Connection {
|
||||
|
||||
/**
|
||||
* Set the offset of this connection relative to the top left of its block.
|
||||
*
|
||||
* @param x The new relative x, in workspace units.
|
||||
* @param y The new relative y, in workspace units.
|
||||
*/
|
||||
@@ -225,7 +232,8 @@ export class RenderedConnection extends Connection {
|
||||
|
||||
/**
|
||||
* Get the offset of this connection relative to the top left of its block.
|
||||
* @return The offset of the connection.
|
||||
*
|
||||
* @returns The offset of the connection.
|
||||
* @internal
|
||||
*/
|
||||
getOffsetInBlock(): Coordinate {
|
||||
@@ -234,6 +242,7 @@ export class RenderedConnection extends Connection {
|
||||
|
||||
/**
|
||||
* Move the blocks on either side of this connection right next to each other.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
tighten() {
|
||||
@@ -256,10 +265,11 @@ export class RenderedConnection extends Connection {
|
||||
/**
|
||||
* Find the closest compatible connection to this connection.
|
||||
* All parameters are in workspace units.
|
||||
*
|
||||
* @param maxLimit 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.
|
||||
*/
|
||||
closest(maxLimit: number, dxy: Coordinate):
|
||||
@@ -316,6 +326,7 @@ export class RenderedConnection extends Connection {
|
||||
|
||||
/**
|
||||
* Set whether this connections is tracked in the database or not.
|
||||
*
|
||||
* @param doTracking If true, start tracking. If false, stop tracking.
|
||||
* @internal
|
||||
*/
|
||||
@@ -347,6 +358,7 @@ export class RenderedConnection extends Connection {
|
||||
* collapsed.
|
||||
*
|
||||
* Also closes down-stream icons/bubbles.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
stopTrackingAll() {
|
||||
@@ -373,7 +385,8 @@ export class RenderedConnection extends Connection {
|
||||
* Start tracking this connection, as well as all down-stream connections on
|
||||
* any block attached to this connection. This happens when a block is
|
||||
* expanded.
|
||||
* @return List of blocks to render.
|
||||
*
|
||||
* @returns List of blocks to render.
|
||||
*/
|
||||
startTrackingAll(): Block[] {
|
||||
this.setTracking(true);
|
||||
@@ -415,6 +428,7 @@ export class RenderedConnection extends Connection {
|
||||
* Behavior after a connection attempt fails.
|
||||
* Bumps this connection away from the other connection. Called when an
|
||||
* attempted connection fails.
|
||||
*
|
||||
* @param otherConnection Connection that this connection failed to connect
|
||||
* to.
|
||||
* @internal
|
||||
@@ -435,6 +449,7 @@ export class RenderedConnection extends Connection {
|
||||
|
||||
/**
|
||||
* Disconnect two blocks that are connected by this connection.
|
||||
*
|
||||
* @param parentBlock The superior block.
|
||||
* @param childBlock The inferior block.
|
||||
*/
|
||||
@@ -477,9 +492,10 @@ export class RenderedConnection extends Connection {
|
||||
/**
|
||||
* Find all nearby compatible connections to this connection.
|
||||
* Type checking does not apply, since this function is used for bumping.
|
||||
*
|
||||
* @param maxLimit The maximum radius to another connection, in workspace
|
||||
* units.
|
||||
* @return List of connections.
|
||||
* @returns List of connections.
|
||||
* @internal
|
||||
*/
|
||||
override neighbours(maxLimit: number): Connection[] {
|
||||
@@ -489,6 +505,7 @@ export class RenderedConnection extends Connection {
|
||||
/**
|
||||
* Connect two connections together. This is the connection on the superior
|
||||
* block. Rerender blocks as needed.
|
||||
*
|
||||
* @param childConnection Connection on inferior block.
|
||||
*/
|
||||
protected override connect_(childConnection: Connection) {
|
||||
|
||||
Reference in New Issue
Block a user