react-native-windows 0.79.4 → 0.80.0-preview.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.flowconfig +12 -3
- package/Directory.Build.props +5 -2
- package/Libraries/Alert/Alert.d.ts +4 -1
- package/Libraries/Alert/Alert.js +3 -0
- package/Libraries/Alert/Alert.windows.js +3 -0
- package/Libraries/Alert/RCTAlertManager.js +17 -0
- package/Libraries/Animated/Animated.js.flow +1 -3
- package/Libraries/Animated/AnimatedEvent.js +4 -3
- package/Libraries/Animated/AnimatedExports.js +2 -2
- package/Libraries/Animated/AnimatedExports.js.flow +140 -0
- package/Libraries/Animated/AnimatedImplementation.js +2 -123
- package/Libraries/Animated/Easing.js +13 -15
- package/Libraries/Animated/animations/Animation.js +8 -4
- package/Libraries/Animated/components/AnimatedFlatList.js +7 -6
- package/Libraries/Animated/components/AnimatedScrollView.js +48 -42
- package/Libraries/Animated/components/AnimatedSectionList.js +11 -7
- package/Libraries/Animated/createAnimatedComponent.js +105 -57
- package/Libraries/Animated/nodes/AnimatedNode.js +4 -3
- package/Libraries/Animated/nodes/AnimatedProps.js +46 -26
- package/Libraries/Animated/nodes/AnimatedValue.js +16 -7
- package/Libraries/Animated/nodes/AnimatedValueXY.js +3 -1
- package/Libraries/AppState/AppState.js +7 -2
- package/Libraries/BatchedBridge/MessageQueue.js +2 -2
- package/Libraries/BatchedBridge/NativeModules.js +2 -0
- package/Libraries/Blob/BlobManager.js +1 -0
- package/Libraries/Blob/FileReader.js +219 -8
- package/Libraries/Blob/URL.js +37 -12
- package/Libraries/Blob/URLSearchParams.js +106 -31
- package/Libraries/Blob/URLSearchParams.js.flow +12 -7
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +1 -1
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.windows.js +1 -1
- package/Libraries/Components/AccessibilityInfo/legacySendAccessibilityEvent.js +17 -0
- package/Libraries/Components/ActivityIndicator/ActivityIndicator.js +1 -0
- package/Libraries/Components/Button.d.ts +3 -0
- package/Libraries/Components/Button.js +1 -1
- package/Libraries/Components/Button.windows.js +27 -1
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +1 -3
- package/Libraries/{NewAppScreen/components/Colors.js → Components/DrawerAndroid/DrawerLayoutAndroid.ios.js} +6 -10
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.js +6 -66
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.js.flow +18 -0
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroidFallback.js +71 -0
- package/Libraries/Components/Flyout/Flyout.js +11 -0
- package/Libraries/Components/Keyboard/Keyboard.js +5 -3
- package/Libraries/Components/Keyboard/KeyboardAvoidingView.js +6 -3
- package/Libraries/Components/Keyboard/KeyboardExt.js.map +1 -1
- package/Libraries/Components/Popup/Popup.js +11 -0
- package/Libraries/Components/Pressable/Pressable.js +20 -4
- package/Libraries/Components/Pressable/Pressable.windows.js +20 -4
- package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.js +25 -3
- package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroidTypes.js +29 -20
- package/Libraries/Components/RefreshControl/RefreshControl.js +1 -1
- package/Libraries/Components/RefreshControl/RefreshControl.windows.js +1 -1
- package/Libraries/Components/ScrollView/ScrollView.d.ts +3 -3
- package/Libraries/Components/ScrollView/ScrollView.js +132 -122
- package/Libraries/Components/ScrollView/ScrollView.windows.js +131 -122
- package/Libraries/Components/StaticRenderer.js +1 -1
- package/Libraries/Components/Switch/Switch.d.ts +3 -0
- package/Libraries/Components/Switch/Switch.js +8 -4
- package/Libraries/Components/Switch/Switch.windows.js +17 -4
- package/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js +2 -1
- package/Libraries/Components/TextInput/RCTTextInputViewConfig.js +2 -4
- package/Libraries/Components/TextInput/TextInput.d.ts +70 -33
- package/Libraries/Components/TextInput/TextInput.flow.js +100 -51
- package/Libraries/Components/TextInput/TextInput.flow.windows.js +1246 -0
- package/Libraries/Components/TextInput/TextInput.js +88 -1027
- package/Libraries/Components/TextInput/TextInput.windows.js +104 -1092
- package/Libraries/Components/TextInput/TextInputState.js +1 -1
- package/Libraries/Components/TextInput/TextInputState.windows.js +1 -1
- package/Libraries/Components/TextInput/WindowsTextInputNativeComponent.js +2 -1
- package/Libraries/{Modal/ModalInjection.js → Components/ToastAndroid/ToastAndroid.ios.js} +3 -5
- package/Libraries/Components/ToastAndroid/ToastAndroid.js +4 -32
- package/Libraries/Components/ToastAndroid/ToastAndroid.js.flow +109 -0
- package/Libraries/Components/ToastAndroid/ToastAndroidFallback.js +45 -0
- package/Libraries/Components/Touchable/Touchable.js +5 -5
- package/Libraries/Components/Touchable/Touchable.windows.js +5 -5
- package/Libraries/Components/Touchable/TouchableBounce.js +14 -7
- package/Libraries/Components/Touchable/TouchableBounce.windows.js +14 -7
- package/Libraries/Components/Touchable/TouchableHighlight.js +10 -7
- package/Libraries/Components/Touchable/TouchableHighlight.windows.js +10 -7
- package/Libraries/Components/Touchable/TouchableNativeFeedback.js +6 -6
- package/Libraries/Components/Touchable/TouchableNativeFeedback.windows.js +6 -6
- package/Libraries/Components/Touchable/TouchableOpacity.js +13 -6
- package/Libraries/Components/Touchable/TouchableOpacity.windows.js +13 -6
- package/Libraries/Components/View/View.js +18 -21
- package/Libraries/Components/View/View.windows.js +39 -41
- package/Libraries/Components/View/ViewAccessibility.d.ts +8 -0
- package/Libraries/Components/View/ViewAccessibility.js +25 -1
- package/Libraries/Components/View/ViewAccessibility.windows.js +9 -1
- package/Libraries/Components/View/ViewPropTypes.js +49 -3
- package/Libraries/Components/View/ViewPropTypes.windows.js +50 -2
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/Core/setUpReactDevTools.js +5 -5
- package/Libraries/Debugging/DebuggingOverlayRegistry.js +3 -3
- package/Libraries/EventEmitter/NativeEventEmitter.js +9 -4
- package/Libraries/Image/AssetSourceResolver.js +17 -4
- package/Libraries/Image/AssetSourceResolver.windows.js +17 -4
- package/Libraries/Image/Image.d.ts +26 -10
- package/Libraries/Image/Image.js +17 -0
- package/Libraries/Image/Image.js.flow +5 -5
- package/Libraries/Image/Image.windows.js +13 -1
- package/Libraries/Image/ImageBackground.js +2 -0
- package/Libraries/Image/ImageInjection.js +1 -1
- package/Libraries/Image/ImageProps.js +22 -17
- package/Libraries/Image/ImageSource.js +3 -1
- package/Libraries/Image/ImageSourceUtils.js +4 -2
- package/Libraries/Image/ImageTypes.flow.js +1 -1
- package/Libraries/Interaction/InteractionManager.d.ts +13 -0
- package/Libraries/Interaction/InteractionManager.js +1 -1
- package/Libraries/Interaction/PanResponder.js +3 -3
- package/Libraries/Interaction/TaskQueue.js +1 -0
- package/Libraries/LayoutAnimation/LayoutAnimation.js +2 -2
- package/Libraries/Linking/Linking.js +1 -1
- package/Libraries/Lists/FlatList.d.ts +2 -2
- package/Libraries/Lists/FlatList.js +8 -11
- package/Libraries/Lists/SectionList.js +39 -42
- package/Libraries/Lists/SectionListModern.js +25 -34
- package/Libraries/Lists/VirtualizedList.js +1 -0
- package/Libraries/Lists/VirtualizedSectionList.js +1 -0
- package/Libraries/LogBox/Data/LogBoxData.js +1 -1
- package/Libraries/LogBox/LogBoxNotificationContainer.js +1 -1
- package/Libraries/Modal/Modal.js +33 -7
- package/Libraries/Modal/Modal.windows.js +33 -10
- package/Libraries/NativeComponent/BaseViewConfig.android.js +2 -0
- package/Libraries/NativeComponent/BaseViewConfig.ios.js +2 -0
- package/Libraries/NativeComponent/BaseViewConfig.js +17 -0
- package/Libraries/NativeComponent/BaseViewConfig.windows.js +3 -0
- package/Libraries/NativeComponent/PlatformBaseViewConfig.js +2 -2
- package/Libraries/NativeModules/specs/NativeDevMenu.js +2 -2
- package/Libraries/Network/RCTNetworking.android.js +1 -1
- package/Libraries/Network/RCTNetworking.ios.js +1 -1
- package/Libraries/Network/RCTNetworking.js +17 -0
- package/Libraries/Network/RCTNetworking.js.flow +1 -1
- package/Libraries/Network/RCTNetworking.windows.js +1 -1
- package/Libraries/Network/XMLHttpRequest.js +781 -10
- package/Libraries/Performance/Systrace.js +7 -7
- package/Libraries/Pressability/Pressability.js +1 -1
- package/Libraries/Pressability/Pressability.windows.js +1 -1
- package/Libraries/ReactNative/AppContainer-dev.js +5 -4
- package/Libraries/ReactNative/AppRegistry.flow.js +49 -0
- package/Libraries/ReactNative/AppRegistry.js +2 -322
- package/Libraries/ReactNative/AppRegistry.js.flow +23 -0
- package/Libraries/ReactNative/AppRegistryImpl.js +316 -0
- package/Libraries/ReactNative/FabricUIManager.js +10 -0
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricHostComponent.js +2 -4
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance.js +1 -4
- package/Libraries/ReactNative/RendererImplementation.js +10 -5
- package/Libraries/ReactNative/getNativeComponentAttributes.js +1 -0
- package/Libraries/ReactNative/renderApplication.js +9 -0
- package/Libraries/ReactPrivate/ReactNativePrivateInterface.js +3 -3
- package/Libraries/ReactPrivate/ReactNativePrivateInterface.js.flow +51 -0
- package/Libraries/Renderer/implementations/ReactFabric-dev.js +4840 -4748
- package/Libraries/Renderer/implementations/ReactFabric-prod.js +4947 -4829
- package/Libraries/Renderer/implementations/ReactFabric-profiling.js +3998 -3888
- package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +5005 -4948
- package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +2744 -2652
- package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +5020 -4933
- package/Libraries/Renderer/shims/ReactNativeTypes.js +3 -3
- package/Libraries/Settings/Settings.ios.js +1 -0
- package/Libraries/Settings/Settings.js +13 -19
- package/Libraries/Settings/SettingsFallback.js +33 -0
- package/Libraries/StyleSheet/PlatformColorValueTypes.js +15 -0
- package/Libraries/StyleSheet/PlatformColorValueTypesIOS.js +6 -0
- package/Libraries/StyleSheet/Rect.js +1 -0
- package/Libraries/StyleSheet/StyleSheet.js +31 -200
- package/Libraries/StyleSheet/StyleSheet.js.flow +188 -0
- package/Libraries/StyleSheet/StyleSheetExports.js +210 -0
- package/Libraries/StyleSheet/StyleSheetExports.js.flow +112 -0
- package/Libraries/StyleSheet/StyleSheetTypes.d.ts +1 -1
- package/Libraries/StyleSheet/StyleSheetTypes.js +130 -52
- package/Libraries/StyleSheet/flattenStyle.js +14 -4
- package/Libraries/StyleSheet/private/_TransformStyle.js +49 -21
- package/Libraries/StyleSheet/processBackgroundImage.js +670 -214
- package/Libraries/Text/Text.d.ts +2 -5
- package/Libraries/Text/Text.js +3 -3
- package/Libraries/Text/Text.windows.js +3 -3
- package/Libraries/Text/TextNativeComponent.js +0 -4
- package/Libraries/Text/TextProps.js +5 -33
- package/Libraries/Text/TextProps.windows.js +5 -32
- package/Libraries/Types/CodegenTypesNamespace.d.ts +45 -0
- package/Libraries/{Blob/__mocks__/BlobModule.js → Types/CodegenTypesNamespace.js} +4 -6
- package/Libraries/Types/CoreEventTypes.d.ts +6 -1
- package/Libraries/Types/CoreEventTypes.js +1 -1
- package/Libraries/Types/CoreEventTypes.windows.js +1 -1
- package/Libraries/Utilities/Appearance.js +2 -0
- package/Libraries/Utilities/BackHandler.js +17 -0
- package/Libraries/Utilities/DeviceInfo.js +2 -0
- package/Libraries/Utilities/Dimensions.js +1 -1
- package/Libraries/Utilities/Platform.js +17 -0
- package/Libraries/Utilities/PlatformTypes.js +11 -3
- package/Libraries/Utilities/ReactNativeTestTools.js +2 -2
- package/Libraries/Utilities/codegenNativeCommands.d.ts +18 -0
- package/Libraries/Utilities/codegenNativeComponent.d.ts +26 -0
- package/Libraries/WebSocket/WebSocket.js +313 -8
- package/Libraries/vendor/core/ErrorUtils.js +28 -2
- package/Libraries/vendor/emitter/EventEmitter.js +6 -2
- package/Microsoft.ReactNative/CompositionSwitcher.idl +8 -0
- package/Microsoft.ReactNative/Fabric/AbiComponentDescriptor.cpp +0 -6
- package/Microsoft.ReactNative/Fabric/Composition/CompositionContextHelper.cpp +197 -1
- package/Microsoft.ReactNative/Fabric/Composition/CompositionDynamicAutomationProvider.cpp +34 -4
- package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.cpp +12 -0
- package/Microsoft.ReactNative/Fabric/Composition/ParagraphComponentView.cpp +36 -33
- package/Microsoft.ReactNative/Fabric/Composition/ScrollViewComponentView.cpp +81 -0
- package/Microsoft.ReactNative/Fabric/Composition/ScrollViewComponentView.h +5 -0
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cpp +148 -14
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.h +4 -0
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputEventEmitter.cpp +29 -0
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputEventEmitter.h +2 -0
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.cpp +17 -34
- package/Microsoft.ReactNative/Fabric/FabricUIManagerModule.cpp +9 -3
- package/Microsoft.ReactNative/Fabric/FabricUIManagerModule.h +2 -0
- package/Microsoft.ReactNative/Fabric/ImageManager.cpp +1 -1
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/view/HostPlatformViewEventEmitter.cpp +16 -0
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/view/HostPlatformViewEventEmitter.h +1 -0
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/view/HostPlatformViewProps.cpp +9 -0
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/view/HostPlatformViewProps.h +1 -0
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/view/HostPlatformViewTraitsInitializer.h +4 -0
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/textlayoutmanager/WindowsTextLayoutManager.cpp +36 -96
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/textlayoutmanager/WindowsTextLayoutManager.h +1 -1
- package/Microsoft.ReactNative/Modules/SampleTurboModule.cpp +4 -0
- package/Microsoft.ReactNative/Modules/SampleTurboModule.h +3 -0
- package/Microsoft.ReactNative/TurboModulesProvider.h +1 -1
- package/Microsoft.ReactNative.Cxx/JSI/JsiApiContext.h +1 -1
- package/Microsoft.ReactNative.Cxx/JSI/LongLivedJsiValue.h +1 -1
- package/PropertySheets/Generated/PackageVersion.g.props +4 -4
- package/PropertySheets/React.Cpp.props +4 -0
- package/README.md +2 -2
- package/ReactCommon/ReactCommon.vcxproj +9 -4
- package/ReactCommon/ReactCommon.vcxproj.filters +6 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/CxxNativeModule.cpp +253 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/JSExecutor.cpp +5 -2
- package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/NativeToJsBridge.cpp +4 -8
- package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/TraceSection.h +184 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/NetworkIOAgent.cpp +22 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/NetworkIOAgent.h +2 -4
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/core/ReactCommon/TurboModuleWithJSIBindings.cpp +27 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/componentregistry/ComponentDescriptorRegistry.cpp +3 -2
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/AccessibilityPrimitives.h +1 -1
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/AccessibilityProps.cpp +308 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/core/DynamicEventPayload.cpp +42 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/css/CSSTokenizer.h +7 -51
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/runtime/ReactInstance.cpp +10 -5
- package/Scripts/creaternwapp.cmd +9 -3
- package/Shared/Shared.vcxitems +3 -2
- package/Shared/Shared.vcxitems.filters +2 -1
- package/codegen/NativeAnimatedModuleSpec.g.h +2 -0
- package/codegen/NativeAnimatedTurboModuleSpec.g.h +2 -0
- package/codegen/NativePerformanceSpec.g.h +14 -0
- package/codegen/NativeReactNativeFeatureFlagsSpec.g.h +151 -127
- package/codegen/NativeSampleTurboModuleSpec.g.h +14 -8
- package/codegen/react/components/rnwcore/EventEmitters.cpp +48 -48
- package/codegen/rnwcoreJSI-generated.cpp +159 -129
- package/codegen/rnwcoreJSI.h +534 -408
- package/index.js +51 -331
- package/index.windows.js +70 -352
- package/interface.js +0 -4
- package/jest/resolver.js +31 -0
- package/jest/setup.js +6 -2
- package/package.json +29 -28
- package/src/private/animated/NativeAnimatedHelper.js +21 -8
- package/src/private/animated/createAnimatedPropsHook.js +11 -16
- package/src/private/animated/createAnimatedPropsMemoHook.js +1 -2
- package/src/private/components/{SafeAreaView_INTERNAL_DO_NOT_USE.js → safeareaview/SafeAreaView_INTERNAL_DO_NOT_USE.js} +6 -6
- package/src/private/components/{HScrollViewNativeComponents.js → scrollview/HScrollViewNativeComponents.js} +8 -8
- package/src/private/components/scrollview/VScrollViewNativeComponents.js +25 -0
- package/src/private/{devmenu → devsupport/devmenu}/DevMenu.js +1 -1
- package/src/private/{inspector → devsupport/devmenu/elementinspector}/BorderBox.js +3 -3
- package/src/private/{inspector → devsupport/devmenu/elementinspector}/BoxInspector.js +6 -5
- package/src/private/{inspector → devsupport/devmenu/elementinspector}/ElementBox.js +8 -6
- package/src/private/{inspector → devsupport/devmenu/elementinspector}/ElementProperties.js +11 -10
- package/src/private/{inspector → devsupport/devmenu/elementinspector}/Inspector.js +14 -12
- package/src/private/{inspector → devsupport/devmenu/elementinspector}/InspectorOverlay.js +5 -4
- package/src/private/{inspector → devsupport/devmenu/elementinspector}/InspectorPanel.js +9 -8
- package/src/private/{inspector → devsupport/devmenu/elementinspector}/NetworkOverlay.js +10 -9
- package/src/private/{inspector → devsupport/devmenu/elementinspector}/ReactDevToolsOverlay.js +7 -7
- package/src/private/{inspector → devsupport/devmenu/elementinspector}/StyleInspector.js +7 -6
- package/src/private/{inspector → devsupport/devmenu/elementinspector}/XHRInterceptor.js +2 -2
- package/src/private/{inspector → devsupport/devmenu/elementinspector}/getInspectorDataForViewAtPoint.js +4 -4
- package/src/private/{inspector → devsupport/devmenu/elementinspector}/resolveBoxStyle.js +1 -1
- package/src/private/{inspector → devsupport/devmenu/perfmonitor}/PerformanceOverlay.js +6 -5
- package/src/private/{specs_DEPRECATED/modules → devsupport/devmenu/specs}/NativeDevMenu.js +2 -2
- package/src/private/{debugging → devsupport/rndevtools}/ReactDevToolsSettingsManager.android.js +1 -1
- package/src/private/{debugging → devsupport/rndevtools}/ReactDevToolsSettingsManager.ios.js +1 -1
- package/src/private/{debugging → devsupport/rndevtools}/ReactDevToolsSettingsManager.windows.js +1 -1
- package/src/private/{debugging → devsupport/rndevtools}/setUpFuseboxReactDevToolsDispatcher.js +1 -1
- package/src/private/{fusebox → devsupport/rndevtools}/specs/NativeReactDevToolsRuntimeSettingsModule.js +2 -2
- package/src/private/{specs_DEPRECATED/modules → devsupport/rndevtools/specs}/NativeReactDevToolsSettingsManager.js +2 -2
- package/src/private/featureflags/ReactNativeFeatureFlags.js +82 -80
- package/src/private/featureflags/ReactNativeFeatureFlagsBase.js +12 -1
- package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +17 -13
- package/src/private/renderer/errorhandling/ErrorHandlers.js +2 -2
- package/src/private/specs_DEPRECATED/modules/NativeAnimatedModule.js +1 -1
- package/src/private/specs_DEPRECATED/modules/NativeAnimatedTurboModule.js +1 -1
- package/src/private/specs_DEPRECATED/modules/NativeSampleTurboModule.js +3 -0
- package/src/private/styles/composeStyles.js +12 -5
- package/src/private/types/HostComponent.js +1 -1
- package/src/private/types/HostInstance.js +67 -1
- package/src/private/webapis/dom/nodes/ReactNativeElement.js +2 -5
- package/src/private/webapis/dom/nodes/ReadOnlyNode.js +5 -18
- package/src/private/webapis/dom/nodes/internals/NodeInternals.js +6 -0
- package/src/private/webapis/performance/Performance.js +1 -3
- package/src/private/webapis/performance/PerformanceEntry.js +6 -1
- package/src/private/webapis/performance/internals/RawPerformanceEntry.js +3 -0
- package/src/private/webapis/performance/specs/NativePerformance.js +10 -1
- package/src/types/globals.d.ts +42 -0
- package/stubs/double-conversion/double-conversion.h +3 -1
- package/templates/cpp-app/windows/MyApp/MyApp.vcxproj +4 -0
- package/templates/cpp-lib/windows/MyLib/MyLib.vcxproj +4 -0
- package/types/index.d.ts +6 -3
- package/types/public/ReactNativeTypes.d.ts +2 -2
- package/Libraries/BatchedBridge/__mocks__/MessageQueueTestConfig.js +0 -38
- package/Libraries/BatchedBridge/__mocks__/MessageQueueTestModule.js +0 -22
- package/Libraries/Blob/FileReader_new.js +0 -231
- package/Libraries/Blob/FileReader_old.js +0 -186
- package/Libraries/Blob/__mocks__/FileReaderModule.js +0 -20
- package/Libraries/Components/RefreshControl/__mocks__/RefreshControlMock.js +0 -32
- package/Libraries/Core/__mocks__/ErrorUtils.js +0 -33
- package/Libraries/Core/__mocks__/NativeExceptionsManager.js +0 -19
- package/Libraries/EventEmitter/__mocks__/NativeEventEmitter.js +0 -49
- package/Libraries/Events/CustomEvent.js +0 -32
- package/Libraries/Events/EventPolyfill.js +0 -239
- package/Libraries/Lists/__flowtests__/FlatList-flowtest.js +0 -118
- package/Libraries/Lists/__flowtests__/SectionList-flowtest.js +0 -134
- package/Libraries/Network/XMLHttpRequest_new.js +0 -794
- package/Libraries/Network/XMLHttpRequest_old.js +0 -701
- package/Libraries/NewAppScreen/components/DebugInstructions.js +0 -41
- package/Libraries/NewAppScreen/components/DebugInstructions.windows.js +0 -30
- package/Libraries/NewAppScreen/components/Header.js +0 -77
- package/Libraries/NewAppScreen/components/HermesBadge.js +0 -53
- package/Libraries/NewAppScreen/components/LearnMoreLinks.js +0 -148
- package/Libraries/NewAppScreen/components/ReloadInstructions.js +0 -39
- package/Libraries/NewAppScreen/components/ReloadInstructions.windows.js +0 -31
- package/Libraries/NewAppScreen/components/logo.png +0 -0
- package/Libraries/NewAppScreen/index.js +0 -25
- package/Libraries/StyleSheet/__flowtests__/StyleSheet-flowtest.js +0 -58
- package/Libraries/Utilities/__mocks__/BackHandler.js +0 -45
- package/Libraries/Utilities/__mocks__/GlobalPerformanceLogger.js +0 -16
- package/Libraries/Utilities/__mocks__/PixelRatio.js +0 -25
- package/Libraries/WebSocket/WebSocketEvent.js +0 -30
- package/Libraries/WebSocket/WebSocket_new.js +0 -325
- package/Libraries/WebSocket/WebSocket_old.js +0 -297
- package/Libraries/WebSocket/__mocks__/event-target-shim.js +0 -27
- package/Libraries/__flowtests__/ReactNativeTypes-flowtest.js +0 -30
- package/Libraries/vendor/emitter/__flowtests__/EventEmitter-flowtest.js +0 -81
- package/jest/__tests__/setup-test.js +0 -18
- package/src/private/components/VScrollViewNativeComponents.js +0 -25
- package/src/private/utilities/ensureInstance.js +0 -21
- package/src/private/webapis/performance/specs/__mocks__/NativePerformanceMock.js +0 -267
- package/types/modules/LaunchScreen.d.ts +0 -18
- /package/src/private/{devmenu → devsupport/devmenu}/DevMenu.d.ts +0 -0
- /package/src/private/{debugging → devsupport/rndevtools}/FuseboxSessionObserver.js +0 -0
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* @noformat
|
|
8
8
|
* @nolint
|
|
9
9
|
* @flow strict
|
|
10
|
-
* @generated SignedSource<<
|
|
10
|
+
* @generated SignedSource<<2264e9839602043a41f1e13913b43b0f>>
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
import type {
|
|
@@ -84,8 +84,8 @@ export type ViewConfig = $ReadOnly<{
|
|
|
84
84
|
}>;
|
|
85
85
|
|
|
86
86
|
export type PartialViewConfig = $ReadOnly<{
|
|
87
|
-
bubblingEventTypes?:
|
|
88
|
-
directEventTypes?:
|
|
87
|
+
bubblingEventTypes?: ViewConfig['bubblingEventTypes'],
|
|
88
|
+
directEventTypes?: ViewConfig['directEventTypes'],
|
|
89
89
|
supportsRawText?: boolean,
|
|
90
90
|
uiViewClassName: string,
|
|
91
91
|
validAttributes?: PartialAttributeConfiguration,
|
|
@@ -8,26 +8,20 @@
|
|
|
8
8
|
* @flow
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
import Platform from '../Utilities/Platform';
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
get(key: string): any
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
set(settings: Object) {
|
|
20
|
-
console.warn('Settings is not yet supported on this platform.');
|
|
21
|
-
},
|
|
22
|
-
|
|
23
|
-
watchKeys(keys: string | Array<string>, callback: () => void): number {
|
|
24
|
-
console.warn('Settings is not yet supported on this platform.');
|
|
25
|
-
return -1;
|
|
26
|
-
},
|
|
27
|
-
|
|
28
|
-
clearWatch(watchId: number) {
|
|
29
|
-
console.warn('Settings is not yet supported on this platform.');
|
|
30
|
-
},
|
|
13
|
+
let Settings: {
|
|
14
|
+
get(key: string): any,
|
|
15
|
+
set(settings: Object): void,
|
|
16
|
+
watchKeys(keys: string | Array<string>, callback: () => void): number,
|
|
17
|
+
clearWatch(watchId: number): void,
|
|
18
|
+
...
|
|
31
19
|
};
|
|
32
20
|
|
|
21
|
+
if (Platform.OS === 'ios') {
|
|
22
|
+
Settings = require('./Settings').default;
|
|
23
|
+
} else {
|
|
24
|
+
Settings = require('./SettingsFallback').default;
|
|
25
|
+
}
|
|
26
|
+
|
|
33
27
|
export default Settings;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
* @format
|
|
8
|
+
* @flow
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
'use strict';
|
|
12
|
+
|
|
13
|
+
const Settings = {
|
|
14
|
+
get(key: string): any {
|
|
15
|
+
console.warn('Settings is not yet supported on this platform.');
|
|
16
|
+
return null;
|
|
17
|
+
},
|
|
18
|
+
|
|
19
|
+
set(settings: Object) {
|
|
20
|
+
console.warn('Settings is not yet supported on this platform.');
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
watchKeys(keys: string | Array<string>, callback: () => void): number {
|
|
24
|
+
console.warn('Settings is not yet supported on this platform.');
|
|
25
|
+
return -1;
|
|
26
|
+
},
|
|
27
|
+
|
|
28
|
+
clearWatch(watchId: number) {
|
|
29
|
+
console.warn('Settings is not yet supported on this platform.');
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export default Settings;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
* @flow strict-local
|
|
8
|
+
* @format
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
// NOTE: This file supports backwards compatibility of subpath (deep) imports
|
|
12
|
+
// from 'react-native' with platform-specific extensions. It can be deleted
|
|
13
|
+
// once we remove the "./*" mapping from package.json "exports".
|
|
14
|
+
|
|
15
|
+
export * from './PlatformColorValueTypes';
|
|
@@ -17,6 +17,12 @@ export type DynamicColorIOSTuple = {
|
|
|
17
17
|
highContrastDark?: ColorValue,
|
|
18
18
|
};
|
|
19
19
|
|
|
20
|
+
/**
|
|
21
|
+
* Specify color to display depending on the current system appearance settings
|
|
22
|
+
*
|
|
23
|
+
* @param tuple Colors you want to use for "light mode" and "dark mode"
|
|
24
|
+
* @platform ios
|
|
25
|
+
*/
|
|
20
26
|
export const DynamicColorIOS = (tuple: DynamicColorIOSTuple): ColorValue => {
|
|
21
27
|
throw new Error('DynamicColorIOS is not available on this platform.');
|
|
22
28
|
};
|
|
@@ -10,27 +10,30 @@
|
|
|
10
10
|
|
|
11
11
|
'use strict';
|
|
12
12
|
|
|
13
|
+
import typeof * as StyleSheetExports from './StyleSheetExports';
|
|
13
14
|
import type {
|
|
14
15
|
____ColorValue_Internal,
|
|
15
16
|
____DangerouslyImpreciseStyle_Internal,
|
|
16
17
|
____DangerouslyImpreciseStyleProp_Internal,
|
|
18
|
+
____FontVariant_Internal,
|
|
17
19
|
____ImageStyle_Internal,
|
|
18
20
|
____ImageStyleProp_Internal,
|
|
19
|
-
____Styles_Internal,
|
|
20
21
|
____TextStyle_Internal,
|
|
21
22
|
____TextStyleProp_Internal,
|
|
23
|
+
____TransformStyle_Internal,
|
|
22
24
|
____ViewStyle_Internal,
|
|
23
25
|
____ViewStyleProp_Internal,
|
|
26
|
+
NativeColorValue,
|
|
27
|
+
} from './StyleSheetTypes';
|
|
28
|
+
const StyleSheet: StyleSheetExports = (
|
|
29
|
+
require('./StyleSheetExports') as $FlowFixMe
|
|
30
|
+
).default;
|
|
31
|
+
|
|
32
|
+
export type {
|
|
33
|
+
BoxShadowValue,
|
|
34
|
+
NativeColorValue,
|
|
35
|
+
FilterFunction,
|
|
24
36
|
} from './StyleSheetTypes';
|
|
25
|
-
|
|
26
|
-
import composeStyles from '../../src/private/styles/composeStyles';
|
|
27
|
-
import flatten from './flattenStyle';
|
|
28
|
-
|
|
29
|
-
const ReactNativeStyleAttributes =
|
|
30
|
-
require('../Components/View/ReactNativeStyleAttributes').default;
|
|
31
|
-
const PixelRatio = require('../Utilities/PixelRatio').default;
|
|
32
|
-
|
|
33
|
-
export type {NativeColorValue} from './StyleSheetTypes';
|
|
34
37
|
|
|
35
38
|
/**
|
|
36
39
|
* This type should be used as the type for anything that is a color. It is
|
|
@@ -41,6 +44,22 @@ export type {NativeColorValue} from './StyleSheetTypes';
|
|
|
41
44
|
*/
|
|
42
45
|
export type ColorValue = ____ColorValue_Internal;
|
|
43
46
|
|
|
47
|
+
/**
|
|
48
|
+
* Expose the opaque type for NativeColorValue.
|
|
49
|
+
* @deprecated Use NativeColorValue instead.
|
|
50
|
+
*/
|
|
51
|
+
export type OpaqueColorValue = NativeColorValue;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* This type is an object of the properties related to transforms.
|
|
55
|
+
*/
|
|
56
|
+
export type TransformsStyle = ____TransformStyle_Internal;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* This type holds possible values for the `fontVariant` style property.
|
|
60
|
+
*/
|
|
61
|
+
export type FontVariant = ____FontVariant_Internal;
|
|
62
|
+
|
|
44
63
|
/**
|
|
45
64
|
* This type should be used as the type for a prop that is passed through
|
|
46
65
|
* to a <View>'s `style` prop. This ensures call sites of the component
|
|
@@ -99,7 +118,7 @@ export type DangerouslyImpreciseStyleProp =
|
|
|
99
118
|
*/
|
|
100
119
|
export type TypeForStyleKey<
|
|
101
120
|
+key: $Keys<____DangerouslyImpreciseStyle_Internal>,
|
|
102
|
-
> =
|
|
121
|
+
> = ____DangerouslyImpreciseStyle_Internal[key];
|
|
103
122
|
|
|
104
123
|
/**
|
|
105
124
|
* This type is an object of the different possible style
|
|
@@ -166,192 +185,4 @@ export type ImageStyle = ____ImageStyle_Internal;
|
|
|
166
185
|
*/
|
|
167
186
|
export type DangerouslyImpreciseStyle = ____DangerouslyImpreciseStyle_Internal;
|
|
168
187
|
|
|
169
|
-
|
|
170
|
-
if (hairlineWidth === 0) {
|
|
171
|
-
hairlineWidth = 1 / PixelRatio.get();
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
const absoluteFill: {
|
|
175
|
-
+bottom: 0,
|
|
176
|
-
+left: 0,
|
|
177
|
-
+position: 'absolute',
|
|
178
|
-
+right: 0,
|
|
179
|
-
+top: 0,
|
|
180
|
-
} = {
|
|
181
|
-
position: 'absolute',
|
|
182
|
-
left: 0,
|
|
183
|
-
right: 0,
|
|
184
|
-
top: 0,
|
|
185
|
-
bottom: 0,
|
|
186
|
-
};
|
|
187
|
-
if (__DEV__) {
|
|
188
|
-
Object.freeze(absoluteFill);
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
/**
|
|
192
|
-
* A StyleSheet is an abstraction similar to CSS StyleSheets
|
|
193
|
-
*
|
|
194
|
-
* Create a new StyleSheet:
|
|
195
|
-
*
|
|
196
|
-
* ```
|
|
197
|
-
* const styles = StyleSheet.create({
|
|
198
|
-
* container: {
|
|
199
|
-
* borderRadius: 4,
|
|
200
|
-
* borderWidth: 0.5,
|
|
201
|
-
* borderColor: '#d6d7da',
|
|
202
|
-
* },
|
|
203
|
-
* title: {
|
|
204
|
-
* fontSize: 19,
|
|
205
|
-
* fontWeight: 'bold',
|
|
206
|
-
* },
|
|
207
|
-
* activeTitle: {
|
|
208
|
-
* color: 'red',
|
|
209
|
-
* },
|
|
210
|
-
* });
|
|
211
|
-
* ```
|
|
212
|
-
*
|
|
213
|
-
* Use a StyleSheet:
|
|
214
|
-
*
|
|
215
|
-
* ```
|
|
216
|
-
* <View style={styles.container}>
|
|
217
|
-
* <Text style={[styles.title, this.props.isActive && styles.activeTitle]} />
|
|
218
|
-
* </View>
|
|
219
|
-
* ```
|
|
220
|
-
*
|
|
221
|
-
* Code quality:
|
|
222
|
-
*
|
|
223
|
-
* - By moving styles away from the render function, you're making the code
|
|
224
|
-
* easier to understand.
|
|
225
|
-
* - Naming the styles is a good way to add meaning to the low level components
|
|
226
|
-
* in the render function, and encourage reuse.
|
|
227
|
-
* - In most IDEs, using `StyleSheet.create()` will offer static type checking
|
|
228
|
-
* and suggestions to help you write valid styles.
|
|
229
|
-
*
|
|
230
|
-
*/
|
|
231
|
-
export default {
|
|
232
|
-
/**
|
|
233
|
-
* This is defined as the width of a thin line on the platform. It can be
|
|
234
|
-
* used as the thickness of a border or division between two elements.
|
|
235
|
-
* Example:
|
|
236
|
-
* ```
|
|
237
|
-
* {
|
|
238
|
-
* borderBottomColor: '#bbb',
|
|
239
|
-
* borderBottomWidth: StyleSheet.hairlineWidth
|
|
240
|
-
* }
|
|
241
|
-
* ```
|
|
242
|
-
*
|
|
243
|
-
* This constant will always be a round number of pixels (so a line defined
|
|
244
|
-
* by it look crisp) and will try to match the standard width of a thin line
|
|
245
|
-
* on the underlying platform. However, you should not rely on it being a
|
|
246
|
-
* constant size, because on different platforms and screen densities its
|
|
247
|
-
* value may be calculated differently.
|
|
248
|
-
*
|
|
249
|
-
* A line with hairline width may not be visible if your simulator is downscaled.
|
|
250
|
-
*/
|
|
251
|
-
hairlineWidth,
|
|
252
|
-
|
|
253
|
-
/**
|
|
254
|
-
* A very common pattern is to create overlays with position absolute and zero positioning,
|
|
255
|
-
* so `absoluteFill` can be used for convenience and to reduce duplication of these repeated
|
|
256
|
-
* styles.
|
|
257
|
-
*/
|
|
258
|
-
absoluteFill: (absoluteFill: any), // TODO: This should be updated after we fix downstream Flow sites.
|
|
259
|
-
|
|
260
|
-
/**
|
|
261
|
-
* Sometimes you may want `absoluteFill` but with a couple tweaks - `absoluteFillObject` can be
|
|
262
|
-
* used to create a customized entry in a `StyleSheet`, e.g.:
|
|
263
|
-
*
|
|
264
|
-
* const styles = StyleSheet.create({
|
|
265
|
-
* wrapper: {
|
|
266
|
-
* ...StyleSheet.absoluteFillObject,
|
|
267
|
-
* top: 10,
|
|
268
|
-
* backgroundColor: 'transparent',
|
|
269
|
-
* },
|
|
270
|
-
* });
|
|
271
|
-
*/
|
|
272
|
-
absoluteFillObject: absoluteFill,
|
|
273
|
-
|
|
274
|
-
/**
|
|
275
|
-
* Combines two styles such that `style2` will override any styles in `style1`.
|
|
276
|
-
* If either style is falsy, the other one is returned without allocating an
|
|
277
|
-
* array, saving allocations and maintaining reference equality for
|
|
278
|
-
* PureComponent checks.
|
|
279
|
-
*/
|
|
280
|
-
compose: composeStyles,
|
|
281
|
-
|
|
282
|
-
/**
|
|
283
|
-
* Flattens an array of style objects, into one aggregated style object.
|
|
284
|
-
*
|
|
285
|
-
* Example:
|
|
286
|
-
* ```
|
|
287
|
-
* const styles = StyleSheet.create({
|
|
288
|
-
* listItem: {
|
|
289
|
-
* flex: 1,
|
|
290
|
-
* fontSize: 16,
|
|
291
|
-
* color: 'white'
|
|
292
|
-
* },
|
|
293
|
-
* selectedListItem: {
|
|
294
|
-
* color: 'green'
|
|
295
|
-
* }
|
|
296
|
-
* });
|
|
297
|
-
*
|
|
298
|
-
* StyleSheet.flatten([styles.listItem, styles.selectedListItem])
|
|
299
|
-
* // returns { flex: 1, fontSize: 16, color: 'green' }
|
|
300
|
-
* ```
|
|
301
|
-
*/
|
|
302
|
-
flatten,
|
|
303
|
-
|
|
304
|
-
/**
|
|
305
|
-
* WARNING: EXPERIMENTAL. Breaking changes will probably happen a lot and will
|
|
306
|
-
* not be reliably announced. The whole thing might be deleted, who knows? Use
|
|
307
|
-
* at your own risk.
|
|
308
|
-
*
|
|
309
|
-
* Sets a function to use to pre-process a style property value. This is used
|
|
310
|
-
* internally to process color and transform values. You should not use this
|
|
311
|
-
* unless you really know what you are doing and have exhausted other options.
|
|
312
|
-
*/
|
|
313
|
-
setStyleAttributePreprocessor(
|
|
314
|
-
property: string,
|
|
315
|
-
process: (nextProp: mixed) => mixed,
|
|
316
|
-
) {
|
|
317
|
-
let value;
|
|
318
|
-
|
|
319
|
-
if (ReactNativeStyleAttributes[property] === true) {
|
|
320
|
-
value = {process};
|
|
321
|
-
} else if (typeof ReactNativeStyleAttributes[property] === 'object') {
|
|
322
|
-
value = {...ReactNativeStyleAttributes[property], process};
|
|
323
|
-
} else {
|
|
324
|
-
console.error(`${property} is not a valid style attribute`);
|
|
325
|
-
return;
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
if (
|
|
329
|
-
__DEV__ &&
|
|
330
|
-
typeof value.process === 'function' &&
|
|
331
|
-
typeof ReactNativeStyleAttributes[property]?.process === 'function' &&
|
|
332
|
-
value.process !== ReactNativeStyleAttributes[property]?.process
|
|
333
|
-
) {
|
|
334
|
-
console.warn(`Overwriting ${property} style attribute preprocessor`);
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
ReactNativeStyleAttributes[property] = value;
|
|
338
|
-
},
|
|
339
|
-
|
|
340
|
-
/**
|
|
341
|
-
* An identity function for creating style sheets.
|
|
342
|
-
*/
|
|
343
|
-
// $FlowFixMe[unsupported-variance-annotation]
|
|
344
|
-
create<+S: ____Styles_Internal>(obj: S): $ReadOnly<S> {
|
|
345
|
-
// TODO: This should return S as the return type. But first,
|
|
346
|
-
// we need to codemod all the callsites that are typing this
|
|
347
|
-
// return value as a number (even though it was opaque).
|
|
348
|
-
if (__DEV__) {
|
|
349
|
-
for (const key in obj) {
|
|
350
|
-
if (obj[key]) {
|
|
351
|
-
Object.freeze(obj[key]);
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
|
-
return obj;
|
|
356
|
-
},
|
|
357
|
-
};
|
|
188
|
+
export default StyleSheet;
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
* @flow
|
|
8
|
+
* @format
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
export * as default from './StyleSheetExports';
|
|
12
|
+
|
|
13
|
+
import type {
|
|
14
|
+
____ColorValue_Internal,
|
|
15
|
+
____DangerouslyImpreciseStyle_Internal,
|
|
16
|
+
____DangerouslyImpreciseStyleProp_Internal,
|
|
17
|
+
____FontVariant_Internal,
|
|
18
|
+
____ImageStyle_Internal,
|
|
19
|
+
____ImageStyleProp_Internal,
|
|
20
|
+
____TextStyle_Internal,
|
|
21
|
+
____TextStyleProp_Internal,
|
|
22
|
+
____TransformStyle_Internal,
|
|
23
|
+
____ViewStyle_Internal,
|
|
24
|
+
____ViewStyleProp_Internal,
|
|
25
|
+
NativeColorValue,
|
|
26
|
+
} from './StyleSheetTypes';
|
|
27
|
+
|
|
28
|
+
export type {
|
|
29
|
+
BoxShadowValue,
|
|
30
|
+
FilterFunction,
|
|
31
|
+
NativeColorValue,
|
|
32
|
+
StyleProp,
|
|
33
|
+
} from './StyleSheetTypes';
|
|
34
|
+
|
|
35
|
+
export type StyleSheetProperties = {
|
|
36
|
+
hairlineWidth: number,
|
|
37
|
+
flatten<T: string>(style: T): T,
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* This type should be used as the type for anything that is a color. It is
|
|
42
|
+
* most useful when using DynamicColorIOS which can be a string or a dynamic
|
|
43
|
+
* color object.
|
|
44
|
+
*
|
|
45
|
+
* type props = {backgroundColor: ColorValue};
|
|
46
|
+
*/
|
|
47
|
+
export type ColorValue = ____ColorValue_Internal;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Expose the opaque type for NativeColorValue.
|
|
51
|
+
* @deprecated Use NativeColorValue instead.
|
|
52
|
+
*/
|
|
53
|
+
export type OpaqueColorValue = NativeColorValue;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* This type is an object of the properties related to transforms.
|
|
57
|
+
*/
|
|
58
|
+
export type TransformsStyle = ____TransformStyle_Internal;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* This type holds possible values for the `fontVariant` style property.
|
|
62
|
+
*/
|
|
63
|
+
export type FontVariant = ____FontVariant_Internal;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* This type should be used as the type for a prop that is passed through
|
|
67
|
+
* to a <View>'s `style` prop. This ensures call sites of the component
|
|
68
|
+
* can't pass styles that View doesn't support such as `fontSize`.`
|
|
69
|
+
*
|
|
70
|
+
* type Props = {style: ViewStyleProp}
|
|
71
|
+
* const MyComponent = (props: Props) => <View style={props.style} />
|
|
72
|
+
*/
|
|
73
|
+
export type ViewStyleProp = ____ViewStyleProp_Internal;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* This type should be used as the type for a prop that is passed through
|
|
77
|
+
* to a <Text>'s `style` prop. This ensures call sites of the component
|
|
78
|
+
* can't pass styles that Text doesn't support such as `resizeMode`.`
|
|
79
|
+
*
|
|
80
|
+
* type Props = {style: TextStyleProp}
|
|
81
|
+
* const MyComponent = (props: Props) => <Text style={props.style} />
|
|
82
|
+
*/
|
|
83
|
+
export type TextStyleProp = ____TextStyleProp_Internal;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* This type should be used as the type for a prop that is passed through
|
|
87
|
+
* to an <Image>'s `style` prop. This ensures call sites of the component
|
|
88
|
+
* can't pass styles that Image doesn't support such as `fontSize`.`
|
|
89
|
+
*
|
|
90
|
+
* type Props = {style: ImageStyleProp}
|
|
91
|
+
* const MyComponent = (props: Props) => <Image style={props.style} />
|
|
92
|
+
*/
|
|
93
|
+
export type ImageStyleProp = ____ImageStyleProp_Internal;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* WARNING: You probably shouldn't be using this type. This type
|
|
97
|
+
* is similar to the ones above except it allows styles that are accepted
|
|
98
|
+
* by all of View, Text, or Image. It is therefore very unsafe to pass this
|
|
99
|
+
* through to an underlying component. Using this is almost always a mistake
|
|
100
|
+
* and using one of the other more restrictive types is likely the right choice.
|
|
101
|
+
*/
|
|
102
|
+
export type DangerouslyImpreciseStyleProp =
|
|
103
|
+
____DangerouslyImpreciseStyleProp_Internal;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Utility type for getting the values for specific style keys.
|
|
107
|
+
*
|
|
108
|
+
* The following is bad because position is more restrictive than 'string':
|
|
109
|
+
* ```
|
|
110
|
+
* type Props = {position: string};
|
|
111
|
+
* ```
|
|
112
|
+
*
|
|
113
|
+
* You should use the following instead:
|
|
114
|
+
*
|
|
115
|
+
* ```
|
|
116
|
+
* type Props = {position: TypeForStyleKey<'position'>};
|
|
117
|
+
* ```
|
|
118
|
+
*
|
|
119
|
+
* This will correctly give you the type 'absolute' | 'relative'
|
|
120
|
+
*/
|
|
121
|
+
export type TypeForStyleKey<
|
|
122
|
+
+key: $Keys<____DangerouslyImpreciseStyle_Internal>,
|
|
123
|
+
> = ____DangerouslyImpreciseStyle_Internal[key];
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* This type is an object of the different possible style
|
|
127
|
+
* properties that can be specified for View.
|
|
128
|
+
*
|
|
129
|
+
* Note that this isn't a safe way to type a style prop for a component as
|
|
130
|
+
* results from StyleSheet.create return an internal identifier, not
|
|
131
|
+
* an object of styles.
|
|
132
|
+
*
|
|
133
|
+
* If you want to type the style prop of a function,
|
|
134
|
+
* consider using ViewStyleProp.
|
|
135
|
+
*
|
|
136
|
+
* A reasonable usage of this type is for helper functions that return an
|
|
137
|
+
* object of styles to pass to a View that can't be precomputed with
|
|
138
|
+
* StyleSheet.create.
|
|
139
|
+
*/
|
|
140
|
+
export type ViewStyle = ____ViewStyle_Internal;
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* This type is an object of the different possible style
|
|
144
|
+
* properties that can be specified for Text.
|
|
145
|
+
*
|
|
146
|
+
* Note that this isn't a safe way to type a style prop for a component as
|
|
147
|
+
* results from StyleSheet.create return an internal identifier, not
|
|
148
|
+
* an object of styles.
|
|
149
|
+
*
|
|
150
|
+
* If you want to type the style prop of a function,
|
|
151
|
+
* consider using TextStyleProp.
|
|
152
|
+
*
|
|
153
|
+
* A reasonable usage of this type is for helper functions that return an
|
|
154
|
+
* object of styles to pass to a Text that can't be precomputed with
|
|
155
|
+
* StyleSheet.create.
|
|
156
|
+
*/
|
|
157
|
+
export type TextStyle = ____TextStyle_Internal;
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* This type is an object of the different possible style
|
|
161
|
+
* properties that can be specified for Image.
|
|
162
|
+
*
|
|
163
|
+
* Note that this isn't a safe way to type a style prop for a component as
|
|
164
|
+
* results from StyleSheet.create return an internal identifier, not
|
|
165
|
+
* an object of styles.
|
|
166
|
+
*
|
|
167
|
+
* If you want to type the style prop of a function,
|
|
168
|
+
* consider using ImageStyleProp.
|
|
169
|
+
*
|
|
170
|
+
* A reasonable usage of this type is for helper functions that return an
|
|
171
|
+
* object of styles to pass to an Image that can't be precomputed with
|
|
172
|
+
* StyleSheet.create.
|
|
173
|
+
*/
|
|
174
|
+
export type ImageStyle = ____ImageStyle_Internal;
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* WARNING: You probably shouldn't be using this type. This type is an object
|
|
178
|
+
* with all possible style keys and their values. Note that this isn't
|
|
179
|
+
* a safe way to type a style prop for a component as results from
|
|
180
|
+
* StyleSheet.create return an internal identifier, not an object of styles.
|
|
181
|
+
*
|
|
182
|
+
* If you want to type the style prop of a function, consider using
|
|
183
|
+
* ViewStyleProp, TextStyleProp, or ImageStyleProp.
|
|
184
|
+
*
|
|
185
|
+
* This should only be used by very core utilities that operate on an object
|
|
186
|
+
* containing any possible style value.
|
|
187
|
+
*/
|
|
188
|
+
export type DangerouslyImpreciseStyle = ____DangerouslyImpreciseStyle_Internal;
|