mirror of
https://github.com/cupcakearmy/svelte-i18n.git
synced 2024-11-16 18:10:43 +01:00
chore: 🤖 fix crazy types conflict
This commit is contained in:
parent
a790069da2
commit
f4fd7f5b99
@ -14,9 +14,25 @@ export interface MessageObject {
|
||||
values?: Record<string, string | number | Date>
|
||||
}
|
||||
|
||||
interface FormatterFn {
|
||||
(id: string | MessageObject, options?: MessageObject): string
|
||||
}
|
||||
export type MessageFormatter = (
|
||||
id: string | MessageObject,
|
||||
options?: MessageObject
|
||||
) => string
|
||||
|
||||
export type TimeFormatter = (
|
||||
d: Date | number,
|
||||
options?: IntlFormatterOptions<Intl.DateTimeFormatOptions>
|
||||
) => string
|
||||
|
||||
export type DateFormatter = (
|
||||
d: Date | number,
|
||||
options?: IntlFormatterOptions<Intl.DateTimeFormatOptions>
|
||||
) => string
|
||||
|
||||
export type NumberFormatter = (
|
||||
d: number,
|
||||
options?: IntlFormatterOptions<Intl.NumberFormatOptions>
|
||||
) => string
|
||||
|
||||
type IntlFormatterOptions<T> = T & {
|
||||
format?: string
|
||||
@ -27,25 +43,6 @@ export interface MemoizedIntlFormatter<T, U> {
|
||||
(options?: IntlFormatterOptions<U>): T
|
||||
}
|
||||
|
||||
export interface Formatter extends FormatterFn {
|
||||
time: (
|
||||
d: Date | number,
|
||||
options?: IntlFormatterOptions<Intl.DateTimeFormatOptions>
|
||||
) => string
|
||||
date: (
|
||||
d: Date | number,
|
||||
options?: IntlFormatterOptions<Intl.DateTimeFormatOptions>
|
||||
) => string
|
||||
number: (
|
||||
d: number,
|
||||
options?: IntlFormatterOptions<Intl.NumberFormatOptions>
|
||||
) => string
|
||||
capital: FormatterFn
|
||||
title: FormatterFn
|
||||
upper: FormatterFn
|
||||
lower: FormatterFn
|
||||
}
|
||||
|
||||
export interface MessagesLoader {
|
||||
(): Promise<any>
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user