import { FormatXMLElementFn, PrimitiveType } from 'intl-messageformat'; import { default as React } from 'react'; type MessageValues> = Record; export interface DynamicFormattedMessageProps { description: string | object; /** * The dynamic message to interpolate/evaluate, typically coming from some source * of user input (like WYSIWYG content) or other injected configuration. */ defaultMessage: string; values?: MessageValues; /** * Treat the message as HTML, sanitizing and pre-processing for rich text display. */ asHtml?: boolean; } /** * A custom implementation of the react-intl `FormattedMessage` for dynamically defined * messages. * * The react-intl `FormattedMessage` (and `useIntl().formatMessage`, for that matter), * don't allow dynamic messages, as they require the messages to be statically * evaluable https://github.com/formatjs/babel-plugin-react-intl/issues/119. * This custom implementation bypasses the evaluation, allowing dynamic messages. * * For rendering translations, you should use `FormattedMessage` or * `useIntl().formatMessage`. DynamicFormattedMessage should only be used for more * dynamic situations, like rendering rich text. */ declare const DynamicFormattedMessage: React.FC; export default DynamicFormattedMessage;