Skip to content

Commit

Permalink
⚡ improvement(typescript): update typings
Browse files Browse the repository at this point in the history
  • Loading branch information
kazupon committed Feb 10, 2019
1 parent 44e04e7 commit dee35b9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 7 additions & 2 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,9 @@ declare namespace VueI18n {
fallbackRoot?: boolean;
sync?: boolean;
silentTranslationWarn?: boolean;
pluralizationRules?: PluralizationRulesMap;
silentFallbackWarn?: boolean;
preserveDirectiveContent?: boolean;
pluralizationRules?: PluralizationRulesMap;
}
}

Expand Down Expand Up @@ -129,8 +130,9 @@ export declare interface IVueI18n {
missing: VueI18n.MissingHandler;
formatter: VueI18n.Formatter;
silentTranslationWarn: boolean;
pluralizationRules: VueI18n.PluralizationRulesMap;
silentFallbackWarn: boolean;
preserveDirectiveContent: boolean;
pluralizationRules: VueI18n.PluralizationRulesMap;
}

declare class VueI18n {
Expand All @@ -145,6 +147,9 @@ declare class VueI18n {
missing: VueI18n.MissingHandler;
formatter: VueI18n.Formatter;
silentTranslationWarn: boolean;
silentFallbackWarn: boolean;
preserveDirectiveContent: boolean;
pluralizationRules: VueI18n.PluralizationRulesMap;

t(key: VueI18n.Path, values?: VueI18n.Values): VueI18n.TranslateResult;
t(key: VueI18n.Path, locale: VueI18n.Locale, values?: VueI18n.Values): VueI18n.TranslateResult;
Expand Down
2 changes: 2 additions & 0 deletions types/test/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ const i18n = new VueI18n({
fallbackRoot: false,
sync: true,
silentTranslationWarn: true,
silentFallbackWarn: true,
preserveDirectiveContent: true,
});
i18n.messages[locale][key]; // $ExpectType LocaleMessage
Expand All @@ -73,6 +74,7 @@ i18n.fallbackLocale; // $ExpectType string
i18n.missing; // $ExpectType MissingHandler
i18n.formatter; // $ExpectType Formatter
i18n.silentTranslationWarn; // $ExpectType boolean
i18n.silentFallbackWarn; // $ExpectType boolean
i18n.preserveDirectiveContent; // $ExpectType boolean
i18n.setLocaleMessage; // $ExpectType (locale: string, message: LocaleMessageObject) => void
i18n.getLocaleMessage; // $ExpectType (locale: string) => LocaleMessageObject
Expand Down

0 comments on commit dee35b9

Please sign in to comment.