mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Remove .js.flow files (#37311)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37311 Changelog: [Internal] - Remove js.flow files Reviewed By: yungsters Differential Revision: D45639737 fbshipit-source-id: 9069c0ac53e86b4f300d4f243817020ac7c3b5e4
This commit is contained in:
committed by
Facebook GitHub Bot
parent
68ce28a0ee
commit
ef7bd883ad
@@ -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;
|
||||
@@ -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<Props> {};
|
||||
@@ -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<ImageBackgroundProps> {}
|
||||
module.exports = ImageBackground;
|
||||
@@ -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<?$ReadOnly<{uri?: ?string, ...}>>,
|
||||
headers?: ?{[string]: string},
|
||||
defaultSrc?: ?string,
|
||||
loadingIndicatorSrc?: ?string,
|
||||
}>;
|
||||
|
||||
declare export default HostComponent<Props>;
|
||||
@@ -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<?$ReadOnly<{uri?: ?string, ...}>>,
|
||||
tintColor?: ?ColorValue,
|
||||
headers?: ?{[string]: string},
|
||||
}>;
|
||||
|
||||
declare export default HostComponent<NativeProps>;
|
||||
@@ -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<ItemT> = {|
|
||||
/**
|
||||
* 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<ItemT>>,
|
||||
|};
|
||||
type OptionalProps<ItemT> = {|
|
||||
renderItem?: ?RenderItemType<ItemT>,
|
||||
columnWrapperStyle?: ViewStyleProp,
|
||||
extraData?: any,
|
||||
getItemLayout?: (
|
||||
data: ?$ReadOnly<$ArrayLike<ItemT>>,
|
||||
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<ItemT> = {|
|
||||
...RequiredProps<ItemT>,
|
||||
...OptionalProps<ItemT>,
|
||||
|};
|
||||
|
||||
type VirtualizedListProps = React.ElementConfig<VirtualizedList>;
|
||||
|
||||
export type Props<ItemT> = {
|
||||
...$Diff<
|
||||
VirtualizedListProps,
|
||||
{
|
||||
getItem: $PropertyType<VirtualizedListProps, 'getItem'>,
|
||||
getItemCount: $PropertyType<VirtualizedListProps, 'getItemCount'>,
|
||||
getItemLayout: $PropertyType<VirtualizedListProps, 'getItemLayout'>,
|
||||
renderItem: $PropertyType<VirtualizedListProps, 'renderItem'>,
|
||||
keyExtractor: $PropertyType<VirtualizedListProps, 'keyExtractor'>,
|
||||
...
|
||||
},
|
||||
>,
|
||||
...FlatListProps<ItemT>,
|
||||
...
|
||||
};
|
||||
|
||||
declare class FlatList<ItemT> extends React.PureComponent<Props<ItemT>, 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<typeof View>
|
||||
| ?React.ElementRef<ScrollViewNativeComponent>;
|
||||
getScrollableNode(): any;
|
||||
setNativeProps(props: {[string]: mixed, ...}): void;
|
||||
}
|
||||
|
||||
module.exports = FlatList;
|
||||
Reference in New Issue
Block a user