mirror of
https://github.com/google/blockly.git
synced 2026-01-06 16:40:07 +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 Number input field
|
||||
*/
|
||||
|
||||
/**
|
||||
* Number input field
|
||||
*
|
||||
* @class
|
||||
*/
|
||||
import * as goog from '../closure/goog/goog.js';
|
||||
@@ -24,6 +21,7 @@ import type {Sentinel} from './utils/sentinel.js';
|
||||
|
||||
/**
|
||||
* Class for an editable number field.
|
||||
*
|
||||
* @alias Blockly.FieldNumber
|
||||
*/
|
||||
export class FieldNumber extends FieldTextInput {
|
||||
@@ -90,6 +88,7 @@ export class FieldNumber extends FieldTextInput {
|
||||
|
||||
/**
|
||||
* 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: FieldNumberConfig) {
|
||||
@@ -107,6 +106,7 @@ export class FieldNumber extends FieldTextInput {
|
||||
* precision. The least significant digit place is inferred from the
|
||||
* precision. Integers values can be enforces by choosing an integer
|
||||
* precision.
|
||||
*
|
||||
* @param min Minimum value.
|
||||
* @param max Maximum value.
|
||||
* @param precision Precision for value.
|
||||
@@ -123,6 +123,7 @@ export class FieldNumber extends FieldTextInput {
|
||||
/**
|
||||
* Sets the minimum value this field can contain. Updates the value to
|
||||
* reflect.
|
||||
*
|
||||
* @param min Minimum value.
|
||||
*/
|
||||
setMin(min: number|string|undefined|null) {
|
||||
@@ -133,6 +134,7 @@ export class FieldNumber extends FieldTextInput {
|
||||
/**
|
||||
* Sets the minimum value this field can contain. Called internally to avoid
|
||||
* value updates.
|
||||
*
|
||||
* @param min Minimum value.
|
||||
*/
|
||||
private setMinInternal_(min: number|string|undefined|null) {
|
||||
@@ -149,7 +151,8 @@ export class FieldNumber extends FieldTextInput {
|
||||
/**
|
||||
* Returns the current minimum value this field can contain. Default is
|
||||
* -Infinity.
|
||||
* @return The current minimum value this field can contain.
|
||||
*
|
||||
* @returns The current minimum value this field can contain.
|
||||
*/
|
||||
getMin(): number {
|
||||
return this.min_;
|
||||
@@ -158,6 +161,7 @@ export class FieldNumber extends FieldTextInput {
|
||||
/**
|
||||
* Sets the maximum value this field can contain. Updates the value to
|
||||
* reflect.
|
||||
*
|
||||
* @param max Maximum value.
|
||||
*/
|
||||
setMax(max: number|string|undefined|null) {
|
||||
@@ -168,6 +172,7 @@ export class FieldNumber extends FieldTextInput {
|
||||
/**
|
||||
* Sets the maximum value this field can contain. Called internally to avoid
|
||||
* value updates.
|
||||
*
|
||||
* @param max Maximum value.
|
||||
*/
|
||||
private setMaxInternal_(max: number|string|undefined|null) {
|
||||
@@ -184,7 +189,8 @@ export class FieldNumber extends FieldTextInput {
|
||||
/**
|
||||
* Returns the current maximum value this field can contain. Default is
|
||||
* Infinity.
|
||||
* @return The current maximum value this field can contain.
|
||||
*
|
||||
* @returns The current maximum value this field can contain.
|
||||
*/
|
||||
getMax(): number {
|
||||
return this.max_;
|
||||
@@ -193,6 +199,7 @@ export class FieldNumber extends FieldTextInput {
|
||||
/**
|
||||
* Sets the precision of this field's value, i.e. the number to which the
|
||||
* value is rounded. Updates the field to reflect.
|
||||
*
|
||||
* @param precision The number to which the field's value is rounded.
|
||||
*/
|
||||
setPrecision(precision: number|string|undefined|null) {
|
||||
@@ -203,6 +210,7 @@ export class FieldNumber extends FieldTextInput {
|
||||
/**
|
||||
* Sets the precision of this field's value. Called internally to avoid
|
||||
* value updates.
|
||||
*
|
||||
* @param precision The number to which the field's value is rounded.
|
||||
*/
|
||||
private setPrecisionInternal_(precision: number|string|undefined|null) {
|
||||
@@ -228,7 +236,8 @@ export class FieldNumber extends FieldTextInput {
|
||||
* Returns the current precision of this field. The precision being the
|
||||
* number to which the field's value is rounded. A precision of 0 means that
|
||||
* the value is not rounded.
|
||||
* @return The number to which this field's value is rounded.
|
||||
*
|
||||
* @returns The number to which this field's value is rounded.
|
||||
*/
|
||||
getPrecision(): number {
|
||||
return this.precision_;
|
||||
@@ -237,8 +246,9 @@ export class FieldNumber extends FieldTextInput {
|
||||
/**
|
||||
* Ensure that the input value is a valid number (must fulfill the
|
||||
* constraints placed on the field).
|
||||
*
|
||||
* @param opt_newValue The input value.
|
||||
* @return A valid number, or null if invalid.
|
||||
* @returns A valid number, or null if invalid.
|
||||
*/
|
||||
protected override doClassValidation_(opt_newValue?: AnyDuringMigration):
|
||||
number|null {
|
||||
@@ -276,7 +286,8 @@ export class FieldNumber extends FieldTextInput {
|
||||
|
||||
/**
|
||||
* Create the number input editor widget.
|
||||
* @return The newly created number input editor.
|
||||
*
|
||||
* @returns The newly created number input editor.
|
||||
*/
|
||||
protected override widgetCreate_(): HTMLElement {
|
||||
const htmlInput = super.widgetCreate_();
|
||||
@@ -293,8 +304,9 @@ export class FieldNumber extends FieldTextInput {
|
||||
|
||||
/**
|
||||
* Construct a FieldNumber from a JSON arg object.
|
||||
*
|
||||
* @param options A JSON object with options (value, min, max, and precision).
|
||||
* @return The new field instance.
|
||||
* @returns The new field instance.
|
||||
* @nocollapse
|
||||
* @internal
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user