Skip to content

Commit

Permalink
@types: Fixed too narrow option types in n() and d() methods (#1096)
Browse files Browse the repository at this point in the history
* Added overload to fix typings in n() and d() methods

* Fixed argument type in d()
  • Loading branch information
gehlert committed Jan 8, 2021
1 parent e040f80 commit 706ffe0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions types/index.d.ts
Expand Up @@ -184,8 +184,10 @@ export declare interface IVueI18n {
locale?: VueI18n.Locale,
): VueI18n.DateTimeFormatResult;
d(value: number | Date, args?: { [key: string]: string }): VueI18n.DateTimeFormatResult;
d(value: number | Date, options?: VueI18n.DateTimeFormatOptions): VueI18n.DateTimeFormatResult;
n(value: number, key?: VueI18n.Path, locale?: VueI18n.Locale): VueI18n.NumberFormatResult;
n(value: number, args?: { [key: string]: string }): VueI18n.NumberFormatResult;
n(value: number, options?: VueI18n.NumberFormatOptions): VueI18n.NumberFormatResult;
getLocaleMessage(locale: VueI18n.Locale): VueI18n.LocaleMessageObject;
setLocaleMessage(locale: VueI18n.Locale, message: VueI18n.LocaleMessageObject): void;
mergeLocaleMessage(locale: VueI18n.Locale, message: VueI18n.LocaleMessageObject): void;
Expand Down Expand Up @@ -225,8 +227,10 @@ declare class VueI18n {
te(key: VueI18n.Path, locale?: VueI18n.Locale): boolean;
d(value: number | Date, key?: VueI18n.Path, locale?: VueI18n.Locale): VueI18n.DateTimeFormatResult;
d(value: number | Date, args?: { [key: string]: string }): VueI18n.DateTimeFormatResult;
d(value: number | Date, options?: VueI18n.DateTimeFormatOptions): VueI18n.DateTimeFormatResult;
n(value: number, key?: VueI18n.Path, locale?: VueI18n.Locale): VueI18n.NumberFormatResult;
n(value: number, args?: { [key: string]: string }): VueI18n.NumberFormatResult;
n(value: number, options?: VueI18n.NumberFormatOptions): VueI18n.NumberFormatResult;

getLocaleMessage(locale: VueI18n.Locale): VueI18n.LocaleMessageObject;
setLocaleMessage(locale: VueI18n.Locale, message: VueI18n.LocaleMessageObject): void;
Expand Down

0 comments on commit 706ffe0

Please sign in to comment.