import type { Address } from '../../../../common/shared/models/Address'; import type { FrankieSelectOptions } from '../types/form'; import type { Path } from 'react-hook-form'; type FormateDateParamsType = { dateString: string; fromFormat?: 'dd-MM-yyyy' | 'yyyy-MM-dd'; toFormat?: 'dd LLL yyyy'; }; export declare const getUniqueList: (combinedList: DType[], key: keyof DType, customizer?: (value: DType, srcValue: DType, key: string) => DType) => DType[]; export declare const replaceIfExistInList: (str: string | undefined, words: string[], replaceIndex: number) => string; export declare const replaceCharInString: (str: string, char: string, replaceChar: string) => string; export declare const changeWordFromString: (string: string, words: string[], newValue?: string) => string; export declare const getAllPaths: >(obj: oType, parentPath?: string) => Path[]; export declare const toTitleCase: (str: string) => string; export declare const capitaliseWords: ([first, ...rest]: string[]) => string; export declare const getReadableDocType: (docType: string) => string; export type AllCountries = 'AUS' | 'NZL' | 'USA' | 'CAN' | 'GBR' | 'IND' | 'SGP' | 'ITA' | 'MEX'; /** * Returns the administrative subdivisions (states/provinces) for a country as * select options, sorted by label. Returns [] when the country has no registry * data — callers decide whether to hide the field (see hasSubdivisions). * An empty string is treated as no country and returns []. */ export declare const getSubdivisions: (country?: string | null) => FrankieSelectOptions[]; /** True when the country has subdivision data in the registry. */ export declare const hasSubdivisions: (country?: string | null) => boolean; /** * Countries introduced by the localisation epic (FDEL-50642). These are the ONLY * countries gated off when localisation is disabled. Pre-epic baseline countries * (AUS, NZL, …) always keep their per-country config — their review-screen * treatment is core, not localisation. Add a country here when its localisation * ships so the master switch can revert it. * * IND is gated: its address config + Aadhaar national ID are localisation * (FDEL-50981). Note this also gates India's pre-epic passport block (File * Number) off when localisation is disabled. */ export declare const LOCALISATION_COUNTRIES: Set; /** * Localisation gate for country-driven review-screen behaviour (FDEL-51545). * When localisation is off, a localisation-epic country resolves to undefined so * its per-country fields/subdivisions fall back to default; every other country * (baseline or unknown) passes through unchanged. */ export declare const gateLocalisedCountry: (country: string | null | undefined, localisationEnabled: boolean) => string | null | undefined; /** * @deprecated Back-compat alias for getSubdivisions; defaults to AUS so existing * no-arg / AUS callers are unaffected. Prefer getSubdivisions in new code. * Retained for legacy callers (IdSelection, manual-flow config) that only * needed AUS; new code should prefer getSubdivisions. */ export declare const getStates: (country?: string) => FrankieSelectOptions[]; /** * Country-aware transform for the residential `address.state` manual field: * sets its options from the registry and hides it when the country has no * subdivisions. Non-address.state fields are returned unchanged. */ export declare const applyAddressStateSubdivisions: (field: F, country?: string | null) => F; export declare const getFormateDate: (date: string | null, isReversed?: boolean) => string | undefined; export declare const getAllCountries: () => FrankieSelectOptions[]; export declare const nationalHealthIdOptions: { label: string; value: string; }[]; export declare const getFullAddress: (addr: Address) => string; export declare const isStreetNumber: (value?: string | null) => boolean; export declare const getStreetInfo: (data: GType, type: KType) => { streetNumber: string | undefined; streetName: string; } | { streetNumber?: undefined; streetName?: undefined; }; export declare const fullAddressToStreetInfo: (fullAddress: string) => { streetNumber: string; streetName: string; streetAddress: string; remainingInfo: string; } | null; /** * Splits the provider's verbatim OCR address lines — `ocr_scanned_address_1` * through `_5` — into structured address parts. * * The lines are whatever the document printed, so they are only reliably * positional from the *back*: the last line carries locality + state + * postcode, and everything before it is the street. Reading from the front is a * guess — line 1 is the unit on one licence and the street on the next. * * Parsing the flattened `ocr_scanned_address_long` instead is what buried the * suburb, state and postcode inside streetName: the connector builds that field * by space-joining these same lines, and `fullAddressToStreetInfo` splits on * commas which are by then no longer present. (FDEL-53730) */ export declare const ocrAddressLinesToParts: (lines: (string | null | undefined)[], stateCodes?: string[]) => { unitNumber: string; streetNumber: string; streetName: string; suburb: string; state: string; postalCode: string; } | null; export declare const checkObjectEditable: (data: CData, fallbackCheck?: keyof CData | string) => boolean | null; /** * * @param dateString date in string * @returns formatted date * @example formatDate('19-10-1994') => '19 Oct 1994' */ export declare function formatDate({ dateString, fromFormat, toFormat, }: FormateDateParamsType): string; export declare function rearrangeData(config: { source: T[]; destination: T[]; key: keyof T; }): T[]; /** * Returns a list of unique objects based on the specified key. * * @template DType - The type of the objects in the list. * @param {DType[]} data - The list of objects. * @param {keyof DType} key - The key to determine uniqueness. * @returns {DType[]} - The list of unique objects. */ export declare function sortData(config: { data: T[]; sequence: T[keyof T][]; key: keyof T; }): T[]; /** * Flattens a nested object into a flat object with dot-notation keys. * Used when saving form data to individual's extraData. * * @example * flattenExtraData({ idv: { job_title: "Engineer" } }) * // Returns: { "idv.job_title": "Engineer" } */ export declare const flattenExtraData: (obj: Record, prefix?: string) => Record; /** * Unflattens a flat object with dot-notation keys into a nested object. * Used when loading extraData from individual to populate react-hook-form. * * @example * unflattenExtraData({ "idv.job_title": "Engineer" }) * // Returns: { idv: { job_title: "Engineer" } } */ export declare const unflattenExtraData: (flat: Record) => Record>; export {}; //# sourceMappingURL=object.util.d.ts.map