Skip to content

Commit afc8e09

Browse files
committed
react-intl libdef: Make some React type annotations useful.
Not sure why the TypeScript file is calling it React_2 instead of React...anyway, handle these, like we did in two recent commits.
1 parent 4432ad9 commit afc8e09

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

flow-typed/react-intl_vx.x.x.js

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ declare module 'react-intl' {
231231
>;
232232
declare export var FormattedList: React_2.FC<
233233
IntlListFormatOptions & {
234-
value: React_2.Node[],
234+
value: React$Node[],
235235
...
236236
},
237237
>;
@@ -240,10 +240,10 @@ declare module 'react-intl' {
240240
[key: string]:
241241
| PrimitiveType
242242
| React_2.ReactElement<>
243-
| FormatXMLElementFn<React_2.Node, React_2.Node>,
243+
| FormatXMLElementFn<React$Node, React$Node>,
244244
...,
245245
},
246-
> mixins React_2.Component<Props_3<V>> {
246+
> mixins React$Component<Props_3<V>> {
247247
static displayName: string;
248248
shouldComponentUpdate(nextProps: Props_3<V>): boolean;
249249
render(): React$Node;
@@ -263,7 +263,7 @@ declare module 'react-intl' {
263263
},
264264
>;
265265
declare export var FormattedPlural: React_2.FC<WithIntlProps<Props_2>> & {
266-
WrappedComponent: React_2.ComponentType<Props_2>,
266+
WrappedComponent: React$ComponentType<Props_2>,
267267
...
268268
};
269269
declare export class FormattedRelativeTime mixins React_2.PureComponent<Props, State_2> {
@@ -325,23 +325,23 @@ declare module 'react-intl' {
325325
parts: Array<string | T>,
326326
) => R;
327327
declare export function injectIntl<IntlPropName: string, P: WrappedComponentProps<IntlPropName>>(
328-
WrappedComponent: React_2.ComponentType<P>,
328+
WrappedComponent: React$ComponentType<P>,
329329
options?: Opts<IntlPropName, false>,
330330
): React_2.FC<WithIntlProps<P>> & {
331-
WrappedComponent: React_2.ComponentType<P>,
331+
WrappedComponent: React$ComponentType<P>,
332332
...
333333
};
334334
declare export function injectIntl<
335335
IntlPropName: string,
336336
P: WrappedComponentProps<IntlPropName>,
337-
T: React_2.ComponentType<P>,
337+
T: React$ComponentType<P>,
338338
>(
339-
WrappedComponent: React_2.ComponentType<P>,
339+
WrappedComponent: React$ComponentType<P>,
340340
options?: Opts<IntlPropName, true>,
341341
): React_2.ForwardRefExoticComponent<
342342
React_2.PropsWithoutRef<WithIntlProps<React_2.PropsWithChildren<P>>> & React_2.RefAttributes<T>,
343343
> & {
344-
WrappedComponent: React_2.ComponentType<P>,
344+
WrappedComponent: React$ComponentType<P>,
345345
...
346346
};
347347
declare export interface IntlCache {
@@ -357,7 +357,7 @@ declare module 'react-intl' {
357357
locale: string;
358358
timeZone?: string;
359359
formats: CustomFormats;
360-
textComponent?: React_2.ComponentType<> | $Keys<React_2.ReactHTML>;
360+
textComponent?: React$ComponentType<> | $Keys<React_2.ReactHTML>;
361361
messages: { [key: string]: string, ... } | { [key: string]: MessageFormatElement[], ... };
362362
defaultLocale: string;
363363
defaultFormats: CustomFormats;
@@ -372,8 +372,8 @@ declare module 'react-intl' {
372372
| FormatError,
373373
): void;
374374
}
375-
declare export var IntlContext: React_2.Context<IntlShape>;
376-
declare export interface IntlFormatters<T = React_2.Node, R = T> {
375+
declare export var IntlContext: React$Context<IntlShape>;
376+
declare export interface IntlFormatters<T = React$Node, R = T> {
377377
formatDate(
378378
value: $ElementType<Parameters<$PropertyType<Intl.DateTimeFormat, 'format'>>, 0> | string,
379379
opts?: FormatDateOptions,
@@ -413,10 +413,10 @@ declare module 'react-intl' {
413413
): string;
414414
formatMessage(
415415
descriptor: MessageDescriptor,
416-
values?: { [key: string]: PrimitiveType | React_2.Node | FormatXMLElementFn<T, R>, ... },
416+
values?: { [key: string]: PrimitiveType | React$Node | FormatXMLElementFn<T, R>, ... },
417417
): React$Node;
418418
formatList(values: Array<string>, opts?: FormatListOptions): string;
419-
formatList(values: Array<string | React_2.Node>, opts?: FormatListOptions): React_2.Node;
419+
formatList(values: Array<string | React$Node>, opts?: FormatListOptions): React$Node;
420420
formatDisplayName(
421421
value: $ElementType<Parameters<$PropertyType<DisplayNames, 'of'>>, 0>,
422422
opts?: FormatDisplayNameOptions,
@@ -836,19 +836,19 @@ declare module 'react-intl' {
836836
declare type Props_2 = {
837837
value: number,
838838
intl: IntlShape,
839-
other: React_2.Node,
840-
zero?: React_2.Node,
841-
one?: React_2.Node,
842-
two?: React_2.Node,
843-
few?: React_2.Node,
844-
many?: React_2.Node,
845-
children?: (value: React_2.Node) => React_2.ReactElement<> | null,
839+
other: React$Node,
840+
zero?: React$Node,
841+
one?: React$Node,
842+
two?: React$Node,
843+
few?: React$Node,
844+
many?: React$Node,
845+
children?: (value: React$Node) => React_2.ReactElement<> | null,
846846
...
847847
} & FormatPluralOptions;
848-
declare type Props_3<V: { [key: string]: any, ... } = { [key: string]: React_2.Node, ... }> = {
848+
declare type Props_3<V: { [key: string]: any, ... } = { [key: string]: React$Node, ... }> = {
849849
values?: V,
850850
tagName?: React_2.ElementType<any>,
851-
children?: (...nodes: React_2.ReactNodeArray) => React_2.Node,
851+
children?: (...nodes: React_2.ReactNodeArray) => React$Node,
852852
...
853853
} & MessageDescriptor;
854854
declare export var RawIntlProvider: React_2.Provider<IntlShape>;

0 commit comments

Comments
 (0)