Skip to content

Commit 7a9ad05

Browse files
kassensAndyPengc12
authored andcommitted
Flow: make more objects exact (facebook#27790)
This makes a couple objects more exact. Nothing critical, just noticed this old branch I had created when doing some Flow upgrades in the past.
1 parent 8dc216b commit 7a9ad05

File tree

10 files changed

+3
-21
lines changed

10 files changed

+3
-21
lines changed

packages/react-debug-tools/src/ReactDebugHooks.js

-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ type HookLogEntry = {
3636
primitive: string,
3737
stackError: Error,
3838
value: mixed,
39-
...
4039
};
4140

4241
let hookLog: Array<HookLogEntry> = [];
@@ -408,7 +407,6 @@ export type HooksNode = {
408407
value: mixed,
409408
subHooks: Array<HooksNode>,
410409
hookSource?: HookSource,
411-
...
412410
};
413411
export type HooksTree = Array<HooksNode>;
414412

packages/react-devtools-core/src/backend.js

-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ type ConnectOptions = {
3636
isAppActive?: () => boolean,
3737
websocket?: ?WebSocket,
3838
devToolsSettingsManager: ?DevToolsSettingsManager,
39-
...
4039
};
4140

4241
// Install a global variable to allow patching console early (during injection).

packages/react-devtools-shared/src/devtools/cache.js

-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ export type Resource<Input, Key, Value> = {
5353
read(Input): Value,
5454
preload(Input): void,
5555
write(Key, Value): void,
56-
...
5756
};
5857

5958
const Pending = 0;

packages/react-devtools-shared/src/devtools/views/Components/NativeStyleEditor/AutoSizeInput.js

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ type Props = {
1616
placeholder?: string,
1717
testName?: ?string,
1818
value: any,
19-
...
2019
};
2120

2221
export default function AutoSizeInput({

packages/react-devtools-shared/src/devtools/views/Components/OwnersStack.js

-1
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,6 @@ type ElementsDropdownProps = {
202202
owners: Array<SerializedElement>,
203203
selectedIndex: number,
204204
selectOwner: SelectOwner,
205-
...
206205
};
207206
function ElementsDropdown({owners, selectOwner}: ElementsDropdownProps) {
208207
const store = useContext(StoreContext);

packages/react-devtools-shared/src/devtools/views/Profiler/CommitRankedListItem.js

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ type Props = {
2121
data: ItemData,
2222
index: number,
2323
style: Object,
24-
...
2524
};
2625

2726
function CommitRankedListItem({data, index, style}: Props) {

packages/react-devtools-shared/src/hydration.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ export function hydrate(
427427
parent[last] = undefined;
428428
} else {
429429
// Replace the string keys with Symbols so they're non-enumerable.
430-
const replaced: {[key: symbol]: boolean | string, ...} = {};
430+
const replaced: {[key: symbol]: boolean | string} = {};
431431
replaced[meta.inspectable] = !!value.inspectable;
432432
replaced[meta.inspected] = false;
433433
replaced[meta.name] = value.name;

packages/react-dom/src/client/ReactDOMRoot.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,14 @@ export type RootType = {
3535
render(children: ReactNodeList): void,
3636
unmount(): void,
3737
_internalRoot: FiberRoot | null,
38-
...
3938
};
39+
4040
export type CreateRootOptions = {
4141
unstable_strictMode?: boolean,
4242
unstable_concurrentUpdatesByDefault?: boolean,
4343
unstable_transitionCallbacks?: TransitionTracingCallbacks,
4444
identifierPrefix?: string,
4545
onRecoverableError?: (error: mixed) => void,
46-
...
4746
};
4847

4948
export type HydrateRootOptions = {
@@ -57,7 +56,6 @@ export type HydrateRootOptions = {
5756
identifierPrefix?: string,
5857
onRecoverableError?: (error: mixed) => void,
5958
formState?: ReactFormState<any, any> | null,
60-
...
6159
};
6260

6361
import {

packages/shared/ReactTypes.js

+1-8
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,12 @@ export type ReactProvider<T> = {
3131
props: {
3232
value: T,
3333
children?: ReactNodeList,
34-
...
3534
},
36-
...
3735
};
3836

3937
export type ReactProviderType<T> = {
4038
$$typeof: symbol | number,
4139
_context: ReactContext<T>,
42-
...
4340
};
4441

4542
export type ReactConsumer<T> = {
@@ -49,9 +46,7 @@ export type ReactConsumer<T> = {
4946
ref: null,
5047
props: {
5148
children: (value: T) => ReactNodeList,
52-
...
5349
},
54-
...
5550
};
5651

5752
export type ReactContext<T> = {
@@ -71,7 +66,6 @@ export type ReactContext<T> = {
7166
// only used by ServerContext
7267
_defaultValue: T,
7368
_globalName: string,
74-
...
7569
};
7670

7771
export type ServerContextJSONValue =
@@ -91,7 +85,6 @@ export type ReactPortal = {
9185
children: ReactNodeList,
9286
// TODO: figure out the API for cross-renderer implementation.
9387
implementation: any,
94-
...
9588
};
9689

9790
export type RefObject = {
@@ -104,7 +97,7 @@ export type ReactScope = {
10497

10598
export type ReactScopeQuery = (
10699
type: string,
107-
props: {[string]: mixed, ...},
100+
props: {[string]: mixed},
108101
instance: mixed,
109102
) => boolean;
110103

scripts/rollup/shims/react-native/ReactNativeViewConfigRegistry.js

-2
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,11 @@ export const customBubblingEventTypes: {
2222
skipBubbling?: ?boolean,
2323
}>,
2424
}>,
25-
...
2625
} = {};
2726
export const customDirectEventTypes: {
2827
[eventName: string]: $ReadOnly<{
2928
registrationName: string,
3029
}>,
31-
...
3230
} = {};
3331

3432
const viewConfigCallbacks = new Map<string, ?() => ViewConfig>();

0 commit comments

Comments
 (0)