From 9ee1559e345dad22d581fc04ea0d750f97c8566a Mon Sep 17 00:00:00 2001 From: Blake Thomas Williams <49404493+btw17@users.noreply.github.com> Date: Fri, 9 Dec 2022 16:16:37 -0600 Subject: [PATCH] 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 --- core/field.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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.