Skip to content

Commit 0a30722

Browse files
authored
Flow: complete types first migration (#25389)
This complete the "types first" migration and enables the config everywhere.
1 parent bcc0567 commit 0a30722

33 files changed

+133
-107
lines changed

packages/react-devtools-shared/src/node_modules/react-window/src/FixedSizeGrid.js

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/react-devtools-shared/src/node_modules/react-window/src/FixedSizeList.js

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/react-devtools-shared/src/node_modules/react-window/src/VariableSizeGrid.js

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/react-devtools-shared/src/node_modules/react-window/src/VariableSizeList.js

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/react-dom-bindings/src/client/ReactDOMInput.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ function isControlled(props) {
5959
* See http://www.w3.org/TR/2012/WD-html5-20121025/the-input-element.html
6060
*/
6161

62-
export function getHostProps(element: Element, props: Object) {
62+
export function getHostProps(element: Element, props: Object): Object {
6363
const node = ((element: any): InputWithWrapperState);
6464
const checked = props.checked;
6565

packages/react-dom-bindings/src/client/ReactDOMSelect.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ function updateOptions(
134134
* selected.
135135
*/
136136

137-
export function getHostProps(element: Element, props: Object) {
137+
export function getHostProps(element: Element, props: Object): Object {
138138
return assign({}, props, {
139139
value: undefined,
140140
});

packages/react-dom-bindings/src/client/ReactDOMTextarea.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ type TextAreaWithWrapperState = HTMLTextAreaElement & {
3737
* `defaultValue` if specified, or the children content (deprecated).
3838
*/
3939

40-
export function getHostProps(element: Element, props: Object) {
40+
export function getHostProps(element: Element, props: Object): Object {
4141
const node = ((element: any): TextAreaWithWrapperState);
4242

4343
if (props.dangerouslySetInnerHTML != null) {

packages/react-dom-bindings/src/client/setInnerHTML.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ let reusableSVGContainer;
2121
* @param {string} html
2222
* @internal
2323
*/
24-
const setInnerHTML = createMicrosoftUnsafeLocalFunction(function(
24+
const setInnerHTML: (
25+
node: Element,
26+
html: {valueOf(): {toString(): string, ...}, ...},
27+
) => void = createMicrosoftUnsafeLocalFunction(function(
2528
node: Element,
2629
html: {valueOf(): {toString(): string, ...}, ...},
2730
): void {

packages/react-dom-bindings/src/events/EventRegistry.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,19 @@ if (enableCreateEventHandleAPI) {
2121
/**
2222
* Mapping from registration name to event name
2323
*/
24-
export const registrationNameDependencies = {};
24+
export const registrationNameDependencies: {
25+
[registrationName: string]: Array<DOMEventName>,
26+
} = {};
2527

2628
/**
2729
* Mapping from lowercase registration names to the properly cased version,
2830
* used to warn in the case of missing event handlers. Available
2931
* only in __DEV__.
3032
* @type {Object}
3133
*/
32-
export const possibleRegistrationNames = __DEV__ ? {} : (null: any);
34+
export const possibleRegistrationNames: {
35+
[lowerCasedName: string]: string,
36+
} = __DEV__ ? {} : (null: any);
3337
// Trust the developer to only use possibleRegistrationNames in __DEV__
3438

3539
export function registerTwoPhaseEvent(

packages/react-dom-bindings/src/events/ReactDOMEventListener.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*/
99

1010
import type {AnyNativeEvent} from '../events/PluginModuleType';
11-
import type {FiberRoot} from 'react-reconciler/src/ReactInternalTypes';
11+
import type {Fiber, FiberRoot} from 'react-reconciler/src/ReactInternalTypes';
1212
import type {Container, SuspenseInstance} from '../client/ReactDOMHostConfig';
1313
import type {DOMEventName} from '../events/DOMEventNames';
1414
import {enableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay} from 'shared/ReactFeatureFlags';
@@ -58,15 +58,15 @@ import {isRootDehydrated} from 'react-reconciler/src/ReactFiberShellHydration';
5858
const {ReactCurrentBatchConfig} = ReactSharedInternals;
5959

6060
// TODO: can we stop exporting these?
61-
export let _enabled = true;
61+
export let _enabled: boolean = true;
6262

6363
// This is exported in FB builds for use by legacy FB layer infra.
6464
// We'd like to remove this but it's not clear if this is safe.
65-
export function setEnabled(enabled: ?boolean) {
65+
export function setEnabled(enabled: ?boolean): void {
6666
_enabled = !!enabled;
6767
}
6868

69-
export function isEnabled() {
69+
export function isEnabled(): boolean {
7070
return _enabled;
7171
}
7272

@@ -348,7 +348,7 @@ function dispatchEventWithEnableCapturePhaseSelectiveHydrationWithoutDiscreteEve
348348
);
349349
}
350350

351-
export let return_targetInst = null;
351+
export let return_targetInst: null | Fiber = null;
352352

353353
// Returns a SuspenseInstance or Container if it's blocked.
354354
// The return_targetInst field above is conceptually part of the return value.

0 commit comments

Comments
 (0)