From 6967a1515ba441fa07cbf5a1b5860a169dd8215f Mon Sep 17 00:00:00 2001 From: kazuya kawaguchi Date: Tue, 9 Jul 2019 15:21:39 +0900 Subject: [PATCH] :zap: improvement(typing): sharedMessages option type --- decls/i18n.js | 1 + types/index.d.ts | 2 ++ types/test/component.ts | 4 ++++ 3 files changed, 7 insertions(+) diff --git a/decls/i18n.js b/decls/i18n.js index e8be3b0b1..f5f04d47f 100644 --- a/decls/i18n.js +++ b/decls/i18n.js @@ -77,6 +77,7 @@ declare type I18nOptions = { pluralizationRules?: PluralizationRules, preserveDirectiveContent?: boolean, warnHtmlInMessage?: WarnHtmlInMessageLevel, + sharedMessages?: LocaleMessage, }; declare type IntlAvailability = { diff --git a/types/index.d.ts b/types/index.d.ts index 07438a427..fe34985e7 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -106,6 +106,7 @@ declare namespace VueI18n { preserveDirectiveContent?: boolean; pluralizationRules?: PluralizationRulesMap; warnHtmlInMessage?: WarnHtmlInMessageLevel; + sharedMessages?: LocaleMessages; } } @@ -218,6 +219,7 @@ declare module 'vue/types/options' { messages?: VueI18n.LocaleMessages; dateTimeFormats?: VueI18n.DateTimeFormats; numberFormats?: VueI18n.NumberFormats; + sharedMessages?: VueI18n.LocaleMessages; }; } } diff --git a/types/test/component.ts b/types/test/component.ts index 23d152727..4d3a0d94f 100644 --- a/types/test/component.ts +++ b/types/test/component.ts @@ -31,6 +31,10 @@ const Component1 = { messages: { en: { message: { hello: 'hello component1' } }, ja: { message: { hello: 'こんにちは、component1' } } + }, + sharedMessages: { + en: { buttons: { save: 'Save'} }, + ja: { buttons: { save: 'Save'} } } } }