@@ -209,29 +209,29 @@ declare module 'react-intl' {
209
209
time : { [ key : string ] : Intl . DateTimeFormatOptions , ... } ;
210
210
}
211
211
declare type FormattableUnit = Unit | Units ;
212
- declare export var FormattedDate : React_2 . FC <
212
+ declare export var FormattedDate : React$StatelessFunctionalComponent <
213
213
DateTimeFormatOptions &
214
214
CustomFormatConfig & {
215
215
value : string | number | Date | void ,
216
216
...
217
217
} ,
218
218
> ;
219
- declare export var FormattedDateParts : React_2 . FC <
219
+ declare export var FormattedDateParts : React$StatelessFunctionalComponent <
220
220
FormatDateOptions & {
221
221
value : $ElementType < Parameters < $PropertyType < Intl . DateTimeFormat , 'format' > > , 0 > | string,
222
222
children ( val : Intl . DateTimeFormatPart [ ] ) : React_2 . ReactElement < > | null ,
223
223
...
224
224
} ,
225
225
> ;
226
- declare export var FormattedDisplayName : React_2 . FC <
226
+ declare export var FormattedDisplayName : React$StatelessFunctionalComponent <
227
227
DisplayNamesOptions & {
228
228
value : string | number | { [ key : string ] : any } ,
229
229
...
230
230
} ,
231
231
> ;
232
- declare export var FormattedList : React_2 . FC <
232
+ declare export var FormattedList : React$StatelessFunctionalComponent <
233
233
IntlListFormatOptions & {
234
- value : React_2 . Node [ ] ,
234
+ value : React$ Node[ ] ,
235
235
...
236
236
} ,
237
237
> ;
@@ -240,33 +240,35 @@ declare module 'react-intl' {
240
240
[ key : string ] :
241
241
| PrimitiveType
242
242
| React_2 . ReactElement < >
243
- | FormatXMLElementFn < React_2 . Node , React_2 . Node > ,
243
+ | FormatXMLElementFn < React$ Node, React$ Node> ,
244
244
...,
245
245
} ,
246
- > mixins React_2 . Component < Props_3 < V > > {
246
+ // Changed `mixins` to `extends` in TS to Flow translation
247
+ > extends React$Component < Props_3 < V >> {
247
248
static displayName : string ;
248
249
shouldComponentUpdate ( nextProps : Props_3 < V > ) : boolean ;
249
250
render ( ) : React$Node ;
250
251
}
251
- declare export var FormattedNumber : React_2 . FC <
252
+ declare export var FormattedNumber : React$StatelessFunctionalComponent <
252
253
NumberFormatOptions &
253
254
CustomFormatConfig & {
254
255
value : number ,
255
256
...
256
257
} ,
257
258
> ;
258
- declare export var FormattedNumberParts : React_2 . FC <
259
+ declare export var FormattedNumberParts : React$StatelessFunctionalComponent <
259
260
$PropertyType < Formatter , 'formatNumber' > & {
260
261
value : $ElementType < Parameters < $PropertyType < IntlShape , 'formatNumber' > > , 0 > ,
261
262
children ( val : Intl . NumberFormatPart [ ] ) : React_2 . ReactElement < > | null ,
262
263
...
263
264
} ,
264
265
> ;
265
- declare export var FormattedPlural : React_2 . FC < WithIntlProps < Props_2 >> & {
266
- WrappedComponent : React_2 . ComponentType < Props_2 > ,
266
+ declare export var FormattedPlural : React$StatelessFunctionalComponent < WithIntlProps < Props_2 >> & {
267
+ WrappedComponent : React$ ComponentType< Props_2 > ,
267
268
...
268
269
} ;
269
- declare export class FormattedRelativeTime mixins React_2 . PureComponent < Props , State_2 > {
270
+ // Changed `mixins` to `extends` in TS to Flow translation
271
+ declare export class FormattedRelativeTime extends React$PureComponent < Props , State_2 > {
270
272
_updateTimer : any ;
271
273
static displayName : string ;
272
274
static defaultProps : Pick < Props , 'unit' | 'value' > ;
@@ -279,14 +281,14 @@ declare module 'react-intl' {
279
281
static getDerivedStateFromProps ( props : Props , state : State_2 ) : $Rest < State_2 , { ... } > | null ;
280
282
render ( ) : React$Node ;
281
283
}
282
- declare export var FormattedTime: React_2.FC <
284
+ declare export var FormattedTime : React$StatelessFunctionalComponent <
283
285
DateTimeFormatOptions &
284
286
CustomFormatConfig & {
285
287
value : string | number | Date | void ,
286
288
...
287
289
} ,
288
290
> ;
289
- declare export var FormattedTimeParts: React_2.FC <
291
+ declare export var FormattedTimeParts : React$StatelessFunctionalComponent <
290
292
FormatDateOptions & {
291
293
value : $ElementType < Parameters < $PropertyType < Intl . DateTimeFormat , 'format' > > , 0 > | string,
292
294
children ( val : Intl . DateTimeFormatPart [ ] ) : React_2 . ReactElement < > | null ,
@@ -325,23 +327,23 @@ declare module 'react-intl' {
325
327
parts : Array < string | T > ,
326
328
) => R ;
327
329
declare export function injectIntl < IntlPropName : string , P : WrappedComponentProps < IntlPropName >> (
328
- WrappedComponent : React_2 . ComponentType < P > ,
330
+ WrappedComponent : React$ ComponentType< P > ,
329
331
options ? : Opts < IntlPropName , false > ,
330
- ) : React_2 . FC < WithIntlProps < P >> & {
331
- WrappedComponent : React_2 . ComponentType < P > ,
332
+ ) : React$StatelessFunctionalComponent < WithIntlProps < P >> & {
333
+ WrappedComponent : React$ ComponentType< P > ,
332
334
...
333
335
} ;
334
336
declare export function injectIntl <
335
337
IntlPropName : string ,
336
338
P : WrappedComponentProps < IntlPropName > ,
337
- T : React_2 . ComponentType < P > ,
339
+ T : React$ ComponentType< P > ,
338
340
> (
339
- WrappedComponent : React_2 . ComponentType < P > ,
341
+ WrappedComponent : React$ ComponentType< P > ,
340
342
options ? : Opts < IntlPropName , true > ,
341
343
) : React_2 . ForwardRefExoticComponent <
342
344
React_2 . PropsWithoutRef < WithIntlProps < React_2 . PropsWithChildren < P >>> & React_2 . RefAttributes < T > ,
343
345
> & {
344
- WrappedComponent : React_2 . ComponentType < P > ,
346
+ WrappedComponent : React$ ComponentType< P > ,
345
347
...
346
348
} ;
347
349
declare export interface IntlCache {
@@ -357,7 +359,7 @@ declare module 'react-intl' {
357
359
locale : string ;
358
360
timeZone ?: string ;
359
361
formats : CustomFormats ;
360
- textComponent ?: React_2 . ComponentType < > | $Keys < React_2 . ReactHTML > ;
362
+ textComponent ?: React$ ComponentType< > | $Keys < React_2 . ReactHTML > ;
361
363
messages : { [ key : string ] : string , ... } | { [ key : string ] : MessageFormatElement [ ] , ... } ;
362
364
defaultLocale : string ;
363
365
defaultFormats : CustomFormats ;
@@ -372,8 +374,8 @@ declare module 'react-intl' {
372
374
| FormatError ,
373
375
) : void ;
374
376
}
375
- declare export var IntlContext : React_2 . Context < IntlShape > ;
376
- declare export interface IntlFormatters < T = React_2 . Node , R = T > {
377
+ declare export var IntlContext : React$ Context< IntlShape > ;
378
+ declare export interface IntlFormatters < T = React$ Node, R = T > {
377
379
formatDate (
378
380
value : $ElementType < Parameters < $PropertyType < Intl . DateTimeFormat , 'format' > > , 0 > | string,
379
381
opts ?: FormatDateOptions ,
@@ -417,10 +419,10 @@ declare module 'react-intl' {
417
419
descriptor : MessageDescriptor ,
418
420
// The `+` was added to make the properties covariant rather
419
421
// than invariant, something TypeScript can't do.
420
- values ?: { + [ key : string ] : PrimitiveType | React_2 . Node | FormatXMLElementFn < T , R > , ... } ,
422
+ values ?: { + [ key : string ] : PrimitiveType | React$ Node | FormatXMLElementFn < T , R > , ... } ,
421
423
) : React$Node ;
422
424
formatList ( values : Array < string > , opts ? : FormatListOptions ) : string ;
423
- formatList ( values : Array < string | React_2 . Node > , opts ? : FormatListOptions ) : React_2 . Node ;
425
+ formatList ( values : Array < string | React$ Node> , opts ? : FormatListOptions ) : React$ Node;
424
426
formatDisplayName (
425
427
value : $ElementType < Parameters < $PropertyType < DisplayNames , 'of' >> , 0 > ,
426
428
opts ? : FormatDisplayNameOptions ,
@@ -567,7 +569,8 @@ declare module 'react-intl' {
567
569
} ;
568
570
}
569
571
declare export class IntlProvider
570
- mixins React_2 . PureComponent < React_2 . PropsWithChildren < OptionalIntlConfig > , State> {
572
+ // Changed `mixins` to `extends` in TS to Flow translation
573
+ extends React$PureComponent < React_2 . PropsWithChildren < OptionalIntlConfig > , State > {
571
574
static displayName : string ;
572
575
static defaultProps : Pick <
573
576
IntlConfig ,
@@ -840,19 +843,19 @@ declare module 'react-intl' {
840
843
declare type Props_2 = {
841
844
value : number ,
842
845
intl : IntlShape ,
843
- other : React_2 . Node ,
844
- zero ?: React_2 . Node ,
845
- one ?: React_2 . Node ,
846
- two ?: React_2 . Node ,
847
- few ?: React_2 . Node ,
848
- many ?: React_2 . Node ,
849
- children ?: ( value : React_2 . Node ) => React_2 . ReactElement < > | null ,
846
+ other : React$ Node,
847
+ zero ?: React$ Node,
848
+ one ?: React$ Node,
849
+ two ?: React$ Node,
850
+ few ?: React$ Node,
851
+ many ?: React$ Node,
852
+ children ?: ( value : React$ Node) => React_2 . ReactElement < > | null ,
850
853
...
851
854
} & FormatPluralOptions ;
852
- declare type Props_3 < V : { [ key : string ] : any , ... } = { [ key : string ] : React_2 . Node , ... } > = {
855
+ declare type Props_3 < V : { [ key : string ] : any , ... } = { [ key : string ] : React$ Node, ... } > = {
853
856
values ?: V ,
854
857
tagName ?: React_2 . ElementType < any > ,
855
- children ?: ( ...nodes : React_2 . ReactNodeArray ) => React_2 . Node ,
858
+ children ?: ( ...nodes : React_2 . ReactNodeArray ) => React$ Node,
856
859
...
857
860
} & MessageDescriptor ;
858
861
declare export var RawIntlProvider : React_2 . Provider < IntlShape > ;
0 commit comments