Skip to content
This repository was archived by the owner on Dec 31, 2024. It is now read-only.

Commit 4371344

Browse files
CKGraficokazupon
authored andcommitted
⭐ new(typescript): Allow module augmentation (#273) by @CKGrafico
* Allow type augmentation * Update index.d.ts
1 parent 51bfca3 commit 4371344

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

types/index.d.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,18 @@ declare namespace VueI18n {
7171
}
7272
}
7373

74+
export declare interface IVueI18n {
75+
readonly messages: VueI18n.LocaleMessages;
76+
readonly dateTimeFormats: VueI18n.DateTimeFormats;
77+
readonly numberFormats: VueI18n.NumberFormats;
78+
79+
locale: VueI18n.Locale;
80+
fallbackLocale: VueI18n.Locale;
81+
missing: VueI18n.MissingHandler;
82+
formatter: VueI18n.Formatter;
83+
silentTranslationWarn: boolean;
84+
}
85+
7486
declare class VueI18n {
7587
constructor(options?: VueI18n.I18nOptions)
7688

@@ -113,7 +125,7 @@ declare class VueI18n {
113125

114126
declare module 'vue/types/vue' {
115127
interface Vue {
116-
readonly $i18n: VueI18n;
128+
readonly $i18n: VueI18n & IVueI18n;
117129
$t: typeof VueI18n.prototype.t;
118130
$tc: typeof VueI18n.prototype.tc;
119131
$te: typeof VueI18n.prototype.te;

0 commit comments

Comments
 (0)