Skip to content

Commit

Permalink
⚡improvement(types): remove duplicate type definitions
Browse files Browse the repository at this point in the history
Replace Number and Date format options with standard TS `Intl` types.
  • Loading branch information
Raiondesu committed Dec 14, 2018
1 parent 43e02cc commit 286bc2e
Showing 1 changed file with 5 additions and 32 deletions.
37 changes: 5 additions & 32 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,39 +10,12 @@ declare namespace VueI18n {
interface LocaleMessageArray { [index: number]: LocaleMessage; }
interface LocaleMessages { [key: string]: LocaleMessageObject; }
type TranslateResult = string | LocaleMessages;
interface DateTimeFormatOptions {
year?: string;
month?: string;
day?: string;
hour?: string;
minute?: string;
second?: string;
weekday?: string;
hour12?: boolean;
era?: string;
timeZone?: string;
timeZoneName?: string;
localeMatcher?: string;
formatMatcher?: string;
}
interface DateTimeFormat { [key: string]: DateTimeFormatOptions; }
interface DateTimeFormats { [key: string]: DateTimeFormat; }

interface DateTimeFormat { [type: string]: Intl.DateTimeFormatOptions; }
interface DateTimeFormats { [lang: string]: DateTimeFormat; }
type DateTimeFormatResult = string;
interface NumberFormatOptions {
style?: string;
currency?: string;
currencyDisplay?: string;
useGrouping?: boolean;
minimumIntegerDigits?: number;
minimumFractionDigits?: number;
maximumFractionDigits?: number;
minimumSignificantDigits?: number;
maximumSignificantDigits?: number;
localeMatcher?: string;
formatMatcher?: string;
}
interface NumberFormat { [key: string]: NumberFormatOptions; }
interface NumberFormats { [key: string]: NumberFormat; }
interface NumberFormat { [type: string]: Intl.NumberFormatOptions; }
interface NumberFormats { [lang: string]: NumberFormat; }
type NumberFormatResult = string;

interface Formatter {
Expand Down

0 comments on commit 286bc2e

Please sign in to comment.