Skip to content

Commit

Permalink
⚡ improvement(typing): sharedMessages option type
Browse files Browse the repository at this point in the history
  • Loading branch information
kazupon committed Jul 9, 2019
1 parent 82543de commit 6967a15
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions decls/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ declare type I18nOptions = {
pluralizationRules?: PluralizationRules,
preserveDirectiveContent?: boolean,
warnHtmlInMessage?: WarnHtmlInMessageLevel,
sharedMessages?: LocaleMessage,
};

declare type IntlAvailability = {
Expand Down
2 changes: 2 additions & 0 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ declare namespace VueI18n {
preserveDirectiveContent?: boolean;
pluralizationRules?: PluralizationRulesMap;
warnHtmlInMessage?: WarnHtmlInMessageLevel;
sharedMessages?: LocaleMessages;
}
}

Expand Down Expand Up @@ -218,6 +219,7 @@ declare module 'vue/types/options' {
messages?: VueI18n.LocaleMessages;
dateTimeFormats?: VueI18n.DateTimeFormats;
numberFormats?: VueI18n.NumberFormats;
sharedMessages?: VueI18n.LocaleMessages;
};
}
}
Expand Down
4 changes: 4 additions & 0 deletions types/test/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'} }
}
}
}
Expand Down

0 comments on commit 6967a15

Please sign in to comment.