Skip to content

Commit

Permalink
⭐ new(typescript): Allow module augmentation (#273) by @CKGrafico
Browse files Browse the repository at this point in the history
* Allow type augmentation

* Update index.d.ts
  • Loading branch information
CKGrafico authored and kazupon committed Jan 10, 2018
1 parent 51bfca3 commit 4371344
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,18 @@ declare namespace VueI18n {
}
}

export declare interface IVueI18n {
readonly messages: VueI18n.LocaleMessages;
readonly dateTimeFormats: VueI18n.DateTimeFormats;
readonly numberFormats: VueI18n.NumberFormats;

locale: VueI18n.Locale;
fallbackLocale: VueI18n.Locale;
missing: VueI18n.MissingHandler;
formatter: VueI18n.Formatter;
silentTranslationWarn: boolean;
}

declare class VueI18n {
constructor(options?: VueI18n.I18nOptions)

Expand Down Expand Up @@ -113,7 +125,7 @@ declare class VueI18n {

declare module 'vue/types/vue' {
interface Vue {
readonly $i18n: VueI18n;
readonly $i18n: VueI18n & IVueI18n;
$t: typeof VueI18n.prototype.t;
$tc: typeof VueI18n.prototype.tc;
$te: typeof VueI18n.prototype.te;
Expand Down

0 comments on commit 4371344

Please sign in to comment.