mirror of
https://github.com/cupcakearmy/svelte-i18n.git
synced 2024-06-30 18:54:49 +02:00
fix: 🐛 possible interpolation value types
This commit is contained in:
parent
6d768b9ae9
commit
0caaead478
|
@ -1,4 +1,4 @@
|
||||||
import { Formats } from 'intl-messageformat';
|
import type { FormatXMLElementFn, Formats } from 'intl-messageformat';
|
||||||
|
|
||||||
export interface LocaleDictionary {
|
export interface LocaleDictionary {
|
||||||
[key: string]: LocaleDictionary | string | Array<string | LocaleDictionary>;
|
[key: string]: LocaleDictionary | string | Array<string | LocaleDictionary>;
|
||||||
|
@ -8,12 +8,25 @@ export type LocalesDictionary = {
|
||||||
[key: string]: LocaleDictionary;
|
[key: string]: LocaleDictionary;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export type InterpolationValues =
|
||||||
|
| Record<
|
||||||
|
string,
|
||||||
|
| string
|
||||||
|
| number
|
||||||
|
| boolean
|
||||||
|
| Date
|
||||||
|
| FormatXMLElementFn<unknown>
|
||||||
|
| null
|
||||||
|
| undefined
|
||||||
|
>
|
||||||
|
| undefined;
|
||||||
|
|
||||||
export interface MessageObject {
|
export interface MessageObject {
|
||||||
id?: string;
|
id?: string;
|
||||||
locale?: string;
|
locale?: string;
|
||||||
format?: string;
|
format?: string;
|
||||||
default?: string;
|
default?: string;
|
||||||
values?: Record<string, string | number | Date>;
|
values?: InterpolationValues;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type MessageFormatter = (
|
export type MessageFormatter = (
|
||||||
|
|
Loading…
Reference in New Issue
Block a user