fix: set default field to any and fix validator function return type (#6690)

* chore: set default field to  and fix validator function return type

* Fix format
This commit is contained in:
Blake Thomas Williams
2022-12-09 16:16:37 -06:00
committed by GitHub
parent d6230b2a44
commit 9ee1559e34

View File

@@ -45,17 +45,17 @@ import * as WidgetDiv from './widgetdiv.js';
import type {WorkspaceSvg} from './workspace_svg.js';
import * as Xml from './xml.js';
export type FieldValidator<T = unknown> = (value: T) => void;
export type FieldValidator<T = any> = (value?: T) => T|null|undefined;
/**
* Abstract class for an editable field.
*
* @alias Blockly.Field
*/
export abstract class Field<T = unknown> implements IASTNodeLocationSvg,
IASTNodeLocationWithBlock,
IKeyboardAccessible,
IRegistrable {
export abstract class Field<T = any> implements IASTNodeLocationSvg,
IASTNodeLocationWithBlock,
IKeyboardAccessible,
IRegistrable {
/**
* To overwrite the default value which is set in **Field**, directly update
* the prototype.