import { LocalizedString, LocalizedStrings } from '@internationalized/string'; /** * Formatter interface that provides a clean API for accessing localized messages. * Similar to React Aria's LocalizedStringFormatter but adapted for Nimbus's message structure. */ export interface LocalizedStringFormatter { /** * Formats a localized message string. * * @param key - The message key to retrieve * @param args - Optional variables for message interpolation * @returns The formatted localized string, or empty string if not found * * @example * ```tsx * const msg = useLocalizedStringFormatter(alertMessagesStrings); * const label = msg.format("dismiss"); // Simple message * const labelWithVars = msg.format("avatarLabel", { fullName: "John Doe" }); // Variable message * ``` */ format(key: K, args?: Record): string; } /** * Provides localized string formatting for the current locale. Automatically updates when the locale changes. * * This hook is similar to React Aria's `useLocalizedStringFormatter` but adapted for Nimbus's * message dictionary structure with locale normalization. * * @param strings - A mapping of locales to localized strings by key (LocalizedStrings object) * @returns A formatter object with a `format` method for accessing localized messages * @throws Never throws - returns empty string on errors or missing messages * * @example * ```tsx * import { useLocalizedStringFormatter } from "@/hooks"; * import { alertMessagesStrings } from "./alert.messages"; * * export const AlertDismissButton = () => { * const msg = useLocalizedStringFormatter(alertMessagesStrings); * * return ( * * ); * }; * ``` * * @example * ```tsx * // With variables * const msg = useLocalizedStringFormatter(avatarMessagesStrings); * const label = msg.format("avatarLabel", { fullName: "John Doe" }); * ``` */ export declare function useLocalizedStringFormatter(strings: LocalizedStrings): LocalizedStringFormatter;