Manually fix types for LTI annotations in xplat/js

Summary:
This diff makes the manual changes necessary to fix many of the errors in the stacked diff codemod.

See https://fb.workplace.com/groups/flowlang/posts/917522612186736 for details on this effort.

Reviewed By: bradzacher

Differential Revision: D31615035

fbshipit-source-id: 179b2df516833d59873b9003350f81eb4a6b4e9d
This commit is contained in:
Evan Yeung 2021-11-10 15:38:09 -08:00 коммит произвёл Facebook GitHub Bot
Родитель f10741a946
Коммит 83a1791991
3 изменённых файлов: 18 добавлений и 5 удалений

Просмотреть файл

@ -15,6 +15,7 @@ const AnimatedWithChildren = require('./AnimatedWithChildren');
const InteractionManager = require('../../Interaction/InteractionManager');
const NativeAnimatedHelper = require('../NativeAnimatedHelper');
import type AnimatedNode from './AnimatedNode';
import type Animation, {EndCallback} from '../animations/Animation';
import type {InterpolationConfigType} from './AnimatedInterpolation';
import type AnimatedTracking from './AnimatedTracking';
@ -45,7 +46,7 @@ const NativeAnimatedAPI = NativeAnimatedHelper.API;
*/
function _flush(rootNode: AnimatedValue): void {
const animatedStyles = new Set();
function findAnimatedStyles(node) {
function findAnimatedStyles(node: AnimatedValue | AnimatedNode) {
/* $FlowFixMe[prop-missing] (>=0.68.0 site=react_native_fb) This comment
* suppresses an error found when Flow v0.68 was deployed. To see the error
* delete this comment and run Flow. */

Просмотреть файл

@ -15,7 +15,9 @@ import * as React from 'react';
import StyleSheet from '../StyleSheet/StyleSheet';
import flattenStyle from '../StyleSheet/flattenStyle';
import View from '../Components/View/View';
import type {HostComponent} from '../Renderer/shims/ReactNativeTypes';
import type {ImageBackgroundProps} from './ImageProps';
import type {ViewProps} from '../Components/View/ViewPropTypes';
/**
* Very simple drop-in replacement for <Image> which supports nesting views.
@ -52,7 +54,14 @@ class ImageBackground extends React.Component<ImageBackgroundProps> {
_viewRef: ?React.ElementRef<typeof View> = null;
_captureRef = ref => {
_captureRef = (
ref: null | React$ElementRef<
React$AbstractComponent<
ViewProps,
React.ElementRef<HostComponent<ViewProps>>,
>,
>,
) => {
this._viewRef = ref;
};

Просмотреть файл

@ -8,6 +8,7 @@
* @format
*/
import type {Message as MessageType} from '../Data/parseLogBoxLog';
import * as React from 'react';
import Image from '../../Image/Image';
import StyleSheet from '../../StyleSheet/StyleSheet';
@ -54,7 +55,9 @@ function LogBoxLogNotification(props: Props): React.Node {
);
}
function CountBadge(props) {
function CountBadge(
props: $TEMPORARY$object<{count: number, level: 'error' | 'warn'}>,
) {
return (
<View style={countStyles.outside}>
{/* $FlowFixMe[incompatible-type] (>=0.114.0) This suppression was added
@ -69,7 +72,7 @@ function CountBadge(props) {
);
}
function Message(props) {
function Message(props: $TEMPORARY$object<{message: MessageType}>) {
return (
<View style={messageStyles.container}>
<Text numberOfLines={1} style={messageStyles.text}>
@ -85,7 +88,7 @@ function Message(props) {
);
}
function DismissButton(props) {
function DismissButton(props: $TEMPORARY$object<{onPress: () => void}>) {
return (
<View style={dismissStyles.container}>
<LogBoxButton