UNPKG

@atlassian/wrm-react-i18n

Version:

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

15 lines (11 loc) 721 B
/// <reference types="react" /> import * as react from 'react'; import { ReactElement } from 'react'; declare type SimpleArgType = string | number; declare type ArgType = ReactElement | SimpleArgType; declare 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 };