import type { FieldContext } from '@vinejs/compiler/types'; import type { AlphaOptions, MobileOptions, PassportOptions, CreditCardOptions, PostalCodeOptions, VATOptions } from '../../types.js'; /** * Validates the value to be a string. * Reports an error if the value is not of type string. * * @example * vine.string() */ export declare const stringRule: (options?: undefined) => import("../../types.js").Validation; /** * Validates the value to be a valid email address. * Supports various email validation options including domain-specific rules. * * @example * vine.string().email() * vine.string().email({ allow_ip_domain: true }) */ export declare const emailRule: (options?: import("validator/lib/isEmail.js").IsEmailOptions | undefined) => import("../../types.js").Validation; /** * Validates the value to be a valid mobile phone number for specified locales. * Supports locale-specific mobile number formats and strict mode validation. * * @example * vine.string().mobile() * vine.string().mobile({ locale: ['en-US', 'en-GB'] }) * vine.string().mobile({ locale: ['en-US'], strictMode: true }) */ export declare const mobileRule: (options?: MobileOptions | ((field: FieldContext) => MobileOptions | undefined) | undefined) => import("../../types.js").Validation MobileOptions | undefined) | undefined>; /** * Validates the value to be a valid IP address (IPv4 or IPv6). * Optionally restricts to a specific IP version. * * @example * vine.string().ipAddress() * vine.string().ipAddress({ version: 4 }) * vine.string().ipAddress({ version: 6 }) */ export declare const ipAddressRule: (options?: { version: 4 | 6; } | undefined) => import("../../types.js").Validation<{ version: 4 | 6; } | undefined>; /** * Validates the value against a custom regular expression pattern. * The value must match the provided regular expression. * * @example * vine.string().regex(/^[A-Z]{3}\d{3}$/) * vine.string().regex(/^\d{4}-\d{2}-\d{2}$/) */ export declare const regexRule: (options: RegExp) => import("../../types.js").Validation; /** * Validates the value to be a valid hexadecimal color code. * Accepts formats like #FFF, #FFFFFF, or #FFFFFFFF. * * @example * vine.string().hexCode() */ export declare const hexCodeRule: (options?: undefined) => import("../../types.js").Validation; /** * Validates the value to be a valid URL. * Supports various URL validation options including protocol requirements. * * @example * vine.string().url() * vine.string().url({ require_protocol: true }) * vine.string().url({ protocols: ['https'] }) */ export declare const urlRule: (options?: import("validator/lib/isURL.js").IsURLOptions | undefined) => import("../../types.js").Validation; /** * Validates the value to be an active URL by making an HTTP request. * Checks if the URL is reachable and returns a successful response. * * @example * vine.string().activeUrl() */ export declare const activeUrlRule: (options?: undefined) => import("../../types.js").Validation; /** * Validates the value to contain only alphabetic characters. * Supports options to allow spaces, dashes, and underscores. * * @example * vine.string().alpha() * vine.string().alpha({ allowSpaces: true }) * vine.string().alpha({ allowDashes: true, allowUnderscores: true }) */ export declare const alphaRule: (options?: AlphaOptions | undefined) => import("../../types.js").Validation; /** * Validates the value to contain only alphanumeric characters (letters and numbers). * Supports options to allow spaces, dashes, and underscores. * * @example * vine.string().alphaNumeric() * vine.string().alphaNumeric({ allowSpaces: true }) * vine.string().alphaNumeric({ allowDashes: true, allowUnderscores: true }) */ export declare const alphaNumericRule: (options?: AlphaOptions | undefined) => import("../../types.js").Validation; /** * Enforces a minimum length on a string field. * The string must have at least the specified number of characters. * * @example * vine.string().minLength(5) */ export declare const minLengthRule: (options: { min: number; }) => import("../../types.js").Validation<{ min: number; }>; /** * Enforces a maximum length on a string field. * The string must not exceed the specified number of characters. * * @example * vine.string().maxLength(100) */ export declare const maxLengthRule: (options: { max: number; }) => import("../../types.js").Validation<{ max: number; }>; /** * Enforces a fixed length on a string field. * The string must have exactly the specified number of characters. * * @example * vine.string().fixedLength(10) */ export declare const fixedLengthRule: (options: { size: number; }) => import("../../types.js").Validation<{ size: number; }>; /** * Ensures the value ends with the specified substring. * The comparison is case-sensitive. * * @example * vine.string().endsWith('.com') * vine.string().endsWith('_test') */ export declare const endsWithRule: (options: { substring: string; }) => import("../../types.js").Validation<{ substring: string; }>; /** * Ensures the value starts with the specified substring. * The comparison is case-sensitive. * * @example * vine.string().startsWith('https://') * vine.string().startsWith('prefix_') */ export declare const startsWithRule: (options: { substring: string; }) => import("../../types.js").Validation<{ substring: string; }>; /** * Ensures the field's value under validation is the same as the other field's value. * Useful for confirmation fields like password verification. * * @example * vine.string().sameAs('password') * vine.string().sameAs('email') */ export declare const sameAsRule: (options: { otherField: string; }) => import("../../types.js").Validation<{ otherField: string; }>; /** * Ensures the field's value under validation is different from another field's value. * Useful for ensuring new values differ from old ones (e.g., new password vs old password). * * @example * vine.string().notSameAs('oldPassword') * vine.string().notSameAs('previousEmail') */ export declare const notSameAsRule: (options: { otherField: string; }) => import("../../types.js").Validation<{ otherField: string; }>; /** * Ensures the field under validation is confirmed by having another field with the same name * (with "_confirmation" suffix by default). The values of both fields must match. * * @example * vine.string().confirmed() * vine.string().confirmed({ as: 'passwordConfirm' }) */ export declare const confirmedRule: (options?: { /** * @deprecated * Use "as" field instead */ confirmationField?: string; } | { as?: string; } | undefined) => import("../../types.js").Validation<{ /** * @deprecated * Use "as" field instead */ confirmationField?: string; } | { as?: string; } | undefined>; /** * Ensures the field's value under validation is one of the pre-defined choices. * Accepts a static array of choices or a function that returns choices dynamically. * * @example * vine.string().in(['red', 'green', 'blue']) * vine.string().in((field) => getUserRoles(field.meta.userId)) */ export declare const inRule: (options: { choices: string[] | ((field: FieldContext) => string[]); }) => import("../../types.js").Validation<{ choices: string[] | ((field: FieldContext) => string[]); }>; /** * Ensures the field's value under validation is not in the pre-defined list. * Accepts a static array or a function that returns disallowed values dynamically. * * @example * vine.string().notIn(['admin', 'root', 'system']) * vine.string().notIn((field) => getBlacklistedUsernames()) */ export declare const notInRule: (options: { list: string[] | ((field: FieldContext) => string[]); }) => import("../../types.js").Validation<{ list: string[] | ((field: FieldContext) => string[]); }>; /** * Validates the value to be a valid credit card number. * Optionally restricts validation to specific card providers. * * @example * vine.string().creditCard() * vine.string().creditCard({ provider: ['visa', 'mastercard'] }) * vine.string().creditCard({ provider: ['amex', 'discover'] }) */ export declare const creditCardRule: (options?: CreditCardOptions | ((field: FieldContext) => CreditCardOptions | void | undefined) | undefined) => import("../../types.js").Validation CreditCardOptions | void | undefined) | undefined>; /** * Validates the value to be a valid passport number for specified countries. * Requires country codes to determine the expected passport format. * * @example * vine.string().passport({ countryCode: ['US', 'GB', 'CA'] }) * vine.string().passport({ countryCode: ['FR', 'DE'] }) */ export declare const passportRule: (options: PassportOptions | ((field: FieldContext) => PassportOptions)) => import("../../types.js").Validation PassportOptions)>; /** * Validates the value to be a valid VAT (Value Added Tax) number for specified countries. * Requires country codes to determine the expected VAT format. * * @example * vine.string().vat({ countryCode: ['FR', 'CH', 'VE'] }) * vine.string().vat({ countryCode: ['GB', 'DE'] }) */ export declare const vatRule: (options: VATOptions | ((field: FieldContext) => VATOptions)) => import("../../types.js").Validation VATOptions)>; /** * Validates the value to be a valid postal code. * Optionally restricts validation to specific country codes. * * @example * vine.string().postalCode() * vine.string().postalCode({ countryCode: ['US', 'GB', 'CA'] }) * vine.string().postalCode({ countryCode: ['FR', 'DE'] }) */ export declare const postalCodeRule: (options?: PostalCodeOptions | ((field: FieldContext) => PostalCodeOptions | void | undefined) | undefined) => import("../../types.js").Validation PostalCodeOptions | void | undefined) | undefined>; /** * Validates the value to be a valid UUID (Universally Unique Identifier). * Optionally restricts validation to specific UUID versions. * * @example * vine.string().uuid() * vine.string().uuid({ version: [4] }) * vine.string().uuid({ version: [1, 4, 5] }) */ export declare const uuidRule: (options?: { version?: (1 | 2 | 3 | 4 | 5 | 6 | 7 | 8)[]; } | undefined) => import("../../types.js").Validation<{ version?: (1 | 2 | 3 | 4 | 5 | 6 | 7 | 8)[]; } | undefined>; /** * Validates the value to be a valid ULID (Universally Unique Lexicographically Sortable Identifier). * ULIDs are 26 characters long and sortable by time. * * @example * vine.string().ulid() */ export declare const ulidRule: (options?: undefined) => import("../../types.js").Validation; /** * Validates the value contains only ASCII characters (codes 0-127). * Rejects any characters outside the standard ASCII range. * * @example * vine.string().ascii() */ export declare const asciiRule: (options?: undefined) => import("../../types.js").Validation; /** * Validates the value to be a valid IBAN (International Bank Account Number). * Validates format, check digits, and country-specific patterns. * * @example * vine.string().iban() */ export declare const ibanRule: (options?: undefined) => import("../../types.js").Validation; /** * Validates the value to be a valid JWT (JSON Web Token). * Validates the token structure but does not verify the signature. * * @example * vine.string().jwt() */ export declare const jwtRule: (options?: undefined) => import("../../types.js").Validation; /** * Ensures the value is a string containing valid latitude and longitude coordinates. * Accepts format like "40.7128,-74.0060" (latitude,longitude). * * @example * vine.string().coordinates() */ export declare const coordinatesRule: (options?: undefined) => import("../../types.js").Validation; /** * Trims leading and trailing whitespace from the string value. * Mutates the field value by removing whitespace characters. * * @example * vine.string().trim() */ export declare const trimRule: (options?: undefined) => import("../../types.js").Validation; /** * Normalizes the email address by applying transformations. * Supports options like lowercasing and removing dots from Gmail addresses. * * @example * vine.string().email().normalizeEmail() * vine.string().email().normalizeEmail({ gmail_remove_dots: true }) */ export declare const normalizeEmailRule: (options?: import("validator").NormalizeEmailOptions | undefined) => import("../../types.js").Validation; /** * Converts the field value to UPPERCASE using locale-aware conversion. * Mutates the field value to uppercase. * * @example * vine.string().toUpperCase() * vine.string().toUpperCase('tr-TR') */ export declare const toUpperCaseRule: (options?: string | string[] | undefined) => import("../../types.js").Validation; /** * Converts the field value to lowercase using locale-aware conversion. * Mutates the field value to lowercase. * * @example * vine.string().toLowerCase() * vine.string().toLowerCase('tr-TR') */ export declare const toLowerCaseRule: (options?: string | string[] | undefined) => import("../../types.js").Validation; /** * Converts the field value to camelCase. * Transforms strings like "hello_world" to "helloWorld". * * @example * vine.string().toCamelCase() */ export declare const toCamelCaseRule: (options?: undefined) => import("../../types.js").Validation; /** * Escapes HTML entities in the string to prevent XSS attacks. * Converts characters like <, >, &, ", ' to their HTML entity equivalents. * * @example * vine.string().escape() */ export declare const escapeRule: (options?: undefined) => import("../../types.js").Validation; /** * Normalizes a URL by applying standardization rules. * Supports options like removing trailing slashes, sorting query parameters, and stripping default ports. * * @example * vine.string().url().normalizeUrl() * vine.string().url().normalizeUrl({ stripWWW: true }) * vine.string().url().normalizeUrl({ sortQueryParameters: true }) */ export declare const normalizeUrlRule: (options?: import("normalize-url").Options | undefined) => import("../../types.js").Validation;