import React from 'react'; import { I18nFormatArgTypes } from './messages-types'; export type CustomHandler = (formatFn: (args: FormatFnArgs) => string) => ReturnValue; export interface FormatFunction { (namespace: string, component: string, key: string, provided: string): string; (namespace: string, component: string, key: string, provided: string | undefined): string | undefined; (namespace: string, component: string, key: string, provided: T, handler?: CustomHandler): T; } interface InternalI18nContextProps { locale: string | null; format: FormatFunction; } export declare const namespace = "cloudscape-design-components"; export declare const InternalI18nContext: React.Context; export declare function useLocale(): string | null; /** * Utility to get "keyof T" but exclude number or symbol types. * TypeScript allows those types because JS implicitly casts them to string. */ type StringKeyOf = Extract; export interface ComponentFormatFunction> { >(key: MessageKey, provided: string, handler?: CustomHandler): string; >(key: MessageKey, provided: string | undefined, handler?: CustomHandler): string | undefined; , ReturnValue>(key: MessageKey, provided: ReturnValue, handler: I18nFormatArgTypes[ComponentName][MessageKey] extends never ? never : CustomHandler): ReturnValue; } export declare function useInternalI18n>(componentName: ComponentName): ComponentFormatFunction; export {};