Skip to main content

ValidatorError

An error returned by a validator, optionally assigned to another node.

Import

import type { ValidatorError } from '@ngblocks/form-nodes';

When to use it

Use for a validator-returned error with optional target attribution. The pipeline can supply the current node when no explicit target is present.

Declaration

type ValidatorError<TNode extends ValidatorNodeView<AnyNode> = ValidatorNodeView<AnyNode>> = Omit<ValidationError, 'kind'> & {
readonly kind: string | number;
readonly targetNode?: TNode;
readonly formNode?: never;
};

Type parameters

ParameterConstraintDefault
TNodeValidatorNodeView<AnyNode>ValidatorNodeView<AnyNode>

Declared members

The declaration above also includes inherited contracts and overloads where applicable.

MemberMeaning
kindError identifier. Numeric inputs are normalized with String(kind); exposed errors always use strings.
targetNodeNode that should own this error.