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

    Interface WithCustomRules

    Interface for schema types that support adding custom validation rules. Provides a fluent API for chaining validation rules onto schema types.

    const schema = vine.string()
    .use(minLength({ length: 5 }))
    .use(customRule({ option: 'value' }))
    interface WithCustomRules {
        use(validation: Validation<any> | RuleBuilder): this;
    }

    Implemented by

    Index

    Methods

    Methods

    • Adds a validation rule to the schema's validation chain. Rules are executed in the order they are added.

      Parameters

      Returns this

      The schema instance for method chaining

      schema.use(minLength({ length: 3 }))
      schema.use(myCustomRule({ strict: true }))