diff --git a/.changeset/mighty-frogs-wave.md b/.changeset/mighty-frogs-wave.md new file mode 100644 index 000000000..01ccd3a54 --- /dev/null +++ b/.changeset/mighty-frogs-wave.md @@ -0,0 +1,5 @@ +--- +'@lion/form-core': patch +--- + +Extend type of getMessage to allow it being implemented as a sync function. diff --git a/packages/form-core/types/validate/validate.d.ts b/packages/form-core/types/validate/validate.d.ts index 6fcfbeb01..d8892bbd4 100644 --- a/packages/form-core/types/validate/validate.d.ts +++ b/packages/form-core/types/validate/validate.d.ts @@ -27,7 +27,7 @@ export type ValidatorParam = any; * Will be stored on Validator instance and passed to `execute` function */ export type ValidatorConfig = { - getMessage?: (data: Partial) => Promise; + getMessage?: (data: Partial) => Promise | string | Element; type?: ValidationType; node?: FormControlHost; fieldName?: string | Promise;