mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-24 20:26:24 +00:00
ICU types
This commit is contained in:
@@ -4,6 +4,10 @@
|
||||
import type { IntlShape } from 'react-intl';
|
||||
import type { AciString } from './ServiceId';
|
||||
import type { LocaleDirection } from '../../app/locale';
|
||||
import type {
|
||||
ICUJSXMessageParamsByKeyType,
|
||||
ICUStringMessageParamsByKeyType,
|
||||
} from '../../build/ICUMessageParams.d';
|
||||
|
||||
import type { HourCyclePreference, LocaleMessagesType } from './I18N';
|
||||
|
||||
@@ -17,12 +21,15 @@ export type RenderTextCallbackType = (options: {
|
||||
key: number;
|
||||
}) => JSX.Element | string;
|
||||
|
||||
export type ReplacementValuesType = {
|
||||
[key: string]: string | number | undefined;
|
||||
};
|
||||
export { ICUJSXMessageParamsByKeyType, ICUStringMessageParamsByKeyType };
|
||||
|
||||
export type LocalizerType = {
|
||||
(key: string, values?: ReplacementValuesType): string;
|
||||
<Key extends keyof ICUStringMessageParamsByKeyType>(
|
||||
key: Key,
|
||||
...values: ICUStringMessageParamsByKeyType[Key] extends undefined
|
||||
? [undefined?]
|
||||
: [ICUStringMessageParamsByKeyType[Key]]
|
||||
): string;
|
||||
getIntl(): IntlShape;
|
||||
getLocale(): string;
|
||||
getLocaleMessages(): LocaleMessagesType;
|
||||
|
||||
Reference in New Issue
Block a user