From 0caaead4789a62daef4ea73361506a9f135b80e7 Mon Sep 17 00:00:00 2001 From: Christian Kaisermann Date: Sat, 7 Nov 2020 11:31:11 -0300 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20possible=20interpolation?= =?UTF-8?q?=20value=20types?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/runtime/types/index.ts | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/runtime/types/index.ts b/src/runtime/types/index.ts index ebca6ee..1cef4c6 100644 --- a/src/runtime/types/index.ts +++ b/src/runtime/types/index.ts @@ -1,4 +1,4 @@ -import { Formats } from 'intl-messageformat'; +import type { FormatXMLElementFn, Formats } from 'intl-messageformat'; export interface LocaleDictionary { [key: string]: LocaleDictionary | string | Array; @@ -8,12 +8,25 @@ export type LocalesDictionary = { [key: string]: LocaleDictionary; }; +export type InterpolationValues = + | Record< + string, + | string + | number + | boolean + | Date + | FormatXMLElementFn + | null + | undefined + > + | undefined; + export interface MessageObject { id?: string; locale?: string; format?: string; default?: string; - values?: Record; + values?: InterpolationValues; } export type MessageFormatter = (