UNPKG

@atlassian/wrm-react-i18n

Version:

An internationalization i18n helper for WRM and React that can be used in Atlassian Server products

14 lines (10 loc) 665 B
import * as react from 'react'; import { ReactElement } from 'react'; type SimpleArgType = string | number; type ArgType = ReactElement | SimpleArgType; type FormatReturnType<T extends ArgType[]> = T[number] extends SimpleArgType ? string : ReactElement; declare function format<T extends ArgType[]>(translation: string, ...args: T): FormatReturnType<T>; declare const I18n: { getText: <T extends ((string | number) | react.ReactElement<any, string | react.JSXElementConstructor<any>>)[]>(key: string, ...args: T) => T[number] extends string | number ? string : react.ReactElement<any, string | react.JSXElementConstructor<any>>; }; export { I18n, format };