mirror of
https://github.com/cupcakearmy/svelte-i18n.git
synced 2024-09-28 15:14:45 +02:00
fix: 🐛 types from v3 branch leaking to master branch 🤷
This commit is contained in:
parent
bb6dd01558
commit
88f7762e96
@ -14,25 +14,9 @@ export interface MessageObject {
|
|||||||
values?: Record<string, string | number | Date>
|
values?: Record<string, string | number | Date>
|
||||||
}
|
}
|
||||||
|
|
||||||
export type MessageFormatter = (
|
interface FormatterFn {
|
||||||
id: string | MessageObject,
|
(id: string | MessageObject, options?: MessageObject): string
|
||||||
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 & {
|
type IntlFormatterOptions<T> = T & {
|
||||||
format?: string
|
format?: string
|
||||||
@ -43,6 +27,25 @@ export interface MemoizedIntlFormatter<T, U> {
|
|||||||
(options?: IntlFormatterOptions<U>): T
|
(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 {
|
export interface MessagesLoader {
|
||||||
(): Promise<any>
|
(): Promise<any>
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user