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 Manager for all items registered with the workspace.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Manager for all items registered with the workspace.
|
||||
*
|
||||
* @class
|
||||
*/
|
||||
import * as goog from '../closure/goog/goog.js';
|
||||
@@ -36,7 +33,8 @@ class Capability<_T> {
|
||||
|
||||
/**
|
||||
* Returns the name of the capability.
|
||||
* @return The name.
|
||||
*
|
||||
* @returns The name.
|
||||
*/
|
||||
toString(): string {
|
||||
return this.name_;
|
||||
@@ -45,6 +43,7 @@ class Capability<_T> {
|
||||
|
||||
/**
|
||||
* Manager for all items registered with the workspace.
|
||||
*
|
||||
* @alias Blockly.ComponentManager
|
||||
*/
|
||||
export class ComponentManager {
|
||||
@@ -60,6 +59,7 @@ export class ComponentManager {
|
||||
|
||||
/**
|
||||
* Adds a component.
|
||||
*
|
||||
* @param componentInfo The data for the component to register.
|
||||
* @param opt_allowOverrides True to prevent an error when overriding an
|
||||
* already registered item.
|
||||
@@ -88,6 +88,7 @@ export class ComponentManager {
|
||||
|
||||
/**
|
||||
* Removes a component.
|
||||
*
|
||||
* @param id The ID of the component to remove.
|
||||
*/
|
||||
removeComponent(id: string) {
|
||||
@@ -104,6 +105,7 @@ export class ComponentManager {
|
||||
|
||||
/**
|
||||
* Adds a capability to a existing registered component.
|
||||
*
|
||||
* @param id The ID of the component to add the capability to.
|
||||
* @param capability The capability to add.
|
||||
*/
|
||||
@@ -125,6 +127,7 @@ export class ComponentManager {
|
||||
|
||||
/**
|
||||
* Removes a capability from an existing registered component.
|
||||
*
|
||||
* @param id The ID of the component to remove the capability from.
|
||||
* @param capability The capability to remove.
|
||||
*/
|
||||
@@ -147,9 +150,10 @@ export class ComponentManager {
|
||||
|
||||
/**
|
||||
* Returns whether the component with this id has the specified capability.
|
||||
*
|
||||
* @param id The ID of the component to check.
|
||||
* @param capability The capability to check for.
|
||||
* @return Whether the component has the capability.
|
||||
* @returns Whether the component has the capability.
|
||||
*/
|
||||
hasCapability<T>(id: string, capability: string|Capability<T>): boolean {
|
||||
capability = String(capability).toLowerCase();
|
||||
@@ -159,8 +163,9 @@ export class ComponentManager {
|
||||
|
||||
/**
|
||||
* Gets the component with the given ID.
|
||||
*
|
||||
* @param id The ID of the component to get.
|
||||
* @return The component with the given name or undefined if not found.
|
||||
* @returns The component with the given name or undefined if not found.
|
||||
*/
|
||||
getComponent(id: string): IComponent|undefined {
|
||||
return this.componentData.get(id)?.component;
|
||||
@@ -168,9 +173,10 @@ export class ComponentManager {
|
||||
|
||||
/**
|
||||
* Gets all the components with the specified capability.
|
||||
*
|
||||
* @param capability The capability of the component.
|
||||
* @param sorted Whether to return list ordered by weights.
|
||||
* @return The components that match the specified capability.
|
||||
* @returns The components that match the specified capability.
|
||||
*/
|
||||
getComponents<T extends IComponent>(
|
||||
capability: string|Capability<T>, sorted: boolean): T[] {
|
||||
|
||||
Reference in New Issue
Block a user