mirror of
https://github.com/cupcakearmy/svelte-i18n.git
synced 2024-11-16 18:10:43 +01: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 {
|
||||
[key: string]: LocaleDictionary | string | Array<string | LocaleDictionary>;
|
||||
@ -8,12 +8,25 @@ export type LocalesDictionary = {
|
||||
[key: string]: LocaleDictionary;
|
||||
};
|
||||
|
||||
export type InterpolationValues =
|
||||
| Record<
|
||||
string,
|
||||
| string
|
||||
| number
|
||||
| boolean
|
||||
| Date
|
||||
| FormatXMLElementFn<unknown>
|
||||
| null
|
||||
| undefined
|
||||
>
|
||||
| undefined;
|
||||
|
||||
export interface MessageObject {
|
||||
id?: string;
|
||||
locale?: string;
|
||||
format?: string;
|
||||
default?: string;
|
||||
values?: Record<string, string | number | Date>;
|
||||
values?: InterpolationValues;
|
||||
}
|
||||
|
||||
export type MessageFormatter = (
|
||||
|
Loading…
Reference in New Issue
Block a user