diff --git a/core/field.ts b/core/field.ts index ce34c8a87..cf9148e1c 100644 --- a/core/field.ts +++ b/core/field.ts @@ -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 = (value: T) => void; +export type FieldValidator = (value?: T) => T|null|undefined; /** * Abstract class for an editable field. * * @alias Blockly.Field */ -export abstract class Field implements IASTNodeLocationSvg, - IASTNodeLocationWithBlock, - IKeyboardAccessible, - IRegistrable { +export abstract class Field implements IASTNodeLocationSvg, + IASTNodeLocationWithBlock, + IKeyboardAccessible, + IRegistrable { /** * To overwrite the default value which is set in **Field**, directly update * the prototype.