Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow type augmentation #273

Merged
merged 2 commits into from
Jan 10, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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