@vinejs/vine - v4.0.0-next.1
    Preparing search index...

    Interface RuleBuilder

    Interface for rule builder objects that can be converted into validation rules. Rule builders provide a fluent API for configuring validation rules before converting them into executable validations.

    class MinLengthBuilder implements RuleBuilder {
    constructor(private length: number) {}

    [VALIDATION](): Validation<{ length: number }> {
    return {
    rule: minLengthRule,
    options: { length: this.length }
    }
    }
    }
    interface RuleBuilder {
        "[VALIDATION]"(): Validation<any>;
    }
    Index

    Methods

    Methods

    • Converts the rule builder into an executable validation. This method is called internally when the rule is applied to a schema.

      Returns Validation<any>