2015-02-20 07:10:52 +03:00
|
|
|
/**
|
2018-09-12 01:27:47 +03:00
|
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
2015-03-23 23:35:08 +03:00
|
|
|
*
|
2018-02-17 05:24:55 +03:00
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree.
|
2015-02-20 07:10:52 +03:00
|
|
|
*
|
2018-05-11 05:06:46 +03:00
|
|
|
* @format
|
2017-04-05 20:16:30 +03:00
|
|
|
* @flow
|
2015-02-20 07:10:52 +03:00
|
|
|
*/
|
2018-05-11 05:06:46 +03:00
|
|
|
|
2015-02-20 07:10:52 +03:00
|
|
|
'use strict';
|
|
|
|
|
2019-09-12 13:26:46 +03:00
|
|
|
import typeof AccessibilityInfo from './Libraries/Components/AccessibilityInfo/AccessibilityInfo';
|
|
|
|
import typeof ActivityIndicator from './Libraries/Components/ActivityIndicator/ActivityIndicator';
|
|
|
|
import typeof Button from './Libraries/Components/Button';
|
|
|
|
import typeof CheckBox from './Libraries/Components/CheckBox/CheckBox';
|
|
|
|
import typeof DatePickerIOS from './Libraries/Components/DatePicker/DatePickerIOS';
|
|
|
|
import typeof DrawerLayoutAndroid from './Libraries/Components/DrawerAndroid/DrawerLayoutAndroid';
|
|
|
|
import typeof FlatList from './Libraries/Lists/FlatList';
|
|
|
|
import typeof Image from './Libraries/Image/Image';
|
|
|
|
import typeof ImageBackground from './Libraries/Image/ImageBackground';
|
|
|
|
import typeof InputAccessoryView from './Libraries/Components/TextInput/InputAccessoryView';
|
|
|
|
import typeof KeyboardAvoidingView from './Libraries/Components/Keyboard/KeyboardAvoidingView';
|
|
|
|
import typeof MaskedViewIOS from './Libraries/Components/MaskedView/MaskedViewIOS';
|
|
|
|
import typeof Modal from './Libraries/Modal/Modal';
|
|
|
|
import typeof Picker from './Libraries/Components/Picker/Picker';
|
|
|
|
import typeof PickerIOS from './Libraries/Components/Picker/PickerIOS';
|
|
|
|
import typeof ProgressBarAndroid from './Libraries/Components/ProgressBarAndroid/ProgressBarAndroid';
|
|
|
|
import typeof ProgressViewIOS from './Libraries/Components/ProgressViewIOS/ProgressViewIOS';
|
|
|
|
import typeof SafeAreaView from './Libraries/Components/SafeAreaView/SafeAreaView';
|
|
|
|
import typeof ScrollView from './Libraries/Components/ScrollView/ScrollView';
|
|
|
|
import typeof SectionList from './Libraries/Lists/SectionList';
|
|
|
|
import typeof SegmentedControlIOS from './Libraries/Components/SegmentedControlIOS/SegmentedControlIOS';
|
|
|
|
import typeof Slider from './Libraries/Components/Slider/Slider';
|
|
|
|
import typeof Switch from './Libraries/Components/Switch/Switch';
|
|
|
|
import typeof RefreshControl from './Libraries/Components/RefreshControl/RefreshControl';
|
|
|
|
import typeof StatusBar from './Libraries/Components/StatusBar/StatusBar';
|
|
|
|
import typeof Text from './Libraries/Text/Text';
|
|
|
|
import typeof TextInput from './Libraries/Components/TextInput/TextInput';
|
|
|
|
import typeof Touchable from './Libraries/Components/Touchable/Touchable';
|
|
|
|
import typeof TouchableHighlight from './Libraries/Components/Touchable/TouchableHighlight';
|
|
|
|
import typeof TouchableNativeFeedback from './Libraries/Components/Touchable/TouchableNativeFeedback';
|
|
|
|
import typeof TouchableOpacity from './Libraries/Components/Touchable/TouchableOpacity';
|
|
|
|
import typeof TouchableWithoutFeedback from './Libraries/Components/Touchable/TouchableWithoutFeedback';
|
|
|
|
import typeof View from './Libraries/Components/View/View';
|
|
|
|
import typeof VirtualizedList from './Libraries/Lists/VirtualizedList';
|
|
|
|
import typeof VirtualizedSectionList from './Libraries/Lists/VirtualizedSectionList';
|
|
|
|
import typeof ActionSheetIOS from './Libraries/ActionSheetIOS/ActionSheetIOS';
|
|
|
|
import typeof Alert from './Libraries/Alert/Alert';
|
|
|
|
import typeof Animated from './Libraries/Animated/src/Animated';
|
|
|
|
import typeof Appearance from './Libraries/Utilities/Appearance';
|
|
|
|
import typeof AppRegistry from './Libraries/ReactNative/AppRegistry';
|
|
|
|
import typeof AppState from './Libraries/AppState/AppState';
|
|
|
|
import typeof AsyncStorage from './Libraries/Storage/AsyncStorage';
|
|
|
|
import typeof BackHandler from './Libraries/Utilities/BackHandler';
|
|
|
|
import typeof Clipboard from './Libraries/Components/Clipboard/Clipboard';
|
|
|
|
import typeof DatePickerAndroid from './Libraries/Components/DatePickerAndroid/DatePickerAndroid';
|
|
|
|
import typeof DeviceInfo from './Libraries/Utilities/DeviceInfo';
|
2019-09-17 16:36:17 +03:00
|
|
|
import typeof DevSettings from './Libraries/Utilities/DevSettings';
|
2019-09-12 13:26:46 +03:00
|
|
|
import typeof Dimensions from './Libraries/Utilities/Dimensions';
|
|
|
|
import typeof Easing from './Libraries/Animated/src/Easing';
|
|
|
|
import typeof ReactNative from './Libraries/Renderer/shims/ReactNative';
|
|
|
|
import typeof I18nManager from './Libraries/ReactNative/I18nManager';
|
|
|
|
import typeof ImagePickerIOS from './Libraries/Image/ImagePickerIOS';
|
|
|
|
import typeof InteractionManager from './Libraries/Interaction/InteractionManager';
|
|
|
|
import typeof Keyboard from './Libraries/Components/Keyboard/Keyboard';
|
|
|
|
import typeof LayoutAnimation from './Libraries/LayoutAnimation/LayoutAnimation';
|
|
|
|
import typeof Linking from './Libraries/Linking/Linking';
|
|
|
|
import typeof NativeDialogManagerAndroid from './Libraries/NativeModules/specs/NativeDialogManagerAndroid';
|
|
|
|
import typeof NativeEventEmitter from './Libraries/EventEmitter/NativeEventEmitter';
|
|
|
|
import typeof Networking from './Libraries/Network/RCTNetworking';
|
|
|
|
import typeof PanResponder from './Libraries/Interaction/PanResponder';
|
|
|
|
import typeof PermissionsAndroid from './Libraries/PermissionsAndroid/PermissionsAndroid';
|
|
|
|
import typeof PixelRatio from './Libraries/Utilities/PixelRatio';
|
|
|
|
import typeof PushNotificationIOS from './Libraries/PushNotificationIOS/PushNotificationIOS';
|
|
|
|
import typeof Settings from './Libraries/Settings/Settings';
|
|
|
|
import typeof Share from './Libraries/Share/Share';
|
|
|
|
import typeof StatusBarIOS from './Libraries/Components/StatusBar/StatusBarIOS';
|
|
|
|
import typeof StyleSheet from './Libraries/StyleSheet/StyleSheet';
|
|
|
|
import typeof Systrace from './Libraries/Performance/Systrace';
|
|
|
|
import typeof ToastAndroid from './Libraries/Components/ToastAndroid/ToastAndroid';
|
|
|
|
import typeof * as TurboModuleRegistry from './Libraries/TurboModule/TurboModuleRegistry';
|
|
|
|
import typeof TVEventHandler from './Libraries/Components/AppleTV/TVEventHandler';
|
|
|
|
import typeof UIManager from './Libraries/ReactNative/UIManager';
|
|
|
|
import typeof useColorScheme from './Libraries/Utilities/useColorScheme';
|
|
|
|
import typeof useWindowDimensions from './Libraries/Utilities/useWindowDimensions';
|
|
|
|
import typeof UTFSequence from './Libraries/UTFSequence';
|
|
|
|
import typeof Vibration from './Libraries/Vibration/Vibration';
|
|
|
|
import typeof YellowBox from './Libraries/YellowBox/YellowBox';
|
|
|
|
import typeof RCTDeviceEventEmitter from './Libraries/EventEmitter/RCTDeviceEventEmitter';
|
|
|
|
import typeof RCTNativeAppEventEmitter from './Libraries/EventEmitter/RCTNativeAppEventEmitter';
|
|
|
|
import typeof NativeModules from './Libraries/BatchedBridge/NativeModules';
|
|
|
|
import typeof Platform from './Libraries/Utilities/Platform';
|
|
|
|
import typeof processColor from './Libraries/StyleSheet/processColor';
|
|
|
|
import typeof RootTagContext from './Libraries/ReactNative/RootTagContext';
|
|
|
|
import typeof DeprecatedColorPropType from './Libraries/DeprecatedPropTypes/DeprecatedColorPropType';
|
|
|
|
import typeof DeprecatedEdgeInsetsPropType from './Libraries/DeprecatedPropTypes/DeprecatedEdgeInsetsPropType';
|
|
|
|
import typeof DeprecatedPointPropType from './Libraries/DeprecatedPropTypes/DeprecatedPointPropType';
|
|
|
|
import typeof DeprecatedViewPropTypes from './Libraries/DeprecatedPropTypes/DeprecatedViewPropTypes';
|
2019-08-22 05:00:41 +03:00
|
|
|
|
2019-11-08 22:41:57 +03:00
|
|
|
import type {HostComponent as _HostComponentInternal} from './Libraries/Renderer/shims/ReactNativeTypes';
|
2019-09-25 21:42:07 +03:00
|
|
|
|
2019-11-08 22:41:57 +03:00
|
|
|
export type HostComponent<T> = _HostComponentInternal<T>;
|
2019-09-25 20:10:48 +03:00
|
|
|
|
2018-12-03 10:49:12 +03:00
|
|
|
const invariant = require('invariant');
|
2019-09-12 13:26:46 +03:00
|
|
|
const warnOnce = require('./Libraries/Utilities/warnOnce');
|
2018-10-10 02:20:13 +03:00
|
|
|
|
2018-10-18 08:17:01 +03:00
|
|
|
module.exports = {
|
2015-03-18 20:06:01 +03:00
|
|
|
// Components
|
2019-08-22 05:00:41 +03:00
|
|
|
get AccessibilityInfo(): AccessibilityInfo {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/Components/AccessibilityInfo/AccessibilityInfo');
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get ActivityIndicator(): ActivityIndicator {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/Components/ActivityIndicator/ActivityIndicator');
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get Button(): Button {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/Components/Button');
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get CheckBox(): CheckBox {
|
2019-03-23 01:55:59 +03:00
|
|
|
warnOnce(
|
|
|
|
'checkBox-moved',
|
|
|
|
'CheckBox has been extracted from react-native core and will be removed in a future release. ' +
|
|
|
|
"It can now be installed and imported from '@react-native-community/checkbox' instead of 'react-native'. " +
|
|
|
|
'See https://github.com/react-native-community/react-native-checkbox',
|
|
|
|
);
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/Components/CheckBox/CheckBox');
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get DatePickerIOS(): DatePickerIOS {
|
2019-06-25 12:33:07 +03:00
|
|
|
warnOnce(
|
|
|
|
'DatePickerIOS-merged',
|
|
|
|
'DatePickerIOS has been merged with DatePickerAndroid and will be removed in a future release. ' +
|
|
|
|
"It can now be installed and imported from '@react-native-community/datetimepicker' instead of 'react-native'. " +
|
|
|
|
'See https://github.com/react-native-community/react-native-datetimepicker',
|
|
|
|
);
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/Components/DatePicker/DatePickerIOS');
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get DrawerLayoutAndroid(): DrawerLayoutAndroid {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/Components/DrawerAndroid/DrawerLayoutAndroid');
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get FlatList(): FlatList {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/Lists/FlatList');
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get Image(): Image {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/Image/Image');
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get ImageBackground(): ImageBackground {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/Image/ImageBackground');
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get InputAccessoryView(): InputAccessoryView {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/Components/TextInput/InputAccessoryView');
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get KeyboardAvoidingView(): KeyboardAvoidingView {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/Components/Keyboard/KeyboardAvoidingView');
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get MaskedViewIOS(): MaskedViewIOS {
|
2019-02-12 18:10:43 +03:00
|
|
|
warnOnce(
|
|
|
|
'maskedviewios-moved',
|
|
|
|
'MaskedViewIOS has been extracted from react-native core and will be removed in a future release. ' +
|
|
|
|
"It can now be installed and imported from '@react-native-community/masked-view' instead of 'react-native'. " +
|
|
|
|
'See https://github.com/react-native-community/react-native-masked-view',
|
|
|
|
);
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/Components/MaskedView/MaskedViewIOS');
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get Modal(): Modal {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/Modal/Modal');
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get Picker(): Picker {
|
2019-09-11 18:02:33 +03:00
|
|
|
warnOnce(
|
|
|
|
'picker-moved',
|
|
|
|
'Picker has been extracted from react-native core and will be removed in a future release. ' +
|
|
|
|
"It can now be installed and imported from '@react-native-community/picker' instead of 'react-native'. " +
|
|
|
|
'See https://github.com/react-native-community/react-native-picker',
|
|
|
|
);
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/Components/Picker/Picker');
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get PickerIOS(): PickerIOS {
|
2019-09-11 18:02:33 +03:00
|
|
|
warnOnce(
|
|
|
|
'pickerios-moved',
|
|
|
|
'PickerIOS has been extracted from react-native core and will be removed in a future release. ' +
|
|
|
|
"It can now be installed and imported from '@react-native-community/picker' instead of 'react-native'. " +
|
|
|
|
'See https://github.com/react-native-community/react-native-picker',
|
|
|
|
);
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/Components/Picker/PickerIOS');
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get ProgressBarAndroid(): ProgressBarAndroid {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/Components/ProgressBarAndroid/ProgressBarAndroid');
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get ProgressViewIOS(): ProgressViewIOS {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/Components/ProgressViewIOS/ProgressViewIOS');
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get SafeAreaView(): SafeAreaView {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/Components/SafeAreaView/SafeAreaView');
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get ScrollView(): ScrollView {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/Components/ScrollView/ScrollView');
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get SectionList(): SectionList {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/Lists/SectionList');
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get SegmentedControlIOS(): SegmentedControlIOS {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/Components/SegmentedControlIOS/SegmentedControlIOS');
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get Slider(): Slider {
|
2019-02-12 00:31:34 +03:00
|
|
|
warnOnce(
|
|
|
|
'slider-moved',
|
|
|
|
'Slider has been extracted from react-native core and will be removed in a future release. ' +
|
|
|
|
"It can now be installed and imported from '@react-native-community/slider' instead of 'react-native'. " +
|
|
|
|
'See https://github.com/react-native-community/react-native-slider',
|
|
|
|
);
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/Components/Slider/Slider');
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get Switch(): Switch {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/Components/Switch/Switch');
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get RefreshControl(): RefreshControl {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/Components/RefreshControl/RefreshControl');
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get StatusBar(): StatusBar {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/Components/StatusBar/StatusBar');
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get Text(): Text {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/Text/Text');
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get TextInput(): TextInput {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/Components/TextInput/TextInput');
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get Touchable(): Touchable {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/Components/Touchable/Touchable');
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get TouchableHighlight(): TouchableHighlight {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/Components/Touchable/TouchableHighlight');
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get TouchableNativeFeedback(): TouchableNativeFeedback {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/Components/Touchable/TouchableNativeFeedback');
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get TouchableOpacity(): TouchableOpacity {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/Components/Touchable/TouchableOpacity');
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get TouchableWithoutFeedback(): TouchableWithoutFeedback {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/Components/Touchable/TouchableWithoutFeedback');
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get View(): View {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/Components/View/View');
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get VirtualizedList(): VirtualizedList {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/Lists/VirtualizedList');
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get VirtualizedSectionList(): VirtualizedSectionList {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/Lists/VirtualizedSectionList');
|
2019-04-18 21:52:26 +03:00
|
|
|
},
|
2015-03-18 20:06:01 +03:00
|
|
|
|
|
|
|
// APIs
|
2019-08-22 05:00:41 +03:00
|
|
|
get ActionSheetIOS(): ActionSheetIOS {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/ActionSheetIOS/ActionSheetIOS');
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get Alert(): Alert {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/Alert/Alert');
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get Animated(): Animated {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/Animated/src/Animated');
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2019-08-31 03:06:03 +03:00
|
|
|
get Appearance(): Appearance {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/Utilities/Appearance');
|
2019-08-31 03:06:03 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get AppRegistry(): AppRegistry {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/ReactNative/AppRegistry');
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get AppState(): AppState {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/AppState/AppState');
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get AsyncStorage(): AsyncStorage {
|
2019-02-12 00:29:30 +03:00
|
|
|
warnOnce(
|
|
|
|
'async-storage-moved',
|
2019-07-01 20:42:48 +03:00
|
|
|
'AsyncStorage has been extracted from react-native core and will be removed in a future release. ' +
|
2019-02-12 00:29:30 +03:00
|
|
|
"It can now be installed and imported from '@react-native-community/async-storage' instead of 'react-native'. " +
|
|
|
|
'See https://github.com/react-native-community/react-native-async-storage',
|
|
|
|
);
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/Storage/AsyncStorage');
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get BackHandler(): BackHandler {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/Utilities/BackHandler');
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get Clipboard(): Clipboard {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/Components/Clipboard/Clipboard');
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get DatePickerAndroid(): DatePickerAndroid {
|
2019-06-25 12:33:07 +03:00
|
|
|
warnOnce(
|
|
|
|
'DatePickerAndroid-merged',
|
|
|
|
'DatePickerAndroid has been merged with DatePickerIOS and will be removed in a future release. ' +
|
|
|
|
"It can now be installed and imported from '@react-native-community/datetimepicker' instead of 'react-native'. " +
|
|
|
|
'See https://github.com/react-native-community/react-native-datetimepicker',
|
|
|
|
);
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/Components/DatePickerAndroid/DatePickerAndroid');
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get DeviceInfo(): DeviceInfo {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/Utilities/DeviceInfo');
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2019-09-17 16:36:17 +03:00
|
|
|
get DevSettings(): DevSettings {
|
|
|
|
return require('./Libraries/Utilities/DevSettings');
|
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get Dimensions(): Dimensions {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/Utilities/Dimensions');
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get Easing(): Easing {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/Animated/src/Easing');
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get findNodeHandle(): $PropertyType<ReactNative, 'findNodeHandle'> {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/Renderer/shims/ReactNative').findNodeHandle;
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get I18nManager(): I18nManager {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/ReactNative/I18nManager');
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get ImagePickerIOS(): ImagePickerIOS {
|
2019-05-30 12:51:49 +03:00
|
|
|
warnOnce(
|
|
|
|
'imagePickerIOS-moved',
|
|
|
|
'ImagePickerIOS has been extracted from react-native core and will be removed in a future release. ' +
|
|
|
|
"Please upgrade to use either '@react-native-community/react-native-image-picker' or 'expo-image-picker'. " +
|
|
|
|
"If you cannot upgrade to a different library, please install the deprecated '@react-native-community/image-picker-ios' package. " +
|
|
|
|
'See https://github.com/react-native-community/react-native-image-picker-ios',
|
|
|
|
);
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/Image/ImagePickerIOS');
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get InteractionManager(): InteractionManager {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/Interaction/InteractionManager');
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get Keyboard(): Keyboard {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/Components/Keyboard/Keyboard');
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get LayoutAnimation(): LayoutAnimation {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/LayoutAnimation/LayoutAnimation');
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get Linking(): Linking {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/Linking/Linking');
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get NativeDialogManagerAndroid(): NativeDialogManagerAndroid {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/NativeModules/specs/NativeDialogManagerAndroid')
|
|
|
|
.default;
|
2019-05-23 04:19:10 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get NativeEventEmitter(): NativeEventEmitter {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/EventEmitter/NativeEventEmitter');
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
Expose RCTNetworking as a public 'Networking' API (#25718)
Summary:
This PR introduces the `EventSource` web standard as a first-class networking feature in React Native. In the discussion we had in February at https://github.com/react-native-community/discussions-and-proposals/issues/99, cpojer indicated that the RN maintainers would be willing to accept a PR to offer this functionality.
The linked discussion goes into detail about why this change must happen in React Native Core as opposed to a community library, but the tl;dr is that `XmlHttpRequest` doesn't let you do streaming in a resource-efficient way, since it holds onto the entire response buffer until the request is complete. When processing a stream that might last for a long time, that's not ideal since there might be a lot of data in that buffer that is now useless to maintain.
For more information about EventSource and server-sent events, check out these links:
* [EventSource on MDN](https://developer.mozilla.org/en-US/docs/Web/API/EventSource)
* [Using server-sent events on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events)
* [WHATWG spec for server-sent events](https://html.spec.whatwg.org/multipage/server-sent-events.html)
I've tried as best as I can to satisfy the linked specification so that this is as standard as possible.
One of the projects I maintain has an ideal use case for this feature. The SDK for MongoDB Stitch (a backend-as-a-service for the MongoDB database) has the ability to open a "change stream" to watch for changes that happen on a database. However, in our JavaScript SDK, this feature depends on `EventSource`, because the backend service implements the one-way streaming protocol with server-sent events. We know there is demand for this feature because users have requested it: https://github.com/mongodb/stitch-js-sdk/issues/209.
If this PR will be accepted, I am happy to update the `Networking` documentation at https://facebook.github.io/react-native/docs/network
## Changelog
[JavaScript] [Added] Implements the `EventSource` web standard in `Libraries/Networking`
[JavaScript] [Added] Exposes the `EventSource` implementation in `Libraries/Core/setUpXHR.js`
Pull Request resolved: https://github.com/facebook/react-native/pull/25718
Test Plan:
To test the `EventSource` implementation, I added a comprehensive set of unit tests that cover the basic functionality, as well as edge cases that are laid out in the spec. See `EventSource-test.js` for the cases that the tests handles. For convenience, I've also included the test descriptions as produced by the `jest` test output here.
```
PASS Libraries/Network/__tests__/EventSource-test.js
EventSource
✓ should pass along the correct request parameters (527ms)
✓ should transition readyState correctly for successful requests (4ms)
✓ should call onerror function when server responds with an HTTP error (2ms)
✓ should call onerror on non event-stream responses (1ms)
✓ should call onerror function when request times out (1ms)
✓ should call onerror if connection cannot be established (1ms)
✓ should call onopen function when stream is opened (1ms)
✓ should follow HTTP redirects (2ms)
✓ should call onmessage when receiving an unnamed event (2ms)
✓ should handle events with multiple lines of data (1ms)
✓ should call appropriate handler when receiving a named event (1ms)
✓ should receive multiple events (1ms)
✓ should handle messages sent in separate chunks (1ms)
✓ should forward server-sent errors
✓ should ignore comment lines (1ms)
✓ should properly set lastEventId based on server message (1ms)
✓ should properly set reconnect interval based on server message
✓ should handle messages with non-ASCII characters (1ms)
✓ should properly pass along withCredentials option (3ms)
✓ should properly pass along extra headers (1ms)
✓ should properly pass along configured lastEventId (2ms)
✓ should reconnect gracefully and properly pass lastEventId (9ms)
✓ should stop attempting to reconnect after five failed attempts (2ms)
```
As a manual E2E test, I also added streaming support to the Stitch React Native SDK, and tested it with my React Native EventSource implementation, and confirmed that our `EventSource`-based streaming implementation worked with this `EventSource` implementation.
* Source code for E2E app test: https://gist.github.com/adamchel/6db456c1a851ed7dd20b54f6db3a6759
* PR for streaming support on our React Native SDK: https://github.com/mongodb/stitch-js-sdk/pull/294
* Very brief video demonstrating E2E functionality: https://youtu.be/-OoIpkAxmcw
Differential Revision: D17283890
Pulled By: cpojer
fbshipit-source-id: 0e9e079bdb2d795dd0b6fa8a9a9fa1e840245a51
2019-09-11 13:22:09 +03:00
|
|
|
get Networking(): Networking {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/Network/RCTNetworking');
|
Expose RCTNetworking as a public 'Networking' API (#25718)
Summary:
This PR introduces the `EventSource` web standard as a first-class networking feature in React Native. In the discussion we had in February at https://github.com/react-native-community/discussions-and-proposals/issues/99, cpojer indicated that the RN maintainers would be willing to accept a PR to offer this functionality.
The linked discussion goes into detail about why this change must happen in React Native Core as opposed to a community library, but the tl;dr is that `XmlHttpRequest` doesn't let you do streaming in a resource-efficient way, since it holds onto the entire response buffer until the request is complete. When processing a stream that might last for a long time, that's not ideal since there might be a lot of data in that buffer that is now useless to maintain.
For more information about EventSource and server-sent events, check out these links:
* [EventSource on MDN](https://developer.mozilla.org/en-US/docs/Web/API/EventSource)
* [Using server-sent events on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events)
* [WHATWG spec for server-sent events](https://html.spec.whatwg.org/multipage/server-sent-events.html)
I've tried as best as I can to satisfy the linked specification so that this is as standard as possible.
One of the projects I maintain has an ideal use case for this feature. The SDK for MongoDB Stitch (a backend-as-a-service for the MongoDB database) has the ability to open a "change stream" to watch for changes that happen on a database. However, in our JavaScript SDK, this feature depends on `EventSource`, because the backend service implements the one-way streaming protocol with server-sent events. We know there is demand for this feature because users have requested it: https://github.com/mongodb/stitch-js-sdk/issues/209.
If this PR will be accepted, I am happy to update the `Networking` documentation at https://facebook.github.io/react-native/docs/network
## Changelog
[JavaScript] [Added] Implements the `EventSource` web standard in `Libraries/Networking`
[JavaScript] [Added] Exposes the `EventSource` implementation in `Libraries/Core/setUpXHR.js`
Pull Request resolved: https://github.com/facebook/react-native/pull/25718
Test Plan:
To test the `EventSource` implementation, I added a comprehensive set of unit tests that cover the basic functionality, as well as edge cases that are laid out in the spec. See `EventSource-test.js` for the cases that the tests handles. For convenience, I've also included the test descriptions as produced by the `jest` test output here.
```
PASS Libraries/Network/__tests__/EventSource-test.js
EventSource
✓ should pass along the correct request parameters (527ms)
✓ should transition readyState correctly for successful requests (4ms)
✓ should call onerror function when server responds with an HTTP error (2ms)
✓ should call onerror on non event-stream responses (1ms)
✓ should call onerror function when request times out (1ms)
✓ should call onerror if connection cannot be established (1ms)
✓ should call onopen function when stream is opened (1ms)
✓ should follow HTTP redirects (2ms)
✓ should call onmessage when receiving an unnamed event (2ms)
✓ should handle events with multiple lines of data (1ms)
✓ should call appropriate handler when receiving a named event (1ms)
✓ should receive multiple events (1ms)
✓ should handle messages sent in separate chunks (1ms)
✓ should forward server-sent errors
✓ should ignore comment lines (1ms)
✓ should properly set lastEventId based on server message (1ms)
✓ should properly set reconnect interval based on server message
✓ should handle messages with non-ASCII characters (1ms)
✓ should properly pass along withCredentials option (3ms)
✓ should properly pass along extra headers (1ms)
✓ should properly pass along configured lastEventId (2ms)
✓ should reconnect gracefully and properly pass lastEventId (9ms)
✓ should stop attempting to reconnect after five failed attempts (2ms)
```
As a manual E2E test, I also added streaming support to the Stitch React Native SDK, and tested it with my React Native EventSource implementation, and confirmed that our `EventSource`-based streaming implementation worked with this `EventSource` implementation.
* Source code for E2E app test: https://gist.github.com/adamchel/6db456c1a851ed7dd20b54f6db3a6759
* PR for streaming support on our React Native SDK: https://github.com/mongodb/stitch-js-sdk/pull/294
* Very brief video demonstrating E2E functionality: https://youtu.be/-OoIpkAxmcw
Differential Revision: D17283890
Pulled By: cpojer
fbshipit-source-id: 0e9e079bdb2d795dd0b6fa8a9a9fa1e840245a51
2019-09-11 13:22:09 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get PanResponder(): PanResponder {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/Interaction/PanResponder');
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get PermissionsAndroid(): PermissionsAndroid {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/PermissionsAndroid/PermissionsAndroid');
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get PixelRatio(): PixelRatio {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/Utilities/PixelRatio');
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get PushNotificationIOS(): PushNotificationIOS {
|
2019-02-13 00:38:10 +03:00
|
|
|
warnOnce(
|
|
|
|
'pushNotificationIOS-moved',
|
|
|
|
'PushNotificationIOS has been extracted from react-native core and will be removed in a future release. ' +
|
|
|
|
"It can now be installed and imported from '@react-native-community/push-notification-ios' instead of 'react-native'. " +
|
|
|
|
'See https://github.com/react-native-community/react-native-push-notification-ios',
|
|
|
|
);
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/PushNotificationIOS/PushNotificationIOS');
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get Settings(): Settings {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/Settings/Settings');
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get Share(): Share {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/Share/Share');
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get StatusBarIOS(): StatusBarIOS {
|
2019-06-24 11:46:02 +03:00
|
|
|
warnOnce(
|
|
|
|
'StatusBarIOS-merged',
|
|
|
|
'StatusBarIOS has been merged with StatusBar and will be removed in a future release. Use StatusBar for mutating the status bar',
|
|
|
|
);
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/Components/StatusBar/StatusBarIOS');
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get StyleSheet(): StyleSheet {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/StyleSheet/StyleSheet');
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get Systrace(): Systrace {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/Performance/Systrace');
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get ToastAndroid(): ToastAndroid {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/Components/ToastAndroid/ToastAndroid');
|
2018-12-01 10:19:10 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get TurboModuleRegistry(): TurboModuleRegistry {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/TurboModule/TurboModuleRegistry');
|
2019-04-15 22:07:04 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get TVEventHandler(): TVEventHandler {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/Components/AppleTV/TVEventHandler');
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get UIManager(): UIManager {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/ReactNative/UIManager');
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get unstable_batchedUpdates(): $PropertyType<
|
|
|
|
ReactNative,
|
|
|
|
'unstable_batchedUpdates',
|
|
|
|
> {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/Renderer/shims/ReactNative')
|
|
|
|
.unstable_batchedUpdates;
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2019-08-31 21:21:03 +03:00
|
|
|
get useColorScheme(): useColorScheme {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/Utilities/useColorScheme').default;
|
2019-08-31 21:21:03 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get useWindowDimensions(): useWindowDimensions {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/Utilities/useWindowDimensions').default;
|
2019-07-29 21:05:58 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get UTFSequence(): UTFSequence {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/UTFSequence');
|
2018-12-11 04:07:50 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get Vibration(): Vibration {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/Vibration/Vibration');
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get YellowBox(): YellowBox {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/YellowBox/YellowBox');
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2015-03-18 20:06:01 +03:00
|
|
|
|
2015-03-23 19:39:18 +03:00
|
|
|
// Plugins
|
2019-08-22 05:00:41 +03:00
|
|
|
get DeviceEventEmitter(): RCTDeviceEventEmitter {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/EventEmitter/RCTDeviceEventEmitter');
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get NativeAppEventEmitter(): RCTNativeAppEventEmitter {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/EventEmitter/RCTNativeAppEventEmitter');
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get NativeModules(): NativeModules {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/BatchedBridge/NativeModules');
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get Platform(): Platform {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/Utilities/Platform');
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get processColor(): processColor {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/StyleSheet/processColor');
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2019-09-25 20:10:48 +03:00
|
|
|
get requireNativeComponent(): <T>(
|
|
|
|
uiViewClassName: string,
|
|
|
|
) => HostComponent<T> {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/ReactNative/requireNativeComponent');
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get unstable_RootTagContext(): RootTagContext {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/ReactNative/RootTagContext');
|
2019-06-25 16:19:52 +03:00
|
|
|
},
|
2019-12-10 13:28:06 +03:00
|
|
|
get unstable_enableLogBox(): () => void {
|
|
|
|
return require('./Libraries/YellowBox/YellowBox').__unstable_enableLogBox;
|
|
|
|
},
|
2015-03-23 19:39:18 +03:00
|
|
|
|
2015-06-12 21:14:19 +03:00
|
|
|
// Prop Types
|
2019-08-22 05:00:41 +03:00
|
|
|
get ColorPropType(): DeprecatedColorPropType {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/DeprecatedPropTypes/DeprecatedColorPropType');
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get EdgeInsetsPropType(): DeprecatedEdgeInsetsPropType {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/DeprecatedPropTypes/DeprecatedEdgeInsetsPropType');
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get PointPropType(): DeprecatedPointPropType {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/DeprecatedPropTypes/DeprecatedPointPropType');
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2019-08-22 05:00:41 +03:00
|
|
|
get ViewPropTypes(): DeprecatedViewPropTypes {
|
2019-09-12 13:26:46 +03:00
|
|
|
return require('./Libraries/DeprecatedPropTypes/DeprecatedViewPropTypes');
|
2018-05-11 05:06:46 +03:00
|
|
|
},
|
2015-12-08 03:54:18 +03:00
|
|
|
};
|
2019-02-26 09:37:18 +03:00
|
|
|
|
|
|
|
if (__DEV__) {
|
2019-09-13 17:44:20 +03:00
|
|
|
// $FlowFixMe This is intentional: Flow will error when attempting to access ART.
|
|
|
|
Object.defineProperty(module.exports, 'ART', {
|
|
|
|
configurable: true,
|
|
|
|
get() {
|
|
|
|
invariant(
|
|
|
|
false,
|
|
|
|
'ART has been removed from React Native. ' +
|
|
|
|
"It can now be installed and imported from '@react-native-community/art' instead of 'react-native'. " +
|
|
|
|
'See https://github.com/react-native-community/react-native-art',
|
|
|
|
);
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
2019-02-26 09:37:18 +03:00
|
|
|
// $FlowFixMe This is intentional: Flow will error when attempting to access ListView.
|
|
|
|
Object.defineProperty(module.exports, 'ListView', {
|
|
|
|
configurable: true,
|
|
|
|
get() {
|
|
|
|
invariant(
|
|
|
|
false,
|
|
|
|
'ListView has been removed from React Native. ' +
|
|
|
|
'See https://fb.me/nolistview for more information or use ' +
|
|
|
|
'`deprecated-react-native-listview`.',
|
|
|
|
);
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
// $FlowFixMe This is intentional: Flow will error when attempting to access SwipeableListView.
|
|
|
|
Object.defineProperty(module.exports, 'SwipeableListView', {
|
|
|
|
configurable: true,
|
|
|
|
get() {
|
|
|
|
invariant(
|
|
|
|
false,
|
|
|
|
'SwipeableListView has been removed from React Native. ' +
|
|
|
|
'See https://fb.me/nolistview for more information or use ' +
|
|
|
|
'`deprecated-react-native-swipeable-listview`.',
|
|
|
|
);
|
|
|
|
},
|
|
|
|
});
|
2019-03-29 03:32:15 +03:00
|
|
|
|
|
|
|
// $FlowFixMe This is intentional: Flow will error when attempting to access WebView.
|
|
|
|
Object.defineProperty(module.exports, 'WebView', {
|
|
|
|
configurable: true,
|
|
|
|
get() {
|
|
|
|
invariant(
|
|
|
|
false,
|
|
|
|
'WebView has been removed from React Native. ' +
|
|
|
|
"It can now be installed and imported from 'react-native-webview' instead of 'react-native'. " +
|
|
|
|
'See https://github.com/react-native-community/react-native-webview',
|
|
|
|
);
|
|
|
|
},
|
|
|
|
});
|
2019-05-30 16:48:11 +03:00
|
|
|
|
|
|
|
// $FlowFixMe This is intentional: Flow will error when attempting to access NetInfo.
|
|
|
|
Object.defineProperty(module.exports, 'NetInfo', {
|
|
|
|
configurable: true,
|
|
|
|
get() {
|
|
|
|
invariant(
|
|
|
|
false,
|
|
|
|
'NetInfo has been removed from React Native. ' +
|
2019-09-13 17:44:20 +03:00
|
|
|
"It can now be installed and imported from '@react-native-community/netinfo' instead of 'react-native'. " +
|
2019-05-30 16:48:11 +03:00
|
|
|
'See https://github.com/react-native-community/react-native-netinfo',
|
|
|
|
);
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
// $FlowFixMe This is intentional: Flow will error when attempting to access CameraRoll.
|
|
|
|
Object.defineProperty(module.exports, 'CameraRoll', {
|
|
|
|
configurable: true,
|
|
|
|
get() {
|
|
|
|
invariant(
|
|
|
|
false,
|
|
|
|
'CameraRoll has been removed from React Native. ' +
|
2019-09-13 17:44:20 +03:00
|
|
|
"It can now be installed and imported from '@react-native-community/cameraroll' instead of 'react-native'. " +
|
2019-05-30 16:48:11 +03:00
|
|
|
'See https://github.com/react-native-community/react-native-cameraroll',
|
|
|
|
);
|
|
|
|
},
|
|
|
|
});
|
2019-06-07 16:35:19 +03:00
|
|
|
|
|
|
|
// $FlowFixMe This is intentional: Flow will error when attempting to access ImageStore.
|
|
|
|
Object.defineProperty(module.exports, 'ImageStore', {
|
|
|
|
configurable: true,
|
|
|
|
get() {
|
|
|
|
invariant(
|
|
|
|
false,
|
|
|
|
'ImageStore has been removed from React Native. ' +
|
|
|
|
'To get a base64-encoded string from a local image use either of the following third-party libraries:' +
|
|
|
|
"* expo-file-system: `readAsStringAsync(filepath, 'base64')`" +
|
|
|
|
"* react-native-fs: `readFile(filepath, 'base64')`",
|
|
|
|
);
|
|
|
|
},
|
|
|
|
});
|
2019-06-11 10:22:11 +03:00
|
|
|
|
|
|
|
// $FlowFixMe This is intentional: Flow will error when attempting to access ImageEditor.
|
|
|
|
Object.defineProperty(module.exports, 'ImageEditor', {
|
|
|
|
configurable: true,
|
|
|
|
get() {
|
|
|
|
invariant(
|
|
|
|
false,
|
|
|
|
'ImageEditor has been removed from React Native. ' +
|
2019-09-13 17:44:20 +03:00
|
|
|
"It can now be installed and imported from '@react-native-community/image-editor' instead of 'react-native'. " +
|
2019-06-11 10:22:11 +03:00
|
|
|
'See https://github.com/react-native-community/react-native-image-editor',
|
|
|
|
);
|
|
|
|
},
|
|
|
|
});
|
2019-06-11 10:22:11 +03:00
|
|
|
|
2019-09-13 17:44:20 +03:00
|
|
|
// $FlowFixMe This is intentional: Flow will error when attempting to access TimePickerAndroid.
|
|
|
|
Object.defineProperty(module.exports, 'TimePickerAndroid', {
|
|
|
|
configurable: true,
|
|
|
|
get() {
|
|
|
|
invariant(
|
|
|
|
false,
|
|
|
|
'TimePickerAndroid has been removed from React Native. ' +
|
|
|
|
"It can now be installed and imported from '@react-native-community/datetimepicker' instead of 'react-native'. " +
|
|
|
|
'See https://github.com/react-native-community/react-native-datetimepicker',
|
|
|
|
);
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
2019-06-11 10:22:11 +03:00
|
|
|
// $FlowFixMe This is intentional: Flow will error when attempting to access ViewPagerAndroid.
|
|
|
|
Object.defineProperty(module.exports, 'ViewPagerAndroid', {
|
|
|
|
configurable: true,
|
|
|
|
get() {
|
|
|
|
invariant(
|
|
|
|
false,
|
|
|
|
'ViewPagerAndroid has been removed from React Native. ' +
|
2019-09-13 17:44:20 +03:00
|
|
|
"It can now be installed and imported from '@react-native-community/viewpager' instead of 'react-native'. " +
|
2019-06-11 10:22:11 +03:00
|
|
|
'See https://github.com/react-native-community/react-native-viewpager',
|
|
|
|
);
|
|
|
|
},
|
|
|
|
});
|
2019-02-26 09:37:18 +03:00
|
|
|
}
|