Flow: make more objects exact (#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.
Jan Kassens committed
Dec 4, 2023 at 16:10 UTC
f498aa299292d4d1e999f66d1c769440ad10d57c
10 files changed
+3
-21
packages/react-debug-tools/src/ReactDebugHooks.js
-2
@@ -36,7 +36,6 @@ type HookLogEntry = {
36
primitive: string,
37
stackError: Error,
38
value: mixed,
39
- ...
39
};
40
41
let hookLog: Array<HookLogEntry> = [];
@@ -408,7 +407,6 @@ export type HooksNode = {
407
value: mixed,
408
subHooks: Array<HooksNode>,
409
hookSource?: HookSource,
411
- ...
410
};
411
export type HooksTree = Array<HooksNode>;
412
packages/react-devtools-core/src/backend.js
-1
@@ -36,7 +36,6 @@ type ConnectOptions = {
36
isAppActive?: () => boolean,
37
websocket?: ?WebSocket,
38
devToolsSettingsManager: ?DevToolsSettingsManager,
39
- ...
39
};
40
41
// Install a global variable to allow patching console early (during injection).
packages/react-devtools-shared/src/devtools/cache.js
-1
@@ -53,7 +53,6 @@ export type Resource<Input, Key, Value> = {
53
read(Input): Value,
54
preload(Input): void,
55
write(Key, Value): void,
56
- ...
56
};
57
58
const Pending = 0;
packages/react-devtools-shared/src/devtools/views/Components/NativeStyleEditor/AutoSizeInput.js
-1
@@ -16,7 +16,6 @@ type Props = {
16
placeholder?: string,
17
testName?: ?string,
18
value: any,
19
- ...
19
};
20
21
export default function AutoSizeInput({
packages/react-devtools-shared/src/devtools/views/Components/OwnersStack.js
-1
@@ -202,7 +202,6 @@ type ElementsDropdownProps = {
202
owners: Array<SerializedElement>,
203
selectedIndex: number,
204
selectOwner: SelectOwner,
205
- ...
205
};
206
function ElementsDropdown({owners, selectOwner}: ElementsDropdownProps) {
207
const store = useContext(StoreContext);
packages/react-devtools-shared/src/devtools/views/Profiler/CommitRankedListItem.js
-1
@@ -21,7 +21,6 @@ type Props = {
21
data: ItemData,
22
index: number,
23
style: Object,
24
- ...
24
};
25
26
function CommitRankedListItem({data, index, style}: Props) {
packages/react-devtools-shared/src/hydration.js
+1
-1
@@ -427,7 +427,7 @@ export function hydrate(
427
parent[last] = undefined;
428
} else {
429
// 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} = {};
431
replaced[meta.inspectable] = !!value.inspectable;
432
replaced[meta.inspected] = false;
433
replaced[meta.name] = value.name;
packages/react-dom/src/client/ReactDOMRoot.js
+1
-3
@@ -35,15 +35,14 @@ export type RootType = {
35
render(children: ReactNodeList): void,
36
unmount(): void,
37
_internalRoot: FiberRoot | null,
38
- ...
38
};
39
+
40
export type CreateRootOptions = {
41
unstable_strictMode?: boolean,
42
unstable_concurrentUpdatesByDefault?: boolean,
43
unstable_transitionCallbacks?: TransitionTracingCallbacks,
44
identifierPrefix?: string,
45
onRecoverableError?: (error: mixed) => void,
46
- ...
46
};
47
48
export type HydrateRootOptions = {
@@ -57,7 +56,6 @@ export type HydrateRootOptions = {
56
identifierPrefix?: string,
57
onRecoverableError?: (error: mixed) => void,
58
formState?: ReactFormState<any, any> | null,
60
- ...
59
};
60
61
import {
packages/shared/ReactTypes.js
+1
-8
@@ -31,15 +31,12 @@ export type ReactProvider<T> = {
31
props: {
32
value: T,
33
children?: ReactNodeList,
34
- ...
34
},
36
- ...
35
};
36
37
export type ReactProviderType<T> = {
38
$$typeof: symbol | number,
39
_context: ReactContext<T>,
42
- ...
40
};
41
42
export type ReactConsumer<T> = {
@@ -49,9 +46,7 @@ export type ReactConsumer<T> = {
46
ref: null,
47
props: {
48
children: (value: T) => ReactNodeList,
52
- ...
49
},
54
- ...
50
};
51
52
export type ReactContext<T> = {
@@ -71,7 +66,6 @@ export type ReactContext<T> = {
66
// only used by ServerContext
67
_defaultValue: T,
68
_globalName: string,
74
- ...
69
};
70
71
export type ServerContextJSONValue =
@@ -91,7 +85,6 @@ export type ReactPortal = {
85
children: ReactNodeList,
86
// TODO: figure out the API for cross-renderer implementation.
87
implementation: any,
94
- ...
88
};
89
90
export type RefObject = {
@@ -104,7 +97,7 @@ export type ReactScope = {
97
98
export type ReactScopeQuery = (
99
type: string,
107
- props: {[string]: mixed, ...},
100
+ props: {[string]: mixed},
101
instance: mixed,
102
) => boolean;
103
scripts/rollup/shims/react-native/ReactNativeViewConfigRegistry.js
-2
@@ -22,13 +22,11 @@ export const customBubblingEventTypes: {
22
skipBubbling?: ?boolean,
23
}>,
24
}>,
25
- ...
25
} = {};
26
export const customDirectEventTypes: {
27
[eventName: string]: $ReadOnly<{
28
registrationName: string,
29
}>,
31
- ...
30
} = {};
31
32
const viewConfigCallbacks = new Map<string, ?() => ViewConfig>();