Add LTI annotations to function params in xplat/js [1/2]

Summary: Add annotations to function parameters required for Flow's Local Type Inference project. This codemod prepares the codebase to match Flow's new typechecking algorithm. The new algorithm will make Flow more reliable and predicatable.

Reviewed By: evanyeung

Differential Revision: D37353648

fbshipit-source-id: e5a0c685ced85a8ff353d578b373f836b376bb28
This commit is contained in:
Pieter Vanderwerff authored and Facebook GitHub Bot committed 2022-06-22 21:36:52 -07:00
1 parent a7db8df207
commit e7a4dbcefc
74 files changed
+430 -182

No files matched your search

@@ -10,6 +10,11 @@
'use strict';
import type {
PressEvent,
ScrollEvent,
} from 'react-native/Libraries/Types/CoreEventTypes';
const BatchedBridge = require('react-native/Libraries/BatchedBridge/BatchedBridge');
const React = require('react');
@@ -26,8 +31,6 @@ const {ScrollListener} = NativeModules;
const NUM_ITEMS = 100;
import type {PressEvent} from 'react-native/Libraries/Types/CoreEventTypes';
// Shared by integration tests for ScrollView and HorizontalScrollView
let scrollViewApp: ScrollViewTestApp | HorizontalScrollViewTestApp;
@@ -61,28 +64,28 @@ const getInitialState = function () {
};
};
const onScroll = function (e) {
const onScroll = function (e: ScrollEvent) {
ScrollListener.onScroll(
e.nativeEvent.contentOffset.x,
e.nativeEvent.contentOffset.y,
);
};
const onScrollBeginDrag = function (e) {
const onScrollBeginDrag = function (e: ScrollEvent) {
ScrollListener.onScrollBeginDrag(
e.nativeEvent.contentOffset.x,
e.nativeEvent.contentOffset.y,
);
};
const onScrollEndDrag = function (e) {
const onScrollEndDrag = function (e: ScrollEvent) {
ScrollListener.onScrollEndDrag(
e.nativeEvent.contentOffset.x,
e.nativeEvent.contentOffset.y,
);
};
const onItemPress = function (itemNumber) {
const onItemPress = function (itemNumber: number) {
ScrollListener.onItemPress(itemNumber);
};