import { FieldError } from 'react-hook-form'; /** * Generates a consistent data-testid for field components. * Used by all adapter packages for test attribute generation. */ declare const GetFieldDataTestId: (fieldName: string, testId?: string) => string; /** * Appends "error" to a className when a field has a validation error. * Used by Fluent and MUI adapters for error styling. */ declare const FieldClassName: (className: string, error?: FieldError) => string; /** * Returns a field state string based on the current field props. * Used by headless adapter for data-state attributes. */ declare function getFieldState(props: { error?: FieldError; required?: boolean; readOnly?: boolean; disabled?: boolean; }): string | undefined; /** * Formats an ISO date string for display. * Returns short date (e.g. "Jan 15, 2024") or date+time (e.g. "Jan 15, 2024, 02:30 PM"). */ declare function formatDateTime(dateStr: string, options?: { hideTimestamp?: boolean; }): string; /** * Safely formats a value as a date+time string, falling back to String() on error. */ declare function formatDateTimeValue(value: unknown): string; /** * Formats a date range value for read-only display. * Returns "start – end", or just the one that exists. */ declare function formatDateRange(value: unknown): string; /** * Extracts display names from File or File[] values. */ declare function getFileNames(value: unknown): string; /** * Strips all non-digit characters from a string. */ declare function extractDigits(value: string): string; /** * Parses raw text-input content for a Number field. * * `Number("")` and `Number(" ")` are `0` in JavaScript, so a naive * `!isNaN(Number(raw))` check turns "user cleared the field" into the value 0. * This helper distinguishes the three cases adapters need: * * - empty / whitespace-only input → `null` (the field was cleared) * - unparseable input → `undefined` (ignore the keystroke, keep current value) * - otherwise → the parsed number */ declare function parseNumberInputValue(raw: string): number | null | undefined; /** * Formats a digit string as a phone number. * Supports US "(XXX) XXX-XXXX", international "+X XXX XXX XXXX", and raw digits. */ declare function formatPhone(digits: string, format: "us" | "international" | "raw"): string; /** * Truncates text with "..." if it exceeds maxChars. */ declare function ellipsifyText(value: string, maxChars: number): string; /** Default max file size in MB for FileUpload fields */ declare const MAX_FILE_SIZE_MB_DEFAULT = 10; /** Shared strings for DocumentLinks component */ declare const DocumentLinksStrings: { link: string; addLink: string; addAnotherLink: string; deleteLink: string; confirmDeleteLink: string; delete: string; cancel: string; saveChanges: string; save: string; }; /** * Shared field config interfaces used by adapter packages. * These define the shape of the `config` prop (IFieldProps.config) for specific field types. */ /** Config for Rating field */ interface IRatingConfig { max?: number; allowHalf?: boolean; } /** Config for DateRange field */ interface IDateRangeConfig { minDate?: string; maxDate?: string; } /** Value shape for DateRange field */ interface IDateRangeValue { start: string; end: string; } /** Config for DateTime field */ interface IDateTimeConfig { minDateTime?: string; maxDateTime?: string; } /** Config for FileUpload field */ interface IFileUploadConfig { multiple?: boolean; accept?: string; maxSizeMb?: number; } /** Config for PhoneInput field */ interface IPhoneInputConfig { format?: "us" | "international" | "raw"; } export { DocumentLinksStrings as D, FieldClassName as F, GetFieldDataTestId as G, type IDateRangeConfig as I, MAX_FILE_SIZE_MB_DEFAULT as M, type IDateRangeValue as a, type IDateTimeConfig as b, type IFileUploadConfig as c, type IPhoneInputConfig as d, type IRatingConfig as e, ellipsifyText as f, extractDigits as g, formatDateRange as h, formatDateTime as i, formatDateTimeValue as j, formatPhone as k, getFieldState as l, getFileNames as m, parseNumberInputValue as p };