/** * UDP Shared Helpers — single source of truth for utility functions. * * Used by both frontend and backend. * * @module udp-schema/helpers */ /** * Calculate age from an ISO date string (YYYY-MM-DD or Date-parseable). * * @returns Age in years, or null if invalid. */ export declare function calcAge(dob: string | Date | undefined | null): number | null; /** * Check if a field should be visible based on its `conditionalOn` rule. * * Looks up the field's metadata from profile-fields. If it has a `conditionalOn` * property, checks if the controlling field's current value is in the allowed list. * * @param fieldKey - The field to check visibility for * @param form - Current form data (flat key-value object) * @returns true if the field should be shown (no condition, or condition met) */ export declare function isFieldVisible(fieldKey: string, form: Record): boolean; /** * Resolve a single-select field's current value to its display label. * * Uses getFieldOptions() from profile-fields for O(1) option lookup. * Falls back to the raw value if no option found. * * @param fieldKey - The field key (e.g., "gender", "familyReligion") * @param value - The current value (e.g., "man", "hindu") * @returns Display label string, or undefined if no value */ export declare function labelFor(fieldKey: string, value: unknown): string | undefined; /** * Resolve a multi-select field's current values to display labels. * * @param fieldKey - The field key * @param values - Array of selected values * @returns Array of display labels, or undefined if empty */ export declare function labelsFor(fieldKey: string, values: unknown): string[] | undefined; //# sourceMappingURL=helpers.d.ts.map