/** * Derives a locale-aware date format string suitable for use in input masks. This helper exposes the internal AuroInputUtilities locale logic in a simple function form. * * @param {string} locale - BCP 47 language tag used to determine the date format (e.g. "en-US", "fr-FR"). * @returns {string} A lowercase date format mask string corresponding to the provided locale. */ export function getDateFormatFromLocale(locale: string): string; export class AuroInputUtilities { /** * Creates an instance of AuroInputUtilities. * @param {object} config - Configuration object for the utilities. * @param {string} config.locale - BCP 47 language tag (e.g. "en-US", "fr-FR", "ja-JP"). * @param {string} config.format - Optional Date format override string. */ constructor(config?: { locale: string; format: string; }); locale: string; overrideFormat: string; formatter: Intl.DateTimeFormat; /** * Generates a date mask based on the provided locale. * @param {string} [locale] - BCP 47 language tag (e.g. "en-US", "fr-FR", "ja-JP"). * @returns {string} */ getDateMaskFromLocale(locale?: string): string; /** * Parses a date string using the provided mask. * @private * @param {string} dateString - The date string to parse. * @param {string} mask - The date mask to use for parsing. * @returns {string} */ private parseDateByMask; /** * Configures the mask to be used on the input element based on format and/or type. * IMask tool documentation: https://imask.js.org/. * @private * @param {string} type - The input type. * @param {string} format - The format of the mask to apply. * @returns {object} - The mask options object. */ private getMaskOptions; /** * Updates the date format override. * @param {string} newFormat - New date format string. * @returns {void} */ updateFormat(newFormat: string): void; /** * Converts an IMask-style date mask to a date-fns compatible format string. * @param {string} mask - IMask date mask (e.g. "MM/DD/YYYY"). * @returns {string} A date-fns format string (e.g. "MM/dd/yyyy"). */ toDateFnsMask(mask: string): string; /** * Determines if the given type and format combination represents a full year/month/day date. * @private * @param {string} type - The input type. * @param {string} format - The date format string. * @returns {boolean} */ private isFullDateFormat; /** * Validates a value against a partial date format (one that lacks yy/mm/dd all three). * Day- and year-only formats (dd/yy/yyyy) are checked as integer ranges; other partial formats use * a date-fns parse + round-trip to confirm both validity and exact formatting. * @param {string} value - The user-facing display value. * @param {string} format - The partial date format string (e.g. "mm/yyyy", "yyyy", "dd"). * @returns {boolean} */ isValidPartialDate(value: string, format: string): boolean; /** * Converts a display string to its model value. * For full date formats, converts the display string to an ISO date string. * @private * @param {string} inputValue - String from the rendered input. * @param {string} format - The date format string. * @returns {string} */ private toModelValue; /** * Converts a model value to a display value for the input element. * For full date formats, converts an ISO model value to the configured display format. * @private * @param {Date|undefined} valueObject - Date object representation of value. * @param {string} format - The date format string. * @returns {string | undefined} */ private toFormattedValue; }