From f4fd7f5b9960ed58cc27fa58ce4ffdc919982612 Mon Sep 17 00:00:00 2001 From: Christian Kaisermann Date: Thu, 23 Jan 2020 10:43:15 -0300 Subject: [PATCH] =?UTF-8?q?chore:=20=F0=9F=A4=96=20fix=20crazy=20types=20c?= =?UTF-8?q?onflict?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/runtime/types/index.ts | 41 ++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/src/runtime/types/index.ts b/src/runtime/types/index.ts index ad0aace..90dcdb4 100644 --- a/src/runtime/types/index.ts +++ b/src/runtime/types/index.ts @@ -14,9 +14,25 @@ export interface MessageObject { values?: Record } -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 +) => string + +export type DateFormatter = ( + d: Date | number, + options?: IntlFormatterOptions +) => string + +export type NumberFormatter = ( + d: number, + options?: IntlFormatterOptions +) => string type IntlFormatterOptions = T & { format?: string @@ -27,25 +43,6 @@ export interface MemoizedIntlFormatter { (options?: IntlFormatterOptions): T } -export interface Formatter extends FormatterFn { - time: ( - d: Date | number, - options?: IntlFormatterOptions - ) => string - date: ( - d: Date | number, - options?: IntlFormatterOptions - ) => string - number: ( - d: number, - options?: IntlFormatterOptions - ) => string - capital: FormatterFn - title: FormatterFn - upper: FormatterFn - lower: FormatterFn -} - export interface MessagesLoader { (): Promise }