diff --git a/packages/react-native/Libraries/Alert/Alert.js.flow b/packages/react-native/Libraries/Alert/Alert.js.flow deleted file mode 100644 index be6f948f557..00000000000 --- a/packages/react-native/Libraries/Alert/Alert.js.flow +++ /dev/null @@ -1,49 +0,0 @@ -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * @format - * @flow - */ - -export type AlertType = - | 'default' - | 'plain-text' - | 'secure-text' - | 'login-password'; -export type AlertButtonStyle = 'default' | 'cancel' | 'destructive'; -export type Buttons = Array<{ - text?: string, - onPress?: ?Function, - isPreferred?: boolean, - style?: AlertButtonStyle, - ... -}>; -type Options = { - cancelable?: ?boolean, - userInterfaceStyle?: 'unspecified' | 'light' | 'dark', - onDismiss?: ?() => void, - ... -}; - -declare class Alert { - static alert( - title: ?string, - message?: ?string, - buttons?: Buttons, - options?: Options, - ): void; - static prompt( - title: ?string, - message?: ?string, - callbackOrButtons?: ?(((text: string) => void) | Buttons), - type?: ?AlertType, - defaultValue?: string, - keyboardType?: string, - options?: Options, - ): void; -} - -module.exports = Alert; diff --git a/packages/react-native/Libraries/Components/TextInput/InputAccessoryView.js.flow b/packages/react-native/Libraries/Components/TextInput/InputAccessoryView.js.flow deleted file mode 100644 index e2245cb84d7..00000000000 --- a/packages/react-native/Libraries/Components/TextInput/InputAccessoryView.js.flow +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * @flow - * @format - */ - -import * as React from 'react'; -import Platform from '../../Utilities/Platform'; -import StyleSheet, { - type ViewStyleProp, - type ColorValue, -} from '../../StyleSheet/StyleSheet'; - -type Props = $ReadOnly<{| - +children: React.Node, - nativeID?: ?string, - style?: ?ViewStyleProp, - backgroundColor?: ?ColorValue, -|}>; - -module.exports = class InputAccessoryView extends React.Component {}; diff --git a/packages/react-native/Libraries/Image/ImageBackground.js.flow b/packages/react-native/Libraries/Image/ImageBackground.js.flow deleted file mode 100644 index ad91f1a4e78..00000000000 --- a/packages/react-native/Libraries/Image/ImageBackground.js.flow +++ /dev/null @@ -1,17 +0,0 @@ -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * @flow - * @format - */ - -'use strict'; - -import * as React from 'react'; -import type {ImageBackgroundProps} from './ImageProps'; - -declare class ImageBackground extends React.Component {} -module.exports = ImageBackground; diff --git a/packages/react-native/Libraries/Image/ImageViewNativeComponent.js.flow b/packages/react-native/Libraries/Image/ImageViewNativeComponent.js.flow deleted file mode 100644 index 4bb29f02141..00000000000 --- a/packages/react-native/Libraries/Image/ImageViewNativeComponent.js.flow +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * @flow strict-local - * @format - */ - -import type {ResolvedAssetSource} from './AssetSourceResolver'; -import type {ImageProps} from './ImageProps'; -import type {ViewProps} from '../Components/View/ViewPropTypes'; -import {ConditionallyIgnoredEventHandlers} from '../NativeComponent/ViewConfigIgnore'; -import type {HostComponent} from '../Renderer/shims/ReactNativeTypes'; -import type { - ColorValue, - DangerouslyImpreciseStyle, - ImageStyleProp, -} from '../StyleSheet/StyleSheet'; -import Platform from '../Utilities/Platform'; - -type Props = $ReadOnly<{ - ...ImageProps, - ...ViewProps, - - style?: ImageStyleProp | DangerouslyImpreciseStyle, - - // iOS native props - tintColor?: ColorValue, - - // Android native props - shouldNotifyLoadEvents?: boolean, - src?: - | ?ResolvedAssetSource - | ?$ReadOnlyArray>, - headers?: ?{[string]: string}, - defaultSrc?: ?string, - loadingIndicatorSrc?: ?string, -}>; - -declare export default HostComponent; diff --git a/packages/react-native/Libraries/Image/TextInlineImageNativeComponent.js.flow b/packages/react-native/Libraries/Image/TextInlineImageNativeComponent.js.flow deleted file mode 100644 index 6726b15d47a..00000000000 --- a/packages/react-native/Libraries/Image/TextInlineImageNativeComponent.js.flow +++ /dev/null @@ -1,27 +0,0 @@ -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * @format - * @flow strict-local - */ - -'use strict'; - -import type {HostComponent} from '../Renderer/shims/ReactNativeTypes'; -import type {ViewProps} from '../Components/View/ViewPropTypes'; -import type {ImageResizeMode} from './ImageResizeMode'; -import * as NativeComponentRegistry from '../NativeComponent/NativeComponentRegistry'; -import type {ColorValue} from '../StyleSheet/StyleSheet'; - -type NativeProps = $ReadOnly<{ - ...ViewProps, - resizeMode?: ?ImageResizeMode, - src?: ?$ReadOnlyArray>, - tintColor?: ?ColorValue, - headers?: ?{[string]: string}, -}>; - -declare export default HostComponent; diff --git a/packages/react-native/Libraries/Lists/FlatList.js.flow b/packages/react-native/Libraries/Lists/FlatList.js.flow deleted file mode 100644 index 7228c75461c..00000000000 --- a/packages/react-native/Libraries/Lists/FlatList.js.flow +++ /dev/null @@ -1,116 +0,0 @@ -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * @flow - * @format - */ - -const React = require('react'); -const View = require('../Components/View/View'); - -import typeof ScrollViewNativeComponent from '../Components/ScrollView/ScrollViewNativeComponent'; -import {type ScrollResponderType} from '../Components/ScrollView/ScrollView'; -import type {ViewStyleProp} from '../StyleSheet/StyleSheet'; -import type { - RenderItemType, - RenderItemProps, - ViewToken, - ViewabilityConfigCallbackPair, -} from '@react-native/virtualized-lists'; -import {typeof VirtualizedList} from '@react-native/virtualized-lists'; - -type RequiredProps = {| - /** - * For simplicity, data is just a plain array. If you want to use something else, like an - * immutable list, use the underlying `VirtualizedList` directly. - */ - data: ?$ReadOnly<$ArrayLike>, -|}; -type OptionalProps = {| - renderItem?: ?RenderItemType, - columnWrapperStyle?: ViewStyleProp, - extraData?: any, - getItemLayout?: ( - data: ?$ReadOnly<$ArrayLike>, - index: number, - ) => { - length: number, - offset: number, - index: number, - ... - }, - horizontal?: ?boolean, - initialNumToRender?: ?number, - initialScrollIndex?: ?number, - inverted?: ?boolean, - keyExtractor?: ?(item: ItemT, index: number) => string, - numColumns?: number, - removeClippedSubviews?: boolean, - fadingEdgeLength?: ?number, - strictMode?: boolean, -|}; - -/** - * Default Props Helper Functions - * Use the following helper functions for default values - */ -type FlatListProps = {| - ...RequiredProps, - ...OptionalProps, -|}; - -type VirtualizedListProps = React.ElementConfig; - -export type Props = { - ...$Diff< - VirtualizedListProps, - { - getItem: $PropertyType, - getItemCount: $PropertyType, - getItemLayout: $PropertyType, - renderItem: $PropertyType, - keyExtractor: $PropertyType, - ... - }, - >, - ...FlatListProps, - ... -}; - -declare class FlatList extends React.PureComponent, void> { - scrollToEnd(params?: ?{animated?: ?boolean, ...}): void; - - scrollToIndex(params: { - animated?: ?boolean, - index: number, - viewOffset?: number, - viewPosition?: number, - ... - }): void; - scrollToItem(params: { - animated?: ?boolean, - item: ItemT, - viewPosition?: number, - ... - }): void; - scrollToOffset(params: {animated?: ?boolean, offset: number, ...}): void; - recordInteraction(): void; - - /** - * Displays the scroll indicators momentarily. - * - * @platform ios - */ - flashScrollIndicators(): void; - getScrollResponder(): ?ScrollResponderType; - getNativeScrollRef(): - | ?React.ElementRef - | ?React.ElementRef; - getScrollableNode(): any; - setNativeProps(props: {[string]: mixed, ...}): void; -} - -module.exports = FlatList;