import { DateFormatDescriptor } from "../types"; /** * Parse a date format string into a descriptor. * Supported tokens: `dd`, `MM`, `yyyy`. * Separator is auto-detected from the first non-alphanumeric character. * * @example parseFormat("dd.MM.yyyy") => { separator: ".", parts: [...] } */ export declare const parseFormat: (format: string) => DateFormatDescriptor; /** * Get the placeholder string for the format. * @example getPlaceholder({ separator: ".", parts: [...] }) => "dd.MM.yyyy" */ export declare const getPlaceholder: (desc: DateFormatDescriptor) => string; /** * Get total length of the formatted string. */ export declare const getFormatLength: (desc: DateFormatDescriptor) => number; /** * Format a Date object into a string according to the descriptor. */ export declare const formatDate: (date: Date, desc: DateFormatDescriptor) => string; /** * Try to parse a formatted string into a Date. * Returns `undefined` if the string is incomplete or invalid. */ export declare const parseDate: (text: string, desc: DateFormatDescriptor) => Date | undefined; /** * Validate and constrain a single character being typed at a given position. * Returns the character if valid, or empty string if rejected. * * @param char The character being typed * @param position The 0-based position in the formatted string * @param currentText The current text value * @param desc The format descriptor */ export declare const validateCharAtPosition: (char: string, position: number, currentText: string, desc: DateFormatDescriptor) => string; //# sourceMappingURL=index.d.ts.map