import { DateSchema, KnownKeys, ParentContextFunction, Schema, TupleSchema } from '@lightweightform/storage'; /** * Default issue code emitted for invalid date-ranges (where the start date is * after the end date). */ export declare const INVALID_DATE_RANGE_CODE = "LF_INVALID_DATE_RANGE"; /** * Type of issue emitted for invalid date-ranges. */ export declare const INVALID_DATE_RANGE_TYPE = "invalidDateRange"; /** * Date-range schema. */ export interface DateRangeSchema extends TupleSchema<[Date, Date], [DateSchema, DateSchema]> { /** * Skip adding validations (needed when using a date-range within a computed * value). */ skipValidations?: boolean; /** * Issue code to indicate that the date-range is invalid (where the start date * is after the end date). */ invalidDateRangeCode?: string; /** * Minimum date that the date-range represented by this schema is allowed to * have. */ minDate?: Date | ParentContextFunction; /** * String to use as issue code when the date-range's start date is less than * the minimum allowed date. Defaults to `DATE_OUT_OF_BOUNDS_CODE`. */ minDateCode?: string; /** * Maximum date that the date-range represented by this schema is allowed to * have. */ maxDate?: Date | ParentContextFunction; /** * String to use as issue code when the date-range's end date is greater than * the maximum allowed date. Defaults to `DATE_OUT_OF_BOUNDS_CODE`. */ maxDateCode?: string; /** * Options to construct the start date schema with. */ startDateOptions?: Pick, 'type' | 'minDate' | 'minDateCode' | 'maxDate' | 'maxDateCode'>> & { [extraProperties: string]: any; }; /** * Options to construct the end date schema with. */ endDateOptions?: Pick, 'type' | 'minDate' | 'minDateCode' | 'maxDate' | 'maxDateCode'>> & { [extraProperties: string]: any; }; } /** * Options used to create a new date-range schema. */ export declare type DateRangeSchemaOptions = Pick, 'type' | 'elementsSchemas'>> & { [extraProperties: string]: any; }; /** * Creates a new date-range schema object. * @param options Options used to create the schema. * @returns Date-range schema. */ export declare function dateRangeSchema(options?: DateRangeSchemaOptions): DateRangeSchema; /** * Returns whether a given schema is a date-range schema. * @param schema Schema to check. * @returns `true` when the provided schema is a date-range schema. */ export declare function isDateRangeSchema(schema: Schema): schema is DateRangeSchema;