mirror of
https://github.com/google/blockly.git
synced 2026-01-21 07:47:09 +01:00
* chore: replace `AnyDuringMigration` for field value functions * chore: removed unnecessary `KeyboardEvent` comments and `AnyDuringMigration` casts * chore: cleaned up `doValueUpdate_` and `doClassValidation_` in `Field` subclasses * fix: updated `FieldValidator` to allow returning `undefined` and restructured `setValue` * fix: implemented initial `core/field_checkbox.ts` feedback * fix: updated `Field` to accept `U` and `undefined` and reverted subclass constructor handling of the input value * fix: reverted `getVars` to returning `string[]` and added related comment * chore: removed unnecessary comment * fix: updated `processValidation_` to no longer allow returning `undefined` * fix: removed `Un` type alias for `undefined` * chore: removed unnecessary string cast in `core/field_colour.ts` * fix: updated `doClassValidation_` not to expect `null` since it will never come up in `setValue` * fix: updated `doClassValidation_` to only allow `undefined` when the new value exists * Updated `FieldValidator` type to expect `newValue` to exist * cleanup: updated `picker` from type `Element` to type `HTMLElement` * fix: updated `doValueInvalid_` type info in `core/field_input.ts` to handle `string` and `undefined` * fix: reverted `getValue` in `core/field_checkbox.ts` to previous logic * fix: updated the `Field` constructor to allow `value` to be optional * chore: consolidated `Validation` with `FieldValidator` and `doClassValidation_` * fix: reverted generic param `U` while handling diverging user input is being discussed * fix: updated `doClassValidation_` return comment to work for TSDoc * fix: misc keyboard event function tweaks
28 lines
483 B
TypeScript
28 lines
483 B
TypeScript
/**
|
|
* @license
|
|
* Copyright 2022 Google LLC
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
/**
|
|
* A type used to create flag values.
|
|
*
|
|
* @class
|
|
*/
|
|
import * as goog from '../../closure/goog/goog.js';
|
|
goog.declareModuleId('Blockly.utils.Sentinel');
|
|
|
|
|
|
/**
|
|
* A type used to create flag values.
|
|
*
|
|
* @alias Blockly.utils.Sentinel
|
|
*/
|
|
export class Sentinel {
|
|
/**
|
|
* Provide a unique key so that type guarding properly excludes values like
|
|
* string.
|
|
*/
|
|
UNIQUE_KEY?: never;
|
|
}
|