Skip to content

Commit f77cc17

Browse files
committed
Add createIntlCache, intlConfig, createIntl, RawIntlProvider.
1 parent 85b1b71 commit f77cc17

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

src/ReactIntl.re

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,38 @@ external domTag: string => textComponent = "%identity";
140140
external textComponent: React.component('props) => textComponent =
141141
"%identity";
142142

143+
type intlCache;
144+
145+
[@bs.module "react-intl"]
146+
external createIntlCache: unit => intlCache = "createIntlCache";
147+
148+
type intlConfig;
149+
150+
[@bs.obj]
151+
external intlConfig:
152+
(
153+
~locale: string,
154+
~timeZone: string=?,
155+
~formats: Js.t({..})=?, /* TODO */
156+
~textComponent: textComponent=?,
157+
~messages: Js.Dict.t(string),
158+
~defaultLocale: string=?,
159+
~defaultFormats: Js.t({..})=?, /* TODO */
160+
~onError: string => unit=?,
161+
unit
162+
) =>
163+
intlConfig =
164+
"";
165+
166+
[@bs.module "react-intl"]
167+
external createIntl: (intlConfig, intlCache) => Intl.t = "createIntl";
168+
169+
module RawIntlProvider = {
170+
[@react.component] [@bs.module "react-intl"]
171+
external make: (~value: Intl.t, ~children: React.element) => React.element =
172+
"RawIntlProvider";
173+
};
174+
143175
module IntlProvider = {
144176
[@react.component] [@bs.module "react-intl"]
145177
external make:

0 commit comments

Comments
 (0)