import { default as dayjs } from 'dayjs'; import * as Yup from 'yup'; export interface DateValidationOptions { allowPast?: boolean; allowToday?: boolean; allowFuture?: boolean; requiredMessage?: string; pastDateMessage?: string; futureDateMessage?: string; todayNotAllowedMessage?: string; invalidDateMessage?: string; checkTime?: boolean; pastTimeMessage?: string; } declare const DEFAULT_MESSAGES: { required: string; invalidDate: string; pastDate: string; futureDate: string; todayNotAllowed: string; pastTime: string; }; /** * Global date validation function with full customization * @param options Configuration options for date validation * @returns Yup validation schema */ export declare const createDateValidation: (options?: DateValidationOptions) => Yup.MixedSchema<{}, Yup.AnyObject, undefined, "">; /** * Quick preset validation functions for common use cases */ export declare const dateValidation: (requiredMessage?: string, options?: DateValidationOptions) => Yup.MixedSchema<{}, Yup.AnyObject, undefined, "">; export declare const futureDateValidation: (requiredMessage?: string) => Yup.MixedSchema<{}, Yup.AnyObject, undefined, "">; export declare const anyDateValidation: (requiredMessage?: string) => Yup.MixedSchema<{}, Yup.AnyObject, undefined, "">; export declare const pastDateValidation: (requiredMessage?: string) => Yup.MixedSchema<{}, Yup.AnyObject, undefined, "">; export declare const dateTimeValidation: (requiredMessage?: string) => Yup.MixedSchema<{}, Yup.AnyObject, undefined, "">; export declare const businessDateValidation: (requiredMessage?: string) => Yup.MixedSchema<{}, Yup.AnyObject, undefined, "">; export declare const dateRangeValidation: (minDate: dayjs.Dayjs | Date | string, maxDate: dayjs.Dayjs | Date | string, requiredMessage?: string) => Yup.MixedSchema<{}, Yup.AnyObject, undefined, "">; /** * Utility function to create custom validation messages */ export declare const createCustomMessages: (overrides: Partial) => { required: string; invalidDate: string; pastDate: string; futureDate: string; todayNotAllowed: string; pastTime: string; }; /** * Helper function for conditional date validation * Example: Date required only if another field has a specific value */ export declare const conditionalDateValidation: (condition: (formValues: any) => boolean, validationSchema: any) => Yup.MixedSchema<{}, Yup.AnyObject, undefined, "">; export declare const COMMON_DATE_VALIDATIONS: { rental: (msg?: string) => Yup.MixedSchema<{}, Yup.AnyObject, undefined, "">; }; export {}; /** * Usage Examples: * * // Basic usage with custom required message * date: dateValidation('Please select a valid date') * * // Full customization * date: createDateValidation({ * allowPast: false, * allowToday: true, * allowFuture: true, * requiredMessage: 'Date is required', * pastDateMessage: 'Cannot select past dates' * }) * * // Preset validations * rentalDate: COMMON_DATE_VALIDATIONS.rental('Rental date is required') * bookingDate: COMMON_DATE_VALIDATIONS.booking() * * // Date range * eventDate: dateRangeValidation( * dayjs().add(1, 'day'), * dayjs().add(1, 'year'), * 'Event date is required' * ) */