Skip to content

Commit

Permalink
Flow: make more objects exact (facebook#27790)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
kassens committed Dec 4, 2023
1 parent 223db40 commit f498aa2
Show file tree
Hide file tree
Showing 10 changed files with 3 additions and 21 deletions.
2 changes: 0 additions & 2 deletions packages/react-debug-tools/src/ReactDebugHooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ type HookLogEntry = {
primitive: string,
stackError: Error,
value: mixed,
...
};

let hookLog: Array<HookLogEntry> = [];
Expand Down Expand Up @@ -408,7 +407,6 @@ export type HooksNode = {
value: mixed,
subHooks: Array<HooksNode>,
hookSource?: HookSource,
...
};
export type HooksTree = Array<HooksNode>;

Expand Down
1 change: 0 additions & 1 deletion packages/react-devtools-core/src/backend.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ type ConnectOptions = {
isAppActive?: () => boolean,
websocket?: ?WebSocket,
devToolsSettingsManager: ?DevToolsSettingsManager,
...
};

// Install a global variable to allow patching console early (during injection).
Expand Down
1 change: 0 additions & 1 deletion packages/react-devtools-shared/src/devtools/cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ export type Resource<Input, Key, Value> = {
read(Input): Value,
preload(Input): void,
write(Key, Value): void,
...
};

const Pending = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ type Props = {
placeholder?: string,
testName?: ?string,
value: any,
...
};

export default function AutoSizeInput({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,6 @@ type ElementsDropdownProps = {
owners: Array<SerializedElement>,
selectedIndex: number,
selectOwner: SelectOwner,
...
};
function ElementsDropdown({owners, selectOwner}: ElementsDropdownProps) {
const store = useContext(StoreContext);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ type Props = {
data: ItemData,
index: number,
style: Object,
...
};

function CommitRankedListItem({data, index, style}: Props) {
Expand Down
2 changes: 1 addition & 1 deletion packages/react-devtools-shared/src/hydration.js
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ export function hydrate(
parent[last] = undefined;
} else {
// Replace the string keys with Symbols so they're non-enumerable.
const replaced: {[key: symbol]: boolean | string, ...} = {};
const replaced: {[key: symbol]: boolean | string} = {};
replaced[meta.inspectable] = !!value.inspectable;
replaced[meta.inspected] = false;
replaced[meta.name] = value.name;
Expand Down
4 changes: 1 addition & 3 deletions packages/react-dom/src/client/ReactDOMRoot.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,14 @@ export type RootType = {
render(children: ReactNodeList): void,
unmount(): void,
_internalRoot: FiberRoot | null,
...
};

export type CreateRootOptions = {
unstable_strictMode?: boolean,
unstable_concurrentUpdatesByDefault?: boolean,
unstable_transitionCallbacks?: TransitionTracingCallbacks,
identifierPrefix?: string,
onRecoverableError?: (error: mixed) => void,
...
};

export type HydrateRootOptions = {
Expand All @@ -57,7 +56,6 @@ export type HydrateRootOptions = {
identifierPrefix?: string,
onRecoverableError?: (error: mixed) => void,
formState?: ReactFormState<any, any> | null,
...
};

import {
Expand Down
9 changes: 1 addition & 8 deletions packages/shared/ReactTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,12 @@ export type ReactProvider<T> = {
props: {
value: T,
children?: ReactNodeList,
...
},
...
};

export type ReactProviderType<T> = {
$$typeof: symbol | number,
_context: ReactContext<T>,
...
};

export type ReactConsumer<T> = {
Expand All @@ -49,9 +46,7 @@ export type ReactConsumer<T> = {
ref: null,
props: {
children: (value: T) => ReactNodeList,
...
},
...
};

export type ReactContext<T> = {
Expand All @@ -71,7 +66,6 @@ export type ReactContext<T> = {
// only used by ServerContext
_defaultValue: T,
_globalName: string,
...
};

export type ServerContextJSONValue =
Expand All @@ -91,7 +85,6 @@ export type ReactPortal = {
children: ReactNodeList,
// TODO: figure out the API for cross-renderer implementation.
implementation: any,
...
};

export type RefObject = {
Expand All @@ -104,7 +97,7 @@ export type ReactScope = {

export type ReactScopeQuery = (
type: string,
props: {[string]: mixed, ...},
props: {[string]: mixed},
instance: mixed,
) => boolean;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,11 @@ export const customBubblingEventTypes: {
skipBubbling?: ?boolean,
}>,
}>,
...
} = {};
export const customDirectEventTypes: {
[eventName: string]: $ReadOnly<{
registrationName: string,
}>,
...
} = {};

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

0 comments on commit f498aa2

Please sign in to comment.