@theredhead — Frontend Library - v0.2.1
    Preparing search index...

    A single validation rule, JSON-serializable.

    { "type": "required", "message": "This field is required." }
    { "type": "minLength", "params": { "min": 3 }, "message": "At least 3 characters." }
    { "type": "pattern", "params": { "pattern": "^[A-Z]" }, "message": "Must start with uppercase." }
    interface ValidationRule {
        message?: string;
        params?: Readonly<Record<string, unknown>>;
        type: ValidationRuleType;
    }
    Index

    Properties

    Properties

    message?: string

    Human-readable error message shown when the rule fails.

    params?: Readonly<Record<string, unknown>>

    Additional parameters for the validator. The shape depends on the type:

    Type Params
    required —
    minLength { min: number }
    maxLength { max: number }
    min { min: number }
    max { max: number }
    pattern { pattern: string }
    email —
    custom { validatorId: string, … }

    The validator to apply.