@atlaskit/mention
Version:
A React component used to display user profiles in a list for 'Mention' functionality
30 lines (29 loc) • 1.21 kB
TypeScript
import React from 'react';
import { type MessageDescriptor } from 'react-intl-next';
export type Formatter = (props: {
values?: {
[k: string]: string;
};
children?(props: string): React.ReactElement;
}) => React.ReactElement | null;
type FormatterFactory = (messageDescriptor: MessageDescriptor) => Formatter;
export declare const propFormatter: FormatterFactory;
export declare const UnknownUserError: Formatter;
export declare const NoAccessWarning: Formatter;
export declare const NoAccessLabel: Formatter;
export declare const DefaultHeadline: Formatter;
export declare const DefaultAdvisedAction: Formatter;
export declare const LoginAgain: Formatter;
export declare const DifferentText: Formatter;
/**
* Tries to get the most specific messages bundle for a given locale.
*
* Strategy:
* 1. Try to find messages with the exact string (i.e. 'fr_FR')
* 2. If that doesn't work, try to find messages for the country locale (i.e. 'fr')
* 3. If that doesn't work, return english messages as a fallback.
*
* @param locale string specifying the locale like 'en_GB', or 'fr'.
*/
export declare const getMessagesForLocale: (locale: string) => Promise<Record<string, string>>;
export {};