Skip to content

Commit 23aa4dd

Browse files
marcoww6meta-codesync[bot]
authored andcommitted
Transform another round of xplat (#55217)
Summary: Pull Request resolved: #55217 tsia Changelog: [internal] Reviewed By: SamChou19815 Differential Revision: D90914123 fbshipit-source-id: dc28b22524d3c6e6487d28cad30cc53a92ea8b83
1 parent d9ee4bb commit 23aa4dd

5 files changed

Lines changed: 169 additions & 142 deletions

File tree

flow-typed/npm/react-dom_v17.x.x.js

Lines changed: 24 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,44 +4,44 @@ declare module 'react-dom' {
44
declare var version: string;
55

66
declare function findDOMNode(
7-
componentOrElement: Element | ?Component<any, any>
7+
componentOrElement: Element | ?Component<any, any>,
88
): null | Element | Text;
99

1010
declare function render<ElementType: React.ElementType>(
1111
element: ExactReactElement_DEPRECATED<ElementType>,
1212
container: Element,
13-
callback?: () => void
13+
callback?: () => void,
1414
): React.ElementRef<ElementType>;
1515

1616
declare function hydrate<ElementType: React.ElementType>(
1717
element: ExactReactElement_DEPRECATED<ElementType>,
1818
container: Element,
19-
callback?: () => void
19+
callback?: () => void,
2020
): React.ElementRef<ElementType>;
2121

2222
declare function createPortal(
2323
node: React.Node,
24-
container: Element
24+
container: Element,
2525
): React.Portal;
2626

2727
declare function unmountComponentAtNode(container: any): boolean;
2828

2929
declare function unstable_batchedUpdates<A, B, C, D, E>(
30-
callback: (a: A, b: B, c: C, d: D, e: E) => mixed,
30+
callback: (a: A, b: B, c: C, d: D, e: E) => unknown,
3131
a: A,
3232
b: B,
3333
c: C,
3434
d: D,
35-
e: E
35+
e: E,
3636
): void;
3737

3838
declare function unstable_renderSubtreeIntoContainer<
39-
ElementType: React.ElementType
39+
ElementType: React.ElementType,
4040
>(
4141
parentComponent: Component<any, any>,
4242
nextElement: ExactReactElement_DEPRECATED<ElementType>,
4343
container: any,
44-
callback?: () => void
44+
callback?: () => void,
4545
): React.ElementRef<ElementType>;
4646
}
4747

@@ -55,85 +55,83 @@ declare module 'react-dom/server' {
5555
declare function renderToNodeStream(element: React.Node): stream$Readable;
5656

5757
declare function renderToStaticNodeStream(
58-
element: React.Node
58+
element: React.Node,
5959
): stream$Readable;
6060
}
6161

6262
declare module 'react-dom/test-utils' {
6363
import type {Component} from 'react';
6464

6565
declare interface Thenable {
66-
then(resolve: () => mixed, reject?: () => mixed): mixed,
66+
then(resolve: () => unknown, reject?: () => unknown): unknown;
6767
}
6868

6969
declare var Simulate: {
7070
[eventName: string]: (
7171
element: Element,
72-
eventData?: { [key: string]: mixed, ... }
72+
eventData?: {[key: string]: unknown, ...},
7373
) => void,
7474
...
7575
};
7676

7777
declare function renderIntoDocument(
78-
instance: React.MixedElement
78+
instance: React.MixedElement,
7979
): Component<any, any>;
8080

8181
declare function mockComponent(
8282
componentClass: React.ElementType,
83-
mockTagName?: string
84-
): { [key: string]: mixed, ... };
83+
mockTagName?: string,
84+
): {[key: string]: unknown, ...};
8585

8686
declare function isElement(element: React.MixedElement): boolean;
8787

8888
declare function isElementOfType(
8989
element: React.MixedElement,
90-
componentClass: React.ElementType
90+
componentClass: React.ElementType,
9191
): boolean;
9292

9393
declare function isDOMComponent(instance: any): boolean;
9494

95-
declare function isCompositeComponent(
96-
instance: Component<any, any>
97-
): boolean;
95+
declare function isCompositeComponent(instance: Component<any, any>): boolean;
9896

9997
declare function isCompositeComponentWithType(
10098
instance: Component<any, any>,
101-
componentClass: React.ElementType
99+
componentClass: React.ElementType,
102100
): boolean;
103101

104102
declare function findAllInRenderedTree(
105103
tree: Component<any, any>,
106-
test: (child: Component<any, any>) => boolean
104+
test: (child: Component<any, any>) => boolean,
107105
): Array<Component<any, any>>;
108106

109107
declare function scryRenderedDOMComponentsWithClass(
110108
tree: Component<any, any>,
111-
className: string
109+
className: string,
112110
): Array<Element>;
113111

114112
declare function findRenderedDOMComponentWithClass(
115113
tree: Component<any, any>,
116-
className: string
114+
className: string,
117115
): ?Element;
118116

119117
declare function scryRenderedDOMComponentsWithTag(
120118
tree: Component<any, any>,
121-
tagName: string
119+
tagName: string,
122120
): Array<Element>;
123121

124122
declare function findRenderedDOMComponentWithTag(
125123
tree: Component<any, any>,
126-
tagName: string
124+
tagName: string,
127125
): ?Element;
128126

129127
declare function scryRenderedComponentsWithType(
130128
tree: Component<any, any>,
131-
componentClass: React.ElementType
129+
componentClass: React.ElementType,
132130
): Array<Component<any, any>>;
133131

134132
declare function findRenderedComponentWithType(
135133
tree: Component<any, any>,
136-
componentClass: React.ElementType
134+
componentClass: React.ElementType,
137135
): ?Component<any, any>;
138136

139137
declare function act(callback: () => void | Thenable): Thenable;

flow-typed/npm/react-test-renderer_v16.x.x.js

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,25 @@
11
// Type definitions for react-test-renderer 16.x.x
22
// Ported from: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react-test-renderer
33

4-
type TestRendererOptions = { createNodeMock(element: React.MixedElement): any, ... };
4+
type TestRendererOptions = {
5+
createNodeMock(element: React.MixedElement): any,
6+
...
7+
};
58

6-
declare module "react-test-renderer" {
9+
declare module 'react-test-renderer' {
710
import type {Component as ReactComponent} from 'react';
811

912
type ReactComponentInstance = ReactComponent<any>;
1013

1114
export type ReactTestRendererJSON = {
1215
type: string,
13-
props: { [propName: string]: any, ... },
16+
props: {[propName: string]: any, ...},
1417
children: null | ReactTestRendererJSON[],
1518
...
1619
};
1720

1821
export type ReactTestRendererTree = ReactTestRendererJSON & {
19-
nodeType: "component" | "host",
22+
nodeType: 'component' | 'host',
2023
instance: ?ReactComponentInstance,
2124
rendered: null | ReactTestRendererTree,
2225
...
@@ -25,23 +28,23 @@ declare module "react-test-renderer" {
2528
export type ReactTestInstance = {
2629
instance: ?ReactComponentInstance,
2730
type: string,
28-
props: { [propName: string]: any, ... },
31+
props: {[propName: string]: any, ...},
2932
parent: null | ReactTestInstance,
3033
children: Array<ReactTestInstance | string>,
3134
find(predicate: (node: ReactTestInstance) => boolean): ReactTestInstance,
3235
findByType(type: React.ElementType): ReactTestInstance,
33-
findByProps(props: { [propName: string]: any, ... }): ReactTestInstance,
36+
findByProps(props: {[propName: string]: any, ...}): ReactTestInstance,
3437
findAll(
3538
predicate: (node: ReactTestInstance) => boolean,
36-
options?: { deep: boolean, ... }
39+
options?: {deep: boolean, ...},
3740
): ReactTestInstance[],
3841
findAllByType(
3942
type: React.ElementType,
40-
options?: { deep: boolean, ... }
43+
options?: {deep: boolean, ...},
4144
): ReactTestInstance[],
4245
findAllByProps(
43-
props: { [propName: string]: any, ... },
44-
options?: { deep: boolean, ... }
46+
props: {[propName: string]: any, ...},
47+
options?: {deep: boolean, ...},
4548
): ReactTestInstance[],
4649
...
4750
};
@@ -56,17 +59,20 @@ declare module "react-test-renderer" {
5659
...
5760
};
5861

59-
declare type Thenable = { then(resolve: () => mixed, reject?: () => mixed): mixed, ... };
62+
declare type Thenable = {
63+
then(resolve: () => unknown, reject?: () => unknown): unknown,
64+
...
65+
};
6066

6167
declare function create(
6268
nextElement: React.MixedElement,
63-
options?: TestRendererOptions
69+
options?: TestRendererOptions,
6470
): ReactTestRenderer;
6571

6672
declare function act(callback: () => void | Promise<void>): Thenable;
6773
}
6874

69-
declare module "react-test-renderer/shallow" {
75+
declare module 'react-test-renderer/shallow' {
7076
import type {ReactTestInstance} from 'react-test-renderer';
7177

7278
declare export default class ShallowRenderer {

flow-typed/npm/tinyglobby_v0.2.x.js

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,27 @@ declare module 'tinyglobby' {
1616
followSymbolicLinks?: boolean,
1717
fs?: FileSystemAdapter,
1818
globstar?: boolean,
19-
ignore?: string | $ReadOnlyArray<string>,
19+
ignore?: string | ReadonlyArray<string>,
2020
onlyDirectories?: boolean,
2121
onlyFiles?: boolean,
2222
signal?: AbortSignal,
2323
};
2424

2525
declare type GlobModule = {
26-
convertPathToPattern(path: string): string;
27-
escapePath(path: string): string;
28-
isDynamicPattern(pattern: string, options?: { caseSensitiveMatch: boolean }): boolean;
29-
glob(patterns: string | $ReadOnlyArray<string>, options?: GlobOptions): Promise<string[]>;
30-
globSync(patterns: string | $ReadOnlyArray<string>, options?: GlobOptions): string[];
26+
convertPathToPattern(path: string): string,
27+
escapePath(path: string): string,
28+
isDynamicPattern(
29+
pattern: string,
30+
options?: {caseSensitiveMatch: boolean},
31+
): boolean,
32+
glob(
33+
patterns: string | ReadonlyArray<string>,
34+
options?: GlobOptions,
35+
): Promise<string[]>,
36+
globSync(
37+
patterns: string | ReadonlyArray<string>,
38+
options?: GlobOptions,
39+
): string[],
3140
};
3241

3342
declare module.exports: GlobModule;

0 commit comments

Comments
 (0)