diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 6cd424c759c..0f5ce5cb637 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -254,6 +254,8 @@ PODS: - React-Core - react-native-netinfo (6.0.0): - React-Core + - react-native-pager-view (6.3.0): + - React-Core - react-native-photo-view (1.5.3): - React-Core - react-native-safe-area-context (4.9.0): @@ -340,35 +342,6 @@ PODS: - React-Core - RNGestureHandler (2.16.0): - React-Core - - RNReanimated (2.2.4): - - DoubleConversion - - FBLazyVector - - FBReactNativeSpec - - glog - - RCT-Folly - - RCTRequired - - RCTTypeSafety - - React - - React-callinvoker - - React-Core - - React-Core/DevSupport - - React-Core/RCTWebSocket - - React-CoreModules - - React-cxxreact - - React-jsi - - React-jsiexecutor - - React-jsinspector - - React-RCTActionSheet - - React-RCTAnimation - - React-RCTBlob - - React-RCTImage - - React-RCTLinking - - React-RCTNetwork - - React-RCTSettings - - React-RCTText - - React-RCTVibration - - ReactCommon/turbomodule/core - - Yoga - RNScreens (3.29.0): - React-Core - React-RCTImage @@ -421,6 +394,7 @@ DEPENDENCIES: - react-native-document-picker (from `../node_modules/react-native-document-picker`) - react-native-image-picker (from `../node_modules/react-native-image-picker`) - "react-native-netinfo (from `../node_modules/@react-native-community/netinfo`)" + - react-native-pager-view (from `../node_modules/react-native-pager-view`) - react-native-photo-view (from `../node_modules/react-native-photo-view`) - react-native-safe-area-context (from `../node_modules/react-native-safe-area-context`) - react-native-simple-toast (from `../node_modules/react-native-simple-toast`) @@ -443,7 +417,6 @@ DEPENDENCIES: - "RNCMaskedView (from `../node_modules/@react-native-community/masked-view`)" - "RNCPushNotificationIOS (from `../node_modules/@react-native-community/push-notification-ios`)" - RNGestureHandler (from `../node_modules/react-native-gesture-handler`) - - RNReanimated (from `../node_modules/react-native-reanimated`) - RNScreens (from `../node_modules/react-native-screens`) - "RNSentry (from `../node_modules/@sentry/react-native`)" - RNVectorIcons (from `../node_modules/react-native-vector-icons`) @@ -527,6 +500,8 @@ EXTERNAL SOURCES: :path: "../node_modules/react-native-image-picker" react-native-netinfo: :path: "../node_modules/@react-native-community/netinfo" + react-native-pager-view: + :path: "../node_modules/react-native-pager-view" react-native-photo-view: :path: "../node_modules/react-native-photo-view" react-native-safe-area-context: @@ -571,8 +546,6 @@ EXTERNAL SOURCES: :path: "../node_modules/@react-native-community/push-notification-ios" RNGestureHandler: :path: "../node_modules/react-native-gesture-handler" - RNReanimated: - :path: "../node_modules/react-native-reanimated" RNScreens: :path: "../node_modules/react-native-screens" RNSentry: @@ -619,6 +592,7 @@ SPEC CHECKSUMS: react-native-document-picker: cd4d6b36a5207ad7a9e599ebb9eb0c2e84fa0b87 react-native-image-picker: 3269f75c251cdcd61ab51b911dd30d6fff8c6169 react-native-netinfo: e849fc21ca2f4128a5726c801a82fc6f4a6db50d + react-native-pager-view: 4b79dae76f46759f3cfbb94a7c7d587d9a2f89ee react-native-photo-view: ea0ec91bf5991a6843e740b1f47ab355171c996c react-native-safe-area-context: b97eb6f9e3b7f437806c2ce5983f479f8eb5de4b react-native-simple-toast: 8ee5d23f0b92b935ab7434cdb65159ce12dfb4b7 @@ -641,7 +615,6 @@ SPEC CHECKSUMS: RNCMaskedView: 0e1bc4bfa8365eba5fbbb71e07fbdc0555249489 RNCPushNotificationIOS: 64218f3c776c03d7408284a819b2abfda1834bc8 RNGestureHandler: 998887f1b2c6098ffa2506402087c0e8ef5d69a1 - RNReanimated: e7d8afaf8fed4b3bf1a46e06adb2e04a2b248f1c RNScreens: fa9b582d85ae5d62c91c66003b5278458fed7aaa RNSentry: f30463ce11af9cfec0dde79265d29e10c3b902d7 RNVectorIcons: fcc2f6cb32f5735b586e66d14103a74ce6ad61f8 diff --git a/jest/jestSetup.js b/jest/jestSetup.js index 5a650896ee0..d6a17066757 100644 --- a/jest/jestSetup.js +++ b/jest/jestSetup.js @@ -89,19 +89,6 @@ jest.mock('expo-sqlite', () => require('./mock-expo-sqlite')); * before mocking it here. */ -// As instructed at https://reactnavigation.org/docs/testing/. -jest.mock('react-native-reanimated', () => { - /* $FlowIgnore[untyped-import] - This is just a mock setup file; no - need for a libdef. */ - const Reanimated = require('react-native-reanimated/mock'); - - // The mock for `call` immediately calls the callback which is incorrect - // So we override it with a no-op - Reanimated.default.call = () => {}; - - return Reanimated; -}); - jest.mock('@react-native-async-storage/async-storage', () => mockAsyncStorage); // As instructed at diff --git a/package.json b/package.json index 9e30fe2beb7..1d5cf4db292 100644 --- a/package.json +++ b/package.json @@ -29,8 +29,8 @@ "@react-native-community/masked-view": "^0.1.10", "@react-native-community/netinfo": "6.0.0", "@react-native-community/push-notification-ios": "^1.5.0", - "@react-navigation/bottom-tabs": "npm:@zulip/react-navigation-bottom-tabs@5.11.16-0.zulip.1", - "@react-navigation/material-top-tabs": "^5.2.19", + "@react-navigation/bottom-tabs": "^6.5.20", + "@react-navigation/material-top-tabs": "^6.6.13", "@react-navigation/native": "^5.7.6", "@react-navigation/stack": "npm:@zulip/react-navigation-stack@5.14.10-0.zulip.1", "@sentry/react-native": "^5.9.2", @@ -62,12 +62,12 @@ "react-native-gesture-handler": "^2.8.0", "react-native-image-picker": "^5.3.1", "react-native-open-notification": "^0.1.4", + "react-native-pager-view": "^6.3.0", "react-native-photo-view": "alwx/react-native-photo-view#91b873c85", - "react-native-reanimated": "^2.2.0 <2.3.0", "react-native-safe-area-context": "^4.3.1", "react-native-screens": "^3.13.1 <3.30.0", "react-native-simple-toast": "^1.1.4", - "react-native-tab-view": "^2.15.2", + "react-native-tab-view": "^3.5.2", "react-native-url-polyfill": "^1.3.0", "react-native-vector-icons": "^9.1.0", "react-native-webview": "^11.6.4", @@ -93,7 +93,7 @@ "@rollup/plugin-babel": "^5.2.0", "@rollup/plugin-node-resolve": "^13.0.4", "@testing-library/react-hooks": "^8.0.1", - "@types/react-native": "~0.67.6", + "@types/react-native": "^0.68.20", "@vusion/webfonts-generator": "^0.8.0", "ast-types": "^0.16.1", "babel-plugin-transform-flow-enums": "^0.0.2", diff --git a/src/main/MainTabsScreen.js b/src/main/MainTabsScreen.js index cb8ccb85b9f..9987a2ee084 100644 --- a/src/main/MainTabsScreen.js +++ b/src/main/MainTabsScreen.js @@ -10,7 +10,7 @@ import type { RouteProp, RouteParamsOf } from '../react-navigation'; import { getUnreadHuddlesTotal, getUnreadPmsTotal } from '../selectors'; import { useSelector } from '../react-redux'; import type { AppNavigationMethods, AppNavigationProp } from '../nav/AppNavigator'; -import { bottomTabNavigatorConfig } from '../styles/tabs'; +import { bottomTabNavOptions } from '../styles/tabs'; import HomeScreen from './HomeScreen'; import PmConversationsScreen from '../pm-conversations/PmConversationsScreen'; import { IconInbox, IconStream, IconPeople } from '../common/Icons'; @@ -53,7 +53,7 @@ export default function MainTabsScreen(props: Props): Node { return ( - + aR.name === reactionName) ? reactionName : undefined } - {...materialTopTabNavigatorConfig()} - swipeEnabled + screenOptions={materialTopTabNavOptions()} > { // Generate tabs for the reaction list. The tabs depend @@ -96,7 +95,6 @@ export default function MessageReactionsScreen(props: Props): Node { } options={{ tabBarLabel: () => ( @@ -108,7 +106,9 @@ export default function MessageReactionsScreen(props: Props): Node { ), }} - /> + > + {() => } + ))} diff --git a/src/sharing/ShareWrapper.js b/src/sharing/ShareWrapper.js index 01c5fe671c0..5b15e3efc6d 100644 --- a/src/sharing/ShareWrapper.js +++ b/src/sharing/ShareWrapper.js @@ -289,7 +289,7 @@ class ShareWrapperInner extends React.PureComponent { const { message, sending } = this.state; return ( - <> + {sharedData.type === 'file' && ( @@ -325,7 +325,7 @@ class ShareWrapperInner extends React.PureComponent { isPressHandledWhenDisabled /> - + ); } } diff --git a/src/sharing/SharingScreen.js b/src/sharing/SharingScreen.js index b07dfdcab09..366ab2771cc 100644 --- a/src/sharing/SharingScreen.js +++ b/src/sharing/SharingScreen.js @@ -10,7 +10,7 @@ import type { RouteParamsOf, RouteProp } from '../react-navigation'; import type { AppNavigationMethods, AppNavigationProp } from '../nav/AppNavigator'; import type { SharedData } from './types'; import { createStyleSheet } from '../styles'; -import { materialTopTabNavigatorConfig } from '../styles/tabs'; +import { materialTopTabNavOptions } from '../styles/tabs'; import { useGlobalSelector } from '../react-redux'; import ZulipTextIntl from '../common/ZulipTextIntl'; import Screen from '../common/Screen'; @@ -63,8 +63,13 @@ export default function SharingScreen(props: Props): Node { }, [hasAuth, navigation]); return ( - - + + ({ - tabBarOptions: { - // TODO: Find a way to tell if we're on an Android tablet, - // and use that -- we don't want to assume Android users - // aren't on tablets, but `isPad` is iOS only and `Platform` - // doesn't have something else for Android (yet): - // https://reactnative.dev/docs/platform#ispad-ios - showLabel: Platform.OS === 'ios' && Platform.isPad, - showIcon: true, +export const bottomTabNavOptions = (): BottomTabNavigationOptions => ({ + headerShown: false, + lazy: false, - activeTintColor: BRAND_COLOR, - inactiveTintColor: 'gray', - labelStyle: { - fontSize: 13, - margin: 0, - }, - tabStyle: { - flex: 1, - }, - style: { - backgroundColor: 'transparent', + // TODO: Find a way to tell if we're on an Android tablet, + // and use that -- we don't want to assume Android users + // aren't on tablets, but `isPad` is iOS only and `Platform` + // doesn't have something else for Android (yet): + // https://reactnative.dev/docs/platform#ispad-ios + tabBarShowLabel: Platform.OS === 'ios' && Platform.isPad, - // Fix a bug introduced in React Navigation v5 that is exposed - // by setting `backgroundColor` to 'transparent', as we do. - elevation: 0, - }, + tabBarActiveTintColor: BRAND_COLOR, + tabBarInactiveTintColor: 'gray', + tabBarLabelStyle: { + fontSize: 13, + margin: 0, + }, + tabBarItemStyle: { + flex: 1, + }, + tabBarStyle: { + backgroundColor: 'transparent', + + // Fix a bug introduced in React Navigation v5 that is exposed + // by setting `backgroundColor` to 'transparent', as we do. + elevation: 0, }, }); -export const materialTopTabNavigatorConfig = (): {| tabBarOptions: MaterialTopTabBarOptions |} => ({ - tabBarOptions: { - showLabel: true, - showIcon: false, - activeTintColor: BRAND_COLOR, - inactiveTintColor: 'gray', - labelStyle: { - fontSize: 13, - margin: 0, - }, - tabStyle: { - flex: 1, - }, +export const materialTopTabNavOptions = (): MaterialTopTabNavigationOptions => ({ + swipeEnabled: true, - pressColor: BRAND_COLOR, - indicatorStyle: { - backgroundColor: BRAND_COLOR, - }, - // TODO: `upperCaseLabel` vanished in react-navigation v5. We - // used to use `false` for this, but it appears that the - // effective default value is `true`, at least for material top - // tab navigators: - // https://github.com/react-navigation/react-navigation/issues/7952 - // - // The coercion into uppercase only happens when the tab-bar - // label (whether that comes directly from - // `options.tabBarLabel`, or from `options.title`) is a string, - // not a more complex React node. It also doesn't seem to happen - // on bottom tab navigators, just material top ones; this - // difference seems to align with Material Design choices (see - // Greg's comment at - // https://github.com/zulip/zulip-mobile/pull/4393#discussion_r556949209f). - style: { - backgroundColor: 'transparent', + tabBarShowLabel: true, + tabBarShowIcon: false, + tabBarActiveTintColor: BRAND_COLOR, + tabBarInactiveTintColor: 'gray', + tabBarLabelStyle: { + fontSize: 13, + margin: 0, + }, + tabBarItemStyle: { + flex: 1, + }, + + tabBarPressColor: BRAND_COLOR, + tabBarIndicatorStyle: { + backgroundColor: BRAND_COLOR, + }, + // TODO: `upperCaseLabel` vanished in react-navigation v5. We + // used to use `false` for this, but it appears that the + // effective default value is `true`, at least for material top + // tab navigators: + // https://github.com/react-navigation/react-navigation/issues/7952 + // + // The coercion into uppercase only happens when the tab-bar + // label (whether that comes directly from + // `options.tabBarLabel`, or from `options.title`) is a string, + // not a more complex React node. It also doesn't seem to happen + // on bottom tab navigators, just material top ones; this + // difference seems to align with Material Design choices (see + // Greg's comment at + // https://github.com/zulip/zulip-mobile/pull/4393#discussion_r556949209f). + tabBarStyle: { + backgroundColor: 'transparent', - // Fix a bug introduced in React Navigation v5 that is exposed - // by setting `backgroundColor` to 'transparent', as we do. - elevation: 0, + // Fix a bug introduced in React Navigation v5 that is exposed + // by setting `backgroundColor` to 'transparent', as we do. + elevation: 0, - // Setting borderWidth and elevation to 0 works around an issue - // affecting react-navigation's createMaterialTopTabNavigator. - // https://github.com/zulip/zulip-mobile/issues/2065 - // https://github.com/satya164/react-native-tab-view/pull/519#issuecomment-689724208 - // TODO: Brief testing suggests this workaround isn't needed; confirm. - borderWidth: 0, - elevation: 0, // eslint-disable-line no-dupe-keys - }, + // Setting borderWidth and elevation to 0 works around an issue + // affecting react-navigation's createMaterialTopTabNavigator. + // https://github.com/zulip/zulip-mobile/issues/2065 + // https://github.com/satya164/react-native-tab-view/pull/519#issuecomment-689724208 + // TODO: Brief testing suggests this workaround isn't needed; confirm. + borderWidth: 0, + elevation: 0, // eslint-disable-line no-dupe-keys }, }); diff --git a/tools/tsflower b/tools/tsflower index 8198ea20778..1e042d93b91 100755 --- a/tools/tsflower +++ b/tools/tsflower @@ -194,7 +194,7 @@ run_only() run_on_package "${package}" format_dir "${rootdir}"/types/"${package}" - for package in @react-navigation/{routers,core,native,stack,bottom-tabs,material-top-tabs}; do + for package in @react-navigation/{routers,core,elements,native,stack,bottom-tabs,material-top-tabs}; do run_on_package "${package}" # TODO(tsflower): skip node_modules when acting on package, # so we don't have to delete it here @@ -202,6 +202,10 @@ run_only() done format_dir "${rootdir}"/types/@react-navigation + package=react-native-pager-view + run_on_package "${package}" + format_dir "${rootdir}"/types/"${package}" + package=react-native-tab-view run_on_package "${package}" # TODO: Send r-n-tab-view a .npmignore patch to stop shipping this directory. diff --git a/types/@react-navigation/bottom-tabs/lib/typescript/src/index.js.flow b/types/@react-navigation/bottom-tabs/lib/typescript/src/index.js.flow index 9e246584130..9acea5ad9fa 100644 --- a/types/@react-navigation/bottom-tabs/lib/typescript/src/index.js.flow +++ b/types/@react-navigation/bottom-tabs/lib/typescript/src/index.js.flow @@ -2,15 +2,17 @@ * @generated by TsFlower */ export { default as createBottomTabNavigator } from './navigators/createBottomTabNavigator'; -export { default as BottomTabView } from './views/BottomTabView'; export { default as BottomTabBar } from './views/BottomTabBar'; +export { default as BottomTabView } from './views/BottomTabView'; +export { default as BottomTabBarHeightCallbackContext } from './utils/BottomTabBarHeightCallbackContext'; export { default as BottomTabBarHeightContext } from './utils/BottomTabBarHeightContext'; export { default as useBottomTabBarHeight } from './utils/useBottomTabBarHeight'; export { + BottomTabBarButtonProps, + BottomTabBarProps, + BottomTabHeaderProps, + BottomTabNavigationEventMap, BottomTabNavigationOptions, BottomTabNavigationProp, BottomTabScreenProps, - BottomTabBarProps, - BottomTabBarOptions, - BottomTabBarButtonProps, } from './types'; diff --git a/types/@react-navigation/bottom-tabs/lib/typescript/src/navigators/createBottomTabNavigator.js.flow b/types/@react-navigation/bottom-tabs/lib/typescript/src/navigators/createBottomTabNavigator.js.flow index 82a86158134..ebf13d3dca0 100644 --- a/types/@react-navigation/bottom-tabs/lib/typescript/src/navigators/createBottomTabNavigator.js.flow +++ b/types/@react-navigation/bottom-tabs/lib/typescript/src/navigators/createBottomTabNavigator.js.flow @@ -1,5 +1,31 @@ /* @flow * @generated by TsFlower */ -declare var _default: any; +import type { TypedNavigator as $tsflower_import_type$_$_40_react_2d_navigation_2f_native$TypedNavigator } from '@react-navigation/native'; +import type { JSX$Element as $tsflower_subst$React$JSX$Element } from 'tsflower/subst/react'; + +import { + type DefaultNavigatorOptions, + type ParamListBase, + type TabNavigationState, + type TabRouterOptions, +} from '@react-navigation/native'; + +import { + type BottomTabNavigationConfig, + type BottomTabNavigationEventMap, + type BottomTabNavigationOptions, +} from '../types'; + +type Props = TabRouterOptions & BottomTabNavigationConfig; +declare function BottomTabNavigator(Props): $tsflower_subst$React$JSX$Element; +declare var _default: < + ParamList: ParamListBase, +>() => $tsflower_import_type$_$_40_react_2d_navigation_2f_native$TypedNavigator< + ParamList, + TabNavigationState, + BottomTabNavigationOptions, + BottomTabNavigationEventMap, + typeof BottomTabNavigator, +>; export default _default; diff --git a/types/@react-navigation/bottom-tabs/lib/typescript/src/types.js.flow b/types/@react-navigation/bottom-tabs/lib/typescript/src/types.js.flow index ed93430579c..240852d71c7 100644 --- a/types/@react-navigation/bottom-tabs/lib/typescript/src/types.js.flow +++ b/types/@react-navigation/bottom-tabs/lib/typescript/src/types.js.flow @@ -19,19 +19,28 @@ import type { MouseEvent as $tsflower_subst$React$MouseEvent, } from 'tsflower/subst/react'; -import * as React from 'react'; -import { typeof Animated } from 'react-native'; +import { type HeaderOptions } from '@react-navigation/elements'; import { + type Descriptor, type NavigationHelpers, type NavigationProp, type ParamListBase, - type Descriptor, - type TabNavigationState, - type TabActionHelpers, type RouteProp, + type TabActionHelpers, + type TabNavigationState, } from '@react-navigation/native'; +import * as React from 'react'; +import { typeof Animated } from 'react-native'; +import { type EdgeInsets } from 'react-native-safe-area-context'; + +export type Layout = { + width: number, + height: number, + ... +}; + export type BottomTabNavigationEventMap = {| tabPress: {| data: void, @@ -48,18 +57,24 @@ export type BottomTabNavigationHelpers = NavigationHelpers< TabActionHelpers; export type BottomTabNavigationProp< ParamList: ParamListBase, - +RouteName: $Keys = string, + +RouteName: $Keys = $Keys, + NavigatorID: string | void = void, > = NavigationProp< ParamList, RouteName, + NavigatorID, TabNavigationState, BottomTabNavigationOptions, BottomTabNavigationEventMap, > & TabActionHelpers; -export type BottomTabScreenProps = string> = { - navigation: BottomTabNavigationProp, +export type BottomTabScreenProps< + ParamList: ParamListBase, + RouteName: $Keys = $Keys, + NavigatorID: string | void = void, +> = { + navigation: BottomTabNavigationProp, route: RouteProp, ... }; @@ -92,7 +107,8 @@ export type TabBarVisibilityAnimationConfig = | TimingKeyboardAnimationConfig | SpringKeyboardAnimationConfig; -export type BottomTabNavigationOptions = { +export type BottomTabNavigationOptions = {| + ...HeaderOptions, title?: string, tabBarLabel?: | string @@ -100,59 +116,56 @@ export type BottomTabNavigationOptions = { focused: boolean, color: string, position: LabelPosition, + children: string, ... }) => $tsflower_subst$React$ReactNode), + tabBarShowLabel?: boolean, + tabBarLabelPosition?: LabelPosition, + tabBarLabelStyle?: $tsflower_subst$RN$StyleProp<$tsflower_subst$RN$TextStyle>, + tabBarAllowFontScaling?: boolean, tabBarIcon?: (props: { focused: boolean, color: string, size: number, ... }) => $tsflower_subst$React$ReactNode, + tabBarIconStyle?: $tsflower_subst$RN$StyleProp<$tsflower_subst$RN$TextStyle>, tabBarBadge?: number | string, tabBarBadgeStyle?: $tsflower_subst$RN$StyleProp<$tsflower_subst$RN$TextStyle>, tabBarAccessibilityLabel?: string, tabBarTestID?: string, - tabBarVisible?: boolean, + tabBarButton?: (props: BottomTabBarButtonProps) => $tsflower_subst$React$ReactNode, + tabBarActiveTintColor?: string, + tabBarInactiveTintColor?: string, + tabBarActiveBackgroundColor?: string, + tabBarInactiveBackgroundColor?: string, + tabBarItemStyle?: $tsflower_subst$RN$StyleProp<$tsflower_subst$RN$ViewStyle>, + tabBarHideOnKeyboard?: boolean, tabBarVisibilityAnimationConfig?: { show?: TabBarVisibilityAnimationConfig, hide?: TabBarVisibilityAnimationConfig, ... }, - tabBarButton?: (props: BottomTabBarButtonProps) => $tsflower_subst$React$ReactNode, + tabBarStyle?: $tsflower_subst$RN$Animated$WithAnimatedValue< + $tsflower_subst$RN$StyleProp<$tsflower_subst$RN$ViewStyle>, + >, + tabBarBackground?: () => $tsflower_subst$React$ReactNode, + lazy?: boolean, + header?: (props: BottomTabHeaderProps) => $tsflower_subst$React$ReactNode, + headerShown?: boolean, unmountOnBlur?: boolean, - ... -}; + freezeOnBlur?: boolean, +|}; export type BottomTabDescriptor = Descriptor< - ParamListBase, - string, - TabNavigationState, BottomTabNavigationOptions, + BottomTabNavigationProp, + RouteProp, >; -export type BottomTabDescriptorMap = { [key: string]: BottomTabDescriptor, ... }; - -export type BottomTabNavigationConfig = { - lazy?: boolean, - tabBar?: (props: BottomTabBarProps) => $tsflower_subst$React$ReactNode, - tabBarOptions?: T, - detachInactiveScreens?: boolean, - sceneContainerStyle?: $tsflower_subst$RN$StyleProp<$tsflower_subst$RN$ViewStyle>, - ... -}; +export type BottomTabDescriptorMap = { [key: string]: BottomTabDescriptor }; -export type BottomTabBarOptions = { - keyboardHidesTabBar?: boolean, - activeTintColor?: string, - inactiveTintColor?: string, - activeBackgroundColor?: string, - inactiveBackgroundColor?: string, - allowFontScaling?: boolean, - showLabel?: boolean, - labelStyle?: $tsflower_subst$RN$StyleProp<$tsflower_subst$RN$TextStyle>, - iconStyle?: $tsflower_subst$RN$StyleProp<$tsflower_subst$RN$TextStyle>, - tabStyle?: $tsflower_subst$RN$StyleProp<$tsflower_subst$RN$ViewStyle>, - labelPosition?: LabelPosition, - adaptive?: boolean, +export type BottomTabNavigationConfig = { + tabBar?: (props: BottomTabBarProps) => $tsflower_subst$React$ReactNode, safeAreaInsets?: { top?: number, right?: number, @@ -160,16 +173,24 @@ export type BottomTabBarOptions = { left?: number, ... }, - style?: $tsflower_subst$RN$Animated$WithAnimatedValue< - $tsflower_subst$RN$StyleProp<$tsflower_subst$RN$ViewStyle>, - >, + detachInactiveScreens?: boolean, + sceneContainerStyle?: $tsflower_subst$RN$StyleProp<$tsflower_subst$RN$ViewStyle>, + ... +}; + +export type BottomTabHeaderProps = { + layout: Layout, + options: BottomTabNavigationOptions, + route: RouteProp, + navigation: BottomTabNavigationProp, ... }; -export type BottomTabBarProps = T & { +export type BottomTabBarProps = { state: TabNavigationState, descriptors: BottomTabDescriptorMap, navigation: NavigationHelpers, + insets: EdgeInsets, ... }; diff --git a/types/@react-navigation/bottom-tabs/lib/typescript/src/utils/useBottomTabBarHeight.js.flow b/types/@react-navigation/bottom-tabs/lib/typescript/src/utils/useBottomTabBarHeight.js.flow index e3246f6f468..44b71bd42c8 100644 --- a/types/@react-navigation/bottom-tabs/lib/typescript/src/utils/useBottomTabBarHeight.js.flow +++ b/types/@react-navigation/bottom-tabs/lib/typescript/src/utils/useBottomTabBarHeight.js.flow @@ -1,4 +1,4 @@ /* @flow * @generated by TsFlower */ -declare export default function useFloatingBottomTabBarHeight(): number; +declare export default function useBottomTabBarHeight(): number; diff --git a/types/@react-navigation/bottom-tabs/lib/typescript/src/utils/useWindowDimensions.js.flow b/types/@react-navigation/bottom-tabs/lib/typescript/src/utils/useWindowDimensions.js.flow deleted file mode 100644 index 9441380aa77..00000000000 --- a/types/@react-navigation/bottom-tabs/lib/typescript/src/utils/useWindowDimensions.js.flow +++ /dev/null @@ -1,8 +0,0 @@ -/* @flow - * @generated by TsFlower - */ -declare export default function useWindowDimensions(): { - height: number, - width: number, - ... -}; diff --git a/types/@react-navigation/bottom-tabs/lib/typescript/src/views/BottomTabBar.js.flow b/types/@react-navigation/bottom-tabs/lib/typescript/src/views/BottomTabBar.js.flow index b8876d3924b..65149ba73f8 100644 --- a/types/@react-navigation/bottom-tabs/lib/typescript/src/views/BottomTabBar.js.flow +++ b/types/@react-navigation/bottom-tabs/lib/typescript/src/views/BottomTabBar.js.flow @@ -2,25 +2,26 @@ * @generated by TsFlower */ import type { + WithAnimatedValue as $tsflower_subst$RN$Animated$WithAnimatedValue, StyleProp as $tsflower_subst$RN$StyleProp, ViewStyle as $tsflower_subst$RN$ViewStyle, - WithAnimatedValue as $tsflower_subst$RN$Animated$WithAnimatedValue, } from 'tsflower/subst/react-native'; import type { JSX$Element as $tsflower_subst$React$JSX$Element } from 'tsflower/subst/react'; +import { type ParamListBase, type TabNavigationState } from '@react-navigation/native'; import { Animated } from 'react-native'; -import { type TabNavigationState, type ParamListBase } from '@react-navigation/native'; import { type EdgeInsets } from 'react-native-safe-area-context'; -import { type BottomTabBarProps, type LabelPosition } from '../types'; - -type Props = BottomTabBarProps<> & { - activeTintColor?: string, - inactiveTintColor?: string, +import { type BottomTabBarProps, type BottomTabDescriptorMap } from '../types'; +type Props = BottomTabBarProps & { + style?: $tsflower_subst$RN$Animated$WithAnimatedValue< + $tsflower_subst$RN$StyleProp<$tsflower_subst$RN$ViewStyle>, + >, ... }; type Options = { state: TabNavigationState, + descriptors: BottomTabDescriptorMap, layout: { height: number, width: number, @@ -31,9 +32,6 @@ type Options = { width: number, ... }, - tabStyle: $tsflower_subst$RN$StyleProp<$tsflower_subst$RN$ViewStyle>, - labelPosition: LabelPosition | void, - adaptive: boolean | void, ... }; @@ -42,7 +40,7 @@ declare export var getTabBarHeight: ( insets: EdgeInsets, style: $tsflower_subst$RN$Animated$WithAnimatedValue< $tsflower_subst$RN$StyleProp<$tsflower_subst$RN$ViewStyle>, - >, + > | void, ... }, ) => number; diff --git a/types/@react-navigation/bottom-tabs/lib/typescript/src/views/BottomTabItem.js.flow b/types/@react-navigation/bottom-tabs/lib/typescript/src/views/BottomTabItem.js.flow index c27bbc9f0e6..26553aaeedf 100644 --- a/types/@react-navigation/bottom-tabs/lib/typescript/src/views/BottomTabItem.js.flow +++ b/types/@react-navigation/bottom-tabs/lib/typescript/src/views/BottomTabItem.js.flow @@ -4,6 +4,7 @@ import type { ReactNode as $tsflower_subst$React$ReactNode, MouseEvent as $tsflower_subst$React$MouseEvent, + JSXElementConstructor as $tsflower_subst$React$JSXElementConstructor, } from 'tsflower/subst/react'; import type { @@ -13,23 +14,29 @@ import type { ViewStyle as $tsflower_subst$RN$ViewStyle, } from 'tsflower/subst/react-native'; +import { type Route } from '@react-navigation/native'; import React from 'react'; import 'react-native'; -import { type Route } from '@react-navigation/native'; -import { type BottomTabBarButtonProps, type LabelPosition } from '../types'; +import { + type BottomTabBarButtonProps, + type BottomTabDescriptor, + type LabelPosition, +} from '../types'; type Props = { focused: boolean, route: Route, + descriptor: BottomTabDescriptor, label: | string | ((props: { focused: boolean, color: string, position: LabelPosition, + children: string, ... }) => $tsflower_subst$React$ReactNode), - icon?: (props: { + icon: (props: { focused: boolean, size: number, color: string, @@ -62,17 +69,5 @@ type Props = { declare export default function BottomTabBarItem( Props, -): React$Element< - | string - | (( - props: any, - ) => - | React$Element< - | string - | any - | $FlowFixMe /* new (props: any) => React.Component */ /* tsflower-unimplemented: ConstructorType */, - > - | null - | $FlowFixMe) /* new (props: any) => React.Component */ /* tsflower-unimplemented: ConstructorType */, ->; +): React$Element>; export {}; diff --git a/types/@react-navigation/bottom-tabs/lib/typescript/src/views/BottomTabView.js.flow b/types/@react-navigation/bottom-tabs/lib/typescript/src/views/BottomTabView.js.flow index 1d54dfea7d2..126e2d15a01 100644 --- a/types/@react-navigation/bottom-tabs/lib/typescript/src/views/BottomTabView.js.flow +++ b/types/@react-navigation/bottom-tabs/lib/typescript/src/views/BottomTabView.js.flow @@ -2,35 +2,20 @@ * @generated by TsFlower */ import type { JSX$Element as $tsflower_subst$React$JSX$Element } from 'tsflower/subst/react'; -import * as React from 'react'; import { type ParamListBase, type TabNavigationState } from '@react-navigation/native'; import { - type BottomTabNavigationConfig, type BottomTabDescriptorMap, + type BottomTabNavigationConfig, type BottomTabNavigationHelpers, } from '../types'; -type Props = BottomTabNavigationConfig<> & { +type Props = BottomTabNavigationConfig & { state: TabNavigationState, navigation: BottomTabNavigationHelpers, descriptors: BottomTabDescriptorMap, ... }; -type State = { - loaded: string[], - tabBarHeight: number, - ... -}; - -declare export default class BottomTabView extends React.Component { - defaultProps: { lazy: boolean, ... }; - getDerivedStateFromProps(nextProps: Props, prevState: State): { loaded: any[], ... }; - constructor(props: Props): any; - renderTabBar: any; - handleTabBarHeightChange: any; - render(): $tsflower_subst$React$JSX$Element; -} - +declare export default function BottomTabView(props: Props): $tsflower_subst$React$JSX$Element; export {}; diff --git a/types/@react-navigation/bottom-tabs/lib/typescript/src/views/SafeAreaProviderCompat.js.flow b/types/@react-navigation/bottom-tabs/lib/typescript/src/views/SafeAreaProviderCompat.js.flow deleted file mode 100644 index d6022577963..00000000000 --- a/types/@react-navigation/bottom-tabs/lib/typescript/src/views/SafeAreaProviderCompat.js.flow +++ /dev/null @@ -1,29 +0,0 @@ -/* @flow - * @generated by TsFlower - */ -import type { - ReactNode as $tsflower_subst$React$ReactNode, - JSX$Element as $tsflower_subst$React$JSX$Element, -} from 'tsflower/subst/react'; - -import * as React from 'react'; - -declare export var initialSafeAreaInsets: - | { - top: number, - bottom: number, - right: number, - left: number, - ... - } - | { - top: number, - right: number, - bottom: number, - left: number, - ... - }; - -type Props = { children: $tsflower_subst$React$ReactNode, ... }; -declare export default function SafeAreaProviderCompat(Props): $tsflower_subst$React$JSX$Element; -export {}; diff --git a/types/react-native-tab-view/lib/typescript/src/TouchableItem.js.flow b/types/@react-navigation/bottom-tabs/lib/typescript/src/views/ScreenFallback.js.flow similarity index 54% rename from types/react-native-tab-view/lib/typescript/src/TouchableItem.js.flow rename to types/@react-navigation/bottom-tabs/lib/typescript/src/views/ScreenFallback.js.flow index 66d35b3f429..9cb36854029 100644 --- a/types/react-native-tab-view/lib/typescript/src/TouchableItem.js.flow +++ b/types/@react-navigation/bottom-tabs/lib/typescript/src/views/ScreenFallback.js.flow @@ -1,35 +1,37 @@ /* @flow * @generated by TsFlower */ -import type { - ViewProps as $tsflower_subst$RN$ViewProps, - StyleProp as $tsflower_subst$RN$StyleProp, - ViewStyle as $tsflower_subst$RN$ViewStyle, -} from 'tsflower/subst/react-native'; - import type { ReactNode as $tsflower_subst$React$ReactNode, JSX$Element as $tsflower_subst$React$JSX$Element, } from 'tsflower/subst/react'; +import type { + StyleProp as $tsflower_subst$RN$StyleProp, + ViewStyle as $tsflower_subst$RN$ViewStyle, + ViewProps as $tsflower_subst$RN$ViewProps, +} from 'tsflower/subst/react-native'; + import * as React from 'react'; import 'react-native'; -type Props = $tsflower_subst$RN$ViewProps & { - onPress: () => void, - onLongPress?: () => void, - delayPressIn?: number, - borderless?: boolean, - pressColor: string, - pressOpacity?: number, - children?: $tsflower_subst$React$ReactNode, +type Props = { + visible: boolean, + children: $tsflower_subst$React$ReactNode, + enabled: boolean, + freezeOnBlur?: boolean, style?: $tsflower_subst$RN$StyleProp<$tsflower_subst$RN$ViewStyle>, ... }; -declare export default class TouchableItem extends React.Component { - defaultProps: { pressColor: string, ... }; - render(): $tsflower_subst$React$JSX$Element; -} +declare export var MaybeScreenContainer: ( + $tsflower_subst$RN$ViewProps & { + enabled: boolean, + hasTwoStates: boolean, + children: $tsflower_subst$React$ReactNode, + ... + }, +) => $tsflower_subst$React$JSX$Element; +declare export function MaybeScreen(Props): $tsflower_subst$React$JSX$Element; export {}; diff --git a/types/@react-navigation/bottom-tabs/lib/typescript/src/views/TabBarIcon.js.flow b/types/@react-navigation/bottom-tabs/lib/typescript/src/views/TabBarIcon.js.flow index ca0ec554859..4095a54a4e9 100644 --- a/types/@react-navigation/bottom-tabs/lib/typescript/src/views/TabBarIcon.js.flow +++ b/types/@react-navigation/bottom-tabs/lib/typescript/src/views/TabBarIcon.js.flow @@ -12,9 +12,9 @@ import type { JSX$Element as $tsflower_subst$React$JSX$Element, } from 'tsflower/subst/react'; +import { type Route } from '@react-navigation/native'; import React from 'react'; import 'react-native'; -import { type Route } from '@react-navigation/native'; type Props = { route: Route, diff --git a/types/@react-navigation/elements/index.js.flow b/types/@react-navigation/elements/index.js.flow new file mode 100644 index 00000000000..8af8d9b993c --- /dev/null +++ b/types/@react-navigation/elements/index.js.flow @@ -0,0 +1,4 @@ +/* @flow + * @generated + */ +export * from './lib/typescript/src/index.js.flow'; diff --git a/types/@react-navigation/elements/lib/typescript/src/Background.js.flow b/types/@react-navigation/elements/lib/typescript/src/Background.js.flow new file mode 100644 index 00000000000..9ebcebc3039 --- /dev/null +++ b/types/@react-navigation/elements/lib/typescript/src/Background.js.flow @@ -0,0 +1,15 @@ +/* @flow + * @generated by TsFlower + */ +import type { ViewProps as $tsflower_subst$RN$ViewProps } from 'tsflower/subst/react-native'; + +import type { + ReactNode as $tsflower_subst$React$ReactNode, + JSX$Element as $tsflower_subst$React$JSX$Element, +} from 'tsflower/subst/react'; + +import * as React from 'react'; +import 'react-native'; +type Props = $tsflower_subst$RN$ViewProps & { children: $tsflower_subst$React$ReactNode, ... }; +declare export default function Background(Props): $tsflower_subst$React$JSX$Element; +export {}; diff --git a/types/@react-navigation/elements/lib/typescript/src/Header/Header.js.flow b/types/@react-navigation/elements/lib/typescript/src/Header/Header.js.flow new file mode 100644 index 00000000000..447793e3025 --- /dev/null +++ b/types/@react-navigation/elements/lib/typescript/src/Header/Header.js.flow @@ -0,0 +1,15 @@ +/* @flow + * @generated by TsFlower + */ +import type { JSX$Element as $tsflower_subst$React$JSX$Element } from 'tsflower/subst/react'; +import { type HeaderOptions, type Layout } from '../types'; + +type Props = HeaderOptions & { + modal?: boolean, + layout?: Layout, + title: string, + ... +}; + +declare export default function Header(props: Props): $tsflower_subst$React$JSX$Element; +export {}; diff --git a/types/@react-navigation/elements/lib/typescript/src/Header/HeaderBackButton.js.flow b/types/@react-navigation/elements/lib/typescript/src/Header/HeaderBackButton.js.flow new file mode 100644 index 00000000000..edb06b37c10 --- /dev/null +++ b/types/@react-navigation/elements/lib/typescript/src/Header/HeaderBackButton.js.flow @@ -0,0 +1,8 @@ +/* @flow + * @generated by TsFlower + */ +import type { JSX$Element as $tsflower_subst$React$JSX$Element } from 'tsflower/subst/react'; +import { type HeaderBackButtonProps } from '../types'; +declare export default function HeaderBackButton( + HeaderBackButtonProps, +): $tsflower_subst$React$JSX$Element; diff --git a/types/@react-navigation/elements/lib/typescript/src/Header/HeaderBackContext.js.flow b/types/@react-navigation/elements/lib/typescript/src/Header/HeaderBackContext.js.flow new file mode 100644 index 00000000000..652ca2f8d9a --- /dev/null +++ b/types/@react-navigation/elements/lib/typescript/src/Header/HeaderBackContext.js.flow @@ -0,0 +1,6 @@ +/* @flow + * @generated by TsFlower + */ +import type { Context as $tsflower_import_type$_$react$Context } from 'react'; +declare var HeaderBackContext: $tsflower_import_type$_$react$Context<{ title: string, ... } | void>; +export default HeaderBackContext; diff --git a/types/@react-navigation/elements/lib/typescript/src/Header/HeaderBackground.js.flow b/types/@react-navigation/elements/lib/typescript/src/Header/HeaderBackground.js.flow new file mode 100644 index 00000000000..b65f6935552 --- /dev/null +++ b/types/@react-navigation/elements/lib/typescript/src/Header/HeaderBackground.js.flow @@ -0,0 +1,28 @@ +/* @flow + * @generated by TsFlower + */ +import type { + ViewProps as $tsflower_subst$RN$ViewProps, + WithAnimatedValue as $tsflower_subst$RN$Animated$WithAnimatedValue, + StyleProp as $tsflower_subst$RN$StyleProp, + ViewStyle as $tsflower_subst$RN$ViewStyle, +} from 'tsflower/subst/react-native'; + +import type { + ReactNode as $tsflower_subst$React$ReactNode, + JSX$Element as $tsflower_subst$React$JSX$Element, +} from 'tsflower/subst/react'; + +import * as React from 'react'; +import { Animated } from 'react-native'; + +type Props = $Diff<$tsflower_subst$RN$ViewProps, {| style: mixed |}> & { + style?: $tsflower_subst$RN$Animated$WithAnimatedValue< + $tsflower_subst$RN$StyleProp<$tsflower_subst$RN$ViewStyle>, + >, + children?: $tsflower_subst$React$ReactNode, + ... +}; + +declare export default function HeaderBackground(Props): $tsflower_subst$React$JSX$Element; +export {}; diff --git a/types/@react-navigation/elements/lib/typescript/src/Header/HeaderHeightContext.js.flow b/types/@react-navigation/elements/lib/typescript/src/Header/HeaderHeightContext.js.flow new file mode 100644 index 00000000000..0a539dfd16e --- /dev/null +++ b/types/@react-navigation/elements/lib/typescript/src/Header/HeaderHeightContext.js.flow @@ -0,0 +1,6 @@ +/* @flow + * @generated by TsFlower + */ +import type { Context as $tsflower_import_type$_$react$Context } from 'react'; +declare var HeaderHeightContext: $tsflower_import_type$_$react$Context; +export default HeaderHeightContext; diff --git a/types/@react-navigation/elements/lib/typescript/src/Header/HeaderShownContext.js.flow b/types/@react-navigation/elements/lib/typescript/src/Header/HeaderShownContext.js.flow new file mode 100644 index 00000000000..861514a2661 --- /dev/null +++ b/types/@react-navigation/elements/lib/typescript/src/Header/HeaderShownContext.js.flow @@ -0,0 +1,6 @@ +/* @flow + * @generated by TsFlower + */ +import type { Context as $tsflower_import_type$_$react$Context } from 'react'; +declare var HeaderShownContext: $tsflower_import_type$_$react$Context; +export default HeaderShownContext; diff --git a/types/@react-navigation/elements/lib/typescript/src/Header/HeaderTitle.js.flow b/types/@react-navigation/elements/lib/typescript/src/Header/HeaderTitle.js.flow new file mode 100644 index 00000000000..94559721b1e --- /dev/null +++ b/types/@react-navigation/elements/lib/typescript/src/Header/HeaderTitle.js.flow @@ -0,0 +1,23 @@ +/* @flow + * @generated by TsFlower + */ +import type { + TextProps as $tsflower_subst$RN$TextProps, + WithAnimatedValue as $tsflower_subst$RN$Animated$WithAnimatedValue, + StyleProp as $tsflower_subst$RN$StyleProp, + TextStyle as $tsflower_subst$RN$TextStyle, +} from 'tsflower/subst/react-native'; + +import type { JSX$Element as $tsflower_subst$React$JSX$Element } from 'tsflower/subst/react'; +import { Animated } from 'react-native'; + +type Props = $Diff<$tsflower_subst$RN$TextProps, {| style: mixed |}> & { + tintColor?: string, + style?: $tsflower_subst$RN$Animated$WithAnimatedValue< + $tsflower_subst$RN$StyleProp<$tsflower_subst$RN$TextStyle>, + >, + ... +}; + +declare export default function HeaderTitle(Props): $tsflower_subst$React$JSX$Element; +export {}; diff --git a/types/@react-navigation/elements/lib/typescript/src/Header/getDefaultHeaderHeight.js.flow b/types/@react-navigation/elements/lib/typescript/src/Header/getDefaultHeaderHeight.js.flow new file mode 100644 index 00000000000..a6e04f65391 --- /dev/null +++ b/types/@react-navigation/elements/lib/typescript/src/Header/getDefaultHeaderHeight.js.flow @@ -0,0 +1,9 @@ +/* @flow + * @generated by TsFlower + */ +import { type Layout } from '../types'; +declare export default function getDefaultHeaderHeight( + layout: Layout, + modalPresentation: boolean, + statusBarHeight: number, +): number; diff --git a/types/@react-navigation/elements/lib/typescript/src/Header/getHeaderTitle.js.flow b/types/@react-navigation/elements/lib/typescript/src/Header/getHeaderTitle.js.flow new file mode 100644 index 00000000000..8ff99e031dc --- /dev/null +++ b/types/@react-navigation/elements/lib/typescript/src/Header/getHeaderTitle.js.flow @@ -0,0 +1,13 @@ +/* @flow + * @generated by TsFlower + */ +import { type HeaderOptions } from '../types'; + +declare export default function getHeaderTitle( + options: { + title?: string, + headerTitle?: $ElementType, + ... + }, + fallback: string, +): string; diff --git a/types/@react-navigation/elements/lib/typescript/src/Header/useHeaderHeight.js.flow b/types/@react-navigation/elements/lib/typescript/src/Header/useHeaderHeight.js.flow new file mode 100644 index 00000000000..fd97c706c14 --- /dev/null +++ b/types/@react-navigation/elements/lib/typescript/src/Header/useHeaderHeight.js.flow @@ -0,0 +1,4 @@ +/* @flow + * @generated by TsFlower + */ +declare export default function useHeaderHeight(): number; diff --git a/types/@react-navigation/elements/lib/typescript/src/MaskedView.android.js.flow b/types/@react-navigation/elements/lib/typescript/src/MaskedView.android.js.flow new file mode 100644 index 00000000000..37ab18994e4 --- /dev/null +++ b/types/@react-navigation/elements/lib/typescript/src/MaskedView.android.js.flow @@ -0,0 +1,4 @@ +/* @flow + * @generated by TsFlower + */ +export { default } from './MaskedViewNative'; diff --git a/types/@react-navigation/elements/lib/typescript/src/MaskedView.ios.js.flow b/types/@react-navigation/elements/lib/typescript/src/MaskedView.ios.js.flow new file mode 100644 index 00000000000..37ab18994e4 --- /dev/null +++ b/types/@react-navigation/elements/lib/typescript/src/MaskedView.ios.js.flow @@ -0,0 +1,4 @@ +/* @flow + * @generated by TsFlower + */ +export { default } from './MaskedViewNative'; diff --git a/types/@react-navigation/elements/lib/typescript/src/MaskedView.js.flow b/types/@react-navigation/elements/lib/typescript/src/MaskedView.js.flow new file mode 100644 index 00000000000..45d000a1985 --- /dev/null +++ b/types/@react-navigation/elements/lib/typescript/src/MaskedView.js.flow @@ -0,0 +1,16 @@ +/* @flow + * @generated by TsFlower + */ +import type { JSXElementConstructor as $tsflower_subst$React$JSXElementConstructor } from 'tsflower/subst/react'; +import * as React from 'react'; + +type Props = { + maskElement: React$Element, + children: React$Element, + ... +}; + +declare export default function MaskedView( + Props, +): React$Element>; +export {}; diff --git a/types/@react-navigation/elements/lib/typescript/src/MaskedViewNative.js.flow b/types/@react-navigation/elements/lib/typescript/src/MaskedViewNative.js.flow new file mode 100644 index 00000000000..cc5fc230662 --- /dev/null +++ b/types/@react-navigation/elements/lib/typescript/src/MaskedViewNative.js.flow @@ -0,0 +1,15 @@ +/* @flow + * @generated by TsFlower + */ +import type { JSX$Element as $tsflower_subst$React$JSX$Element } from 'tsflower/subst/react'; +import type { ViewProps as $tsflower_subst$RN$ViewProps } from 'tsflower/subst/react-native'; + +type Props = { + ...$tsflower_subst$RN$ViewProps, + maskElement: React$Element, + androidRenderingMode?: 'software' | 'hardware', + children: React$Element, + ... +}; +declare export default function MaskedView(Props): $tsflower_subst$React$JSX$Element; +export {}; diff --git a/types/@react-navigation/elements/lib/typescript/src/MissingIcon.js.flow b/types/@react-navigation/elements/lib/typescript/src/MissingIcon.js.flow new file mode 100644 index 00000000000..cc4d8ad4336 --- /dev/null +++ b/types/@react-navigation/elements/lib/typescript/src/MissingIcon.js.flow @@ -0,0 +1,20 @@ +/* @flow + * @generated by TsFlower + */ +import type { + StyleProp as $tsflower_subst$RN$StyleProp, + TextStyle as $tsflower_subst$RN$TextStyle, +} from 'tsflower/subst/react-native'; + +import type { JSX$Element as $tsflower_subst$React$JSX$Element } from 'tsflower/subst/react'; +import 'react-native'; + +type Props = { + color?: string, + size?: number, + style?: $tsflower_subst$RN$StyleProp<$tsflower_subst$RN$TextStyle>, + ... +}; + +declare export default function MissingIcon(Props): $tsflower_subst$React$JSX$Element; +export {}; diff --git a/types/@react-navigation/elements/lib/typescript/src/PlatformPressable.js.flow b/types/@react-navigation/elements/lib/typescript/src/PlatformPressable.js.flow new file mode 100644 index 00000000000..ccb1f6d7beb --- /dev/null +++ b/types/@react-navigation/elements/lib/typescript/src/PlatformPressable.js.flow @@ -0,0 +1,29 @@ +/* @flow + * @generated by TsFlower + */ +import type { + PressableProps as $tsflower_subst$RN$PressableProps, + WithAnimatedValue as $tsflower_subst$RN$Animated$WithAnimatedValue, + StyleProp as $tsflower_subst$RN$StyleProp, + ViewStyle as $tsflower_subst$RN$ViewStyle, +} from 'tsflower/subst/react-native'; + +import type { + ReactNode as $tsflower_subst$React$ReactNode, + JSX$Element as $tsflower_subst$React$JSX$Element, +} from 'tsflower/subst/react'; + +import * as React from 'react'; +import { Animated } from 'react-native'; + +export type Props = $Diff<$tsflower_subst$RN$PressableProps, {| style: mixed |}> & { + pressColor?: string, + pressOpacity?: number, + style?: $tsflower_subst$RN$Animated$WithAnimatedValue< + $tsflower_subst$RN$StyleProp<$tsflower_subst$RN$ViewStyle>, + >, + children: $tsflower_subst$React$ReactNode, + ... +}; + +declare export default function PlatformPressable(Props): $tsflower_subst$React$JSX$Element; diff --git a/types/@react-navigation/bottom-tabs/lib/typescript/src/views/ResourceSavingScene.js.flow b/types/@react-navigation/elements/lib/typescript/src/ResourceSavingView.js.flow similarity index 60% rename from types/@react-navigation/bottom-tabs/lib/typescript/src/views/ResourceSavingScene.js.flow rename to types/@react-navigation/elements/lib/typescript/src/ResourceSavingView.js.flow index e3792c55e84..34c0bebd251 100644 --- a/types/@react-navigation/bottom-tabs/lib/typescript/src/views/ResourceSavingScene.js.flow +++ b/types/@react-navigation/elements/lib/typescript/src/ResourceSavingView.js.flow @@ -6,13 +6,18 @@ import type { JSX$Element as $tsflower_subst$React$JSX$Element, } from 'tsflower/subst/react'; +import type { + StyleProp as $tsflower_subst$RN$StyleProp, + ViewStyle as $tsflower_subst$RN$ViewStyle, +} from 'tsflower/subst/react-native'; + import * as React from 'react'; +import 'react-native'; type Props = { - isVisible: boolean, + visible: boolean, children: $tsflower_subst$React$ReactNode, - enabled: boolean, - style?: any, + style?: $tsflower_subst$RN$StyleProp<$tsflower_subst$RN$ViewStyle>, ... }; diff --git a/types/@react-navigation/elements/lib/typescript/src/SafeAreaProviderCompat.js.flow b/types/@react-navigation/elements/lib/typescript/src/SafeAreaProviderCompat.js.flow new file mode 100644 index 00000000000..6cfa11265ec --- /dev/null +++ b/types/@react-navigation/elements/lib/typescript/src/SafeAreaProviderCompat.js.flow @@ -0,0 +1,32 @@ +/* @flow + * @generated by TsFlower + */ +import type { + ReactNode as $tsflower_subst$React$ReactNode, + JSX$Element as $tsflower_subst$React$JSX$Element, +} from 'tsflower/subst/react'; + +import type { + StyleProp as $tsflower_subst$RN$StyleProp, + ViewStyle as $tsflower_subst$RN$ViewStyle, +} from 'tsflower/subst/react-native'; + +import * as React from 'react'; +import 'react-native'; +import { type Metrics } from 'react-native-safe-area-context'; + +type Props = { + children: $tsflower_subst$React$ReactNode, + style?: $tsflower_subst$RN$StyleProp<$tsflower_subst$RN$ViewStyle>, + ... +}; + +declare function SafeAreaProviderCompat(Props): $tsflower_subst$React$JSX$Element; + +/* tsflower-unimplemented: ModuleDeclaration */ +/* +declare namespace SafeAreaProviderCompat { + var initialMetrics: Metrics; +} */ + +export default SafeAreaProviderCompat; diff --git a/types/@react-navigation/elements/lib/typescript/src/Screen.js.flow b/types/@react-navigation/elements/lib/typescript/src/Screen.js.flow new file mode 100644 index 00000000000..e3163ec4565 --- /dev/null +++ b/types/@react-navigation/elements/lib/typescript/src/Screen.js.flow @@ -0,0 +1,33 @@ +/* @flow + * @generated by TsFlower + */ +import type { + ReactNode as $tsflower_subst$React$ReactNode, + JSX$Element as $tsflower_subst$React$JSX$Element, +} from 'tsflower/subst/react'; + +import type { + StyleProp as $tsflower_subst$RN$StyleProp, + ViewStyle as $tsflower_subst$RN$ViewStyle, +} from 'tsflower/subst/react-native'; + +import { type NavigationProp, type ParamListBase, type RouteProp } from '@react-navigation/native'; +import * as React from 'react'; +import 'react-native'; + +type Props = { + focused: boolean, + modal?: boolean, + navigation: NavigationProp, + route: RouteProp, + header: $tsflower_subst$React$ReactNode, + headerShown?: boolean, + headerStatusBarHeight?: number, + headerTransparent?: boolean, + style?: $tsflower_subst$RN$StyleProp<$tsflower_subst$RN$ViewStyle>, + children: $tsflower_subst$React$ReactNode, + ... +}; + +declare export default function Screen(props: Props): $tsflower_subst$React$JSX$Element; +export {}; diff --git a/types/@react-navigation/elements/lib/typescript/src/getNamedContext.js.flow b/types/@react-navigation/elements/lib/typescript/src/getNamedContext.js.flow new file mode 100644 index 00000000000..bf6bb8fb5d0 --- /dev/null +++ b/types/@react-navigation/elements/lib/typescript/src/getNamedContext.js.flow @@ -0,0 +1,16 @@ +/* @flow + * @generated by TsFlower + */ +import type { Context as $tsflower_subst$React$Context } from 'tsflower/subst/react'; +import * as React from 'react'; + +/* tsflower-unimplemented: ModuleDeclaration */ +/* +declare global { + var __react_navigation__elements_contexts: Map>; +} */ + +declare export default function getNamedContext( + name: string, + initialValue: T, +): $tsflower_subst$React$Context; diff --git a/types/@react-navigation/elements/lib/typescript/src/index.js.flow b/types/@react-navigation/elements/lib/typescript/src/index.js.flow new file mode 100644 index 00000000000..dc4cf50381c --- /dev/null +++ b/types/@react-navigation/elements/lib/typescript/src/index.js.flow @@ -0,0 +1,21 @@ +/* @flow + * @generated by TsFlower + */ +export { default as Background } from './Background'; +export { default as getDefaultHeaderHeight } from './Header/getDefaultHeaderHeight'; +export { default as getHeaderTitle } from './Header/getHeaderTitle'; +export { default as Header } from './Header/Header'; +export { default as HeaderBackButton } from './Header/HeaderBackButton'; +export { default as HeaderBackContext } from './Header/HeaderBackContext'; +export { default as HeaderBackground } from './Header/HeaderBackground'; +export { default as HeaderHeightContext } from './Header/HeaderHeightContext'; +export { default as HeaderShownContext } from './Header/HeaderShownContext'; +export { default as HeaderTitle } from './Header/HeaderTitle'; +export { default as useHeaderHeight } from './Header/useHeaderHeight'; +export { default as MissingIcon } from './MissingIcon'; +export { default as PlatformPressable } from './PlatformPressable'; +export { default as ResourceSavingView } from './ResourceSavingView'; +export { default as SafeAreaProviderCompat } from './SafeAreaProviderCompat'; +export { default as Screen } from './Screen'; +declare export var Assets: any[]; +export * from './types'; diff --git a/types/@react-navigation/elements/lib/typescript/src/types.js.flow b/types/@react-navigation/elements/lib/typescript/src/types.js.flow new file mode 100644 index 00000000000..30869a99291 --- /dev/null +++ b/types/@react-navigation/elements/lib/typescript/src/types.js.flow @@ -0,0 +1,109 @@ +/* @flow + * @generated by TsFlower + */ + +import type { ReactNode as $tsflower_subst$React$ReactNode } from 'tsflower/subst/react'; +import type { + WithAnimatedValue as $tsflower_subst$RN$Animated$WithAnimatedValue, + StyleProp as $tsflower_subst$RN$StyleProp, + TextStyle as $tsflower_subst$RN$TextStyle, + ViewStyle as $tsflower_subst$RN$ViewStyle, + LayoutChangeEvent as $tsflower_subst$RN$LayoutChangeEvent, +} from 'tsflower/subst/react-native'; + +import { typeof Animated } from 'react-native'; + +export type Layout = { + width: number, + height: number, + ... +}; + +export type HeaderOptions = {| + headerTitle?: string | ((props: HeaderTitleProps) => $tsflower_subst$React$ReactNode), + headerTitleAlign?: 'left' | 'center', + headerTitleStyle?: $tsflower_subst$RN$Animated$WithAnimatedValue< + $tsflower_subst$RN$StyleProp<$tsflower_subst$RN$TextStyle>, + >, + headerTitleContainerStyle?: $tsflower_subst$RN$Animated$WithAnimatedValue< + $tsflower_subst$RN$StyleProp<$tsflower_subst$RN$ViewStyle>, + >, + headerTitleAllowFontScaling?: boolean, + headerLeft?: (props: { + tintColor?: string, + pressColor?: string, + pressOpacity?: number, + labelVisible?: boolean, + ... + }) => $tsflower_subst$React$ReactNode, + headerLeftLabelVisible?: boolean, + headerLeftContainerStyle?: $tsflower_subst$RN$Animated$WithAnimatedValue< + $tsflower_subst$RN$StyleProp<$tsflower_subst$RN$ViewStyle>, + >, + headerRight?: (props: { + tintColor?: string, + pressColor?: string, + pressOpacity?: number, + ... + }) => $tsflower_subst$React$ReactNode, + headerRightContainerStyle?: $tsflower_subst$RN$Animated$WithAnimatedValue< + $tsflower_subst$RN$StyleProp<$tsflower_subst$RN$ViewStyle>, + >, + headerPressColor?: string, + headerPressOpacity?: number, + headerTintColor?: string, + headerBackground?: (props: { + style: $tsflower_subst$RN$Animated$WithAnimatedValue< + $tsflower_subst$RN$StyleProp<$tsflower_subst$RN$ViewStyle>, + >, + ... + }) => $tsflower_subst$React$ReactNode, + headerBackgroundContainerStyle?: $tsflower_subst$RN$Animated$WithAnimatedValue< + $tsflower_subst$RN$StyleProp<$tsflower_subst$RN$ViewStyle>, + >, + headerTransparent?: boolean, + headerStyle?: $tsflower_subst$RN$Animated$WithAnimatedValue< + $tsflower_subst$RN$StyleProp<$tsflower_subst$RN$ViewStyle>, + >, + headerShadowVisible?: boolean, + headerStatusBarHeight?: number, +|}; + +export type HeaderTitleProps = { + children: string, + allowFontScaling?: boolean, + tintColor?: string, + onLayout?: (e: $tsflower_subst$RN$LayoutChangeEvent) => void, + style?: $tsflower_subst$RN$Animated$WithAnimatedValue< + $tsflower_subst$RN$StyleProp<$tsflower_subst$RN$TextStyle>, + >, + ... +}; + +export type HeaderButtonProps = { + tintColor?: string, + pressColor?: string, + pressOpacity?: number, + canGoBack?: boolean, + ... +}; + +export type HeaderBackButtonProps = HeaderButtonProps & { + disabled?: boolean, + onPress?: () => void, + backImage?: (props: { tintColor: string, ... }) => $tsflower_subst$React$ReactNode, + label?: string, + truncatedLabel?: string, + labelVisible?: boolean, + labelStyle?: $tsflower_subst$RN$Animated$WithAnimatedValue< + $tsflower_subst$RN$StyleProp<$tsflower_subst$RN$TextStyle>, + >, + allowFontScaling?: boolean, + onLabelLayout?: (e: $tsflower_subst$RN$LayoutChangeEvent) => void, + screenLayout?: Layout, + titleLayout?: Layout, + accessibilityLabel?: string, + testID?: string, + style?: $tsflower_subst$RN$StyleProp<$tsflower_subst$RN$ViewStyle>, + ... +}; diff --git a/types/@react-navigation/material-top-tabs/lib/typescript/src/index.js.flow b/types/@react-navigation/material-top-tabs/lib/typescript/src/index.js.flow index ee4d9923d5d..0c4c88ea20f 100644 --- a/types/@react-navigation/material-top-tabs/lib/typescript/src/index.js.flow +++ b/types/@react-navigation/material-top-tabs/lib/typescript/src/index.js.flow @@ -2,12 +2,12 @@ * @generated by TsFlower */ export { default as createMaterialTopTabNavigator } from './navigators/createMaterialTopTabNavigator'; -export { default as MaterialTopTabView } from './views/MaterialTopTabView'; export { default as MaterialTopTabBar } from './views/MaterialTopTabBar'; +export { default as MaterialTopTabView } from './views/MaterialTopTabView'; export { + MaterialTopTabBarProps, + MaterialTopTabNavigationEventMap, MaterialTopTabNavigationOptions, MaterialTopTabNavigationProp, MaterialTopTabScreenProps, - MaterialTopTabBarProps, - MaterialTopTabBarOptions, } from './types'; diff --git a/types/@react-navigation/material-top-tabs/lib/typescript/src/navigators/createMaterialTopTabNavigator.js.flow b/types/@react-navigation/material-top-tabs/lib/typescript/src/navigators/createMaterialTopTabNavigator.js.flow index 2e5c9ffa673..f0a91a5ad6f 100644 --- a/types/@react-navigation/material-top-tabs/lib/typescript/src/navigators/createMaterialTopTabNavigator.js.flow +++ b/types/@react-navigation/material-top-tabs/lib/typescript/src/navigators/createMaterialTopTabNavigator.js.flow @@ -6,20 +6,21 @@ import type { JSX$Element as $tsflower_subst$React$JSX$Element } from 'tsflower/ import { type DefaultNavigatorOptions, - type TabRouterOptions, + type ParamListBase, type TabNavigationState, + type TabRouterOptions, } from '@react-navigation/native'; import { type MaterialTopTabNavigationConfig, - type MaterialTopTabNavigationOptions, type MaterialTopTabNavigationEventMap, + type MaterialTopTabNavigationOptions, } from '../types'; type Props = TabRouterOptions & MaterialTopTabNavigationConfig; declare function MaterialTopTabNavigator(Props): $tsflower_subst$React$JSX$Element; declare var _default: < - ParamList: { +[key: string]: { ... } | void }, + ParamList: ParamListBase, >() => $tsflower_import_type$_$_40_react_2d_navigation_2f_native$TypedNavigator< ParamList, TabNavigationState, diff --git a/types/@react-navigation/material-top-tabs/lib/typescript/src/types.js.flow b/types/@react-navigation/material-top-tabs/lib/typescript/src/types.js.flow index 0dd4c30b6b7..7abe20b5f43 100644 --- a/types/@react-navigation/material-top-tabs/lib/typescript/src/types.js.flow +++ b/types/@react-navigation/material-top-tabs/lib/typescript/src/types.js.flow @@ -1,29 +1,37 @@ /* @flow * @generated by TsFlower */ -import type { Partial } from 'tsflower/subst/lib'; +import type { + ReactNode as $tsflower_subst$React$ReactNode, + ComponentProps as $tsflower_subst$React$ComponentProps, +} from 'tsflower/subst/react'; -import type { ReactNode, ComponentProps } from 'tsflower/subst/react'; import type { StyleProp as $tsflower_subst$RN$StyleProp, ViewStyle as $tsflower_subst$RN$ViewStyle, TextStyle as $tsflower_subst$RN$TextStyle, } from 'tsflower/subst/react-native'; -import 'react-native'; -import { TabBar, type SceneRendererProps, TabView } from 'react-native-tab-view'; - import { - type ParamListBase, type Descriptor, type NavigationHelpers, - type Route, type NavigationProp, - type TabNavigationState, - type TabActionHelpers, + type ParamListBase, + type Route, type RouteProp, + type TabActionHelpers, + type TabNavigationState, } from '@react-navigation/native'; +import type React from 'react'; +// import { type PressableAndroidRippleConfig } from 'react-native'; // TODO(tsflower) +import { + type SceneRendererProps, + typeof TabBar, + type TabBarIndicatorProps, + type TabViewProps, +} from 'react-native-tab-view'; + export type MaterialTopTabNavigationEventMap = {| tabPress: {| data: void, @@ -41,10 +49,12 @@ export type MaterialTopTabNavigationHelpers = NavigationHelpers< TabActionHelpers; export type MaterialTopTabNavigationProp< ParamList: ParamListBase, - +RouteName: $Keys = string, + +RouteName: $Keys = $Keys, + NavigatorID: string | void = void, > = NavigationProp< ParamList, RouteName, + NavigatorID, TabNavigationState, MaterialTopTabNavigationOptions, MaterialTopTabNavigationEventMap, @@ -53,96 +63,91 @@ export type MaterialTopTabNavigationProp< export type MaterialTopTabScreenProps< ParamList: ParamListBase, - RouteName: $Keys = string, + RouteName: $Keys = $Keys, + NavigatorID: string | void = void, > = { - navigation: MaterialTopTabNavigationProp, + navigation: MaterialTopTabNavigationProp, route: RouteProp, ... }; -export type MaterialTopTabNavigationOptions = { +export type MaterialTopTabNavigationOptions = {| title?: string, tabBarLabel?: | string | ((props: { focused: boolean, color: string, + children: string, ... - }) => ReactNode), + }) => $tsflower_subst$React$ReactNode), + tabBarAccessibilityLabel?: string, + tabBarAllowFontScaling?: boolean, + tabBarShowLabel?: boolean, tabBarIcon?: (props: { focused: boolean, color: string, ... - }) => ReactNode, - tabBarAccessibilityLabel?: string, + }) => $tsflower_subst$React$ReactNode, + tabBarShowIcon?: boolean, + tabBarBadge?: () => $tsflower_subst$React$ReactNode, + tabBarIndicator?: ( + props: $Diff>, {| navigationState: mixed |}> & { + state: TabNavigationState, + ... + }, + ) => $tsflower_subst$React$ReactNode, + tabBarIndicatorStyle?: $tsflower_subst$RN$StyleProp<$tsflower_subst$RN$ViewStyle>, + tabBarIndicatorContainerStyle?: $tsflower_subst$RN$StyleProp<$tsflower_subst$RN$ViewStyle>, tabBarTestID?: string, - ... -}; + tabBarActiveTintColor?: string, + tabBarInactiveTintColor?: string, + tabBarPressColor?: string, + tabBarPressOpacity?: number, + tabBarBounces?: boolean, + tabBarScrollEnabled?: boolean, + tabBarIconStyle?: $tsflower_subst$RN$StyleProp<$tsflower_subst$RN$ViewStyle>, + tabBarLabelStyle?: $tsflower_subst$RN$StyleProp<$tsflower_subst$RN$TextStyle>, + tabBarItemStyle?: $tsflower_subst$RN$StyleProp<$tsflower_subst$RN$ViewStyle>, + tabBarContentContainerStyle?: $tsflower_subst$RN$StyleProp<$tsflower_subst$RN$ViewStyle>, + tabBarStyle?: $tsflower_subst$RN$StyleProp<$tsflower_subst$RN$ViewStyle>, + tabBarGap?: number, + // tabBarAndroidRipple?: PressableAndroidRippleConfig, // TODO(tsflower) + swipeEnabled?: boolean, + animationEnabled?: boolean, + lazy?: boolean, + lazyPreloadDistance?: number, + lazyPlaceholder?: () => $tsflower_subst$React$ReactNode, +|}; export type MaterialTopTabDescriptor = Descriptor< - ParamListBase, - string, - TabNavigationState, MaterialTopTabNavigationOptions, + MaterialTopTabNavigationProp, + RouteProp, >; -export type MaterialTopTabDescriptorMap = { [key: string]: MaterialTopTabDescriptor, ... }; +export type MaterialTopTabDescriptorMap = { [key: string]: MaterialTopTabDescriptor }; -export type MaterialTopTabNavigationConfig = Partial< - $Diff< - ComponentProps, - {| - navigationState: mixed, - onIndexChange: mixed, - onSwipeStart: mixed, - onSwipeEnd: mixed, - renderScene: mixed, - renderTabBar: mixed, - renderPager: mixed, - renderLazyPlaceholder: mixed, - |}, - >, -> & { - pager?: $ElementType, 'renderPager'>, - lazyPlaceholder?: (props: { route: Route, ... }) => ReactNode, - tabBar?: (props: MaterialTopTabBarProps) => ReactNode, - tabBarOptions?: MaterialTopTabBarOptions, - tabBarPosition?: 'top' | 'bottom', - ... -}; +export type MaterialTopTabNavigationConfig = $Diff< + TabViewProps>, + {| + navigationState: mixed, + onIndexChange: mixed, + onSwipeStart: mixed, + onSwipeEnd: mixed, + renderScene: mixed, + renderTabBar: mixed, + renderLazyPlaceholder: mixed, + swipeEnabled: mixed, + animationEnabled: mixed, + lazy: mixed, + lazyPreloadDistance: mixed, + lazyPlaceholder: mixed, + |}, +> & { tabBar?: (props: MaterialTopTabBarProps) => $tsflower_subst$React$ReactNode, ... }; -export type MaterialTopTabBarOptions = Partial< - $Diff< - ComponentProps, - {| - [key: - | 'navigationState' - | 'activeColor' - | 'inactiveColor' - | 'renderLabel' - | 'renderIcon' - | 'getLabelText' - | 'getAccessibilityLabel' - | 'getTestID' - | 'onTabPress' - | 'onTabLongPress' - | $Keys]: mixed, - |}, - >, -> & { - activeTintColor?: string, - inactiveTintColor?: string, - iconStyle?: $tsflower_subst$RN$StyleProp<$tsflower_subst$RN$ViewStyle>, - labelStyle?: $tsflower_subst$RN$StyleProp<$tsflower_subst$RN$TextStyle>, - showLabel?: boolean, - showIcon?: boolean, - allowFontScaling?: boolean, +export type MaterialTopTabBarProps = SceneRendererProps & { + state: TabNavigationState, + navigation: NavigationHelpers, + descriptors: MaterialTopTabDescriptorMap, ... }; - -export type MaterialTopTabBarProps = MaterialTopTabBarOptions & - SceneRendererProps & { - state: TabNavigationState, - navigation: NavigationHelpers, - descriptors: MaterialTopTabDescriptorMap, - ... - }; diff --git a/types/@react-navigation/material-top-tabs/lib/typescript/src/views/MaterialTopTabBar.js.flow b/types/@react-navigation/material-top-tabs/lib/typescript/src/views/MaterialTopTabBar.js.flow index 5c68561a6c0..42634882714 100644 --- a/types/@react-navigation/material-top-tabs/lib/typescript/src/views/MaterialTopTabBar.js.flow +++ b/types/@react-navigation/material-top-tabs/lib/typescript/src/views/MaterialTopTabBar.js.flow @@ -4,5 +4,5 @@ import type { JSX$Element as $tsflower_subst$React$JSX$Element } from 'tsflower/subst/react'; import { type MaterialTopTabBarProps } from '../types'; declare export default function TabBarTop( - props: MaterialTopTabBarProps, + MaterialTopTabBarProps, ): $tsflower_subst$React$JSX$Element; diff --git a/types/@react-navigation/material-top-tabs/lib/typescript/src/views/MaterialTopTabView.js.flow b/types/@react-navigation/material-top-tabs/lib/typescript/src/views/MaterialTopTabView.js.flow index 855fe1920e5..09239599881 100644 --- a/types/@react-navigation/material-top-tabs/lib/typescript/src/views/MaterialTopTabView.js.flow +++ b/types/@react-navigation/material-top-tabs/lib/typescript/src/views/MaterialTopTabView.js.flow @@ -2,7 +2,7 @@ * @generated by TsFlower */ import type { JSX$Element as $tsflower_subst$React$JSX$Element } from 'tsflower/subst/react'; -import { type TabNavigationState, type ParamListBase } from '@react-navigation/native'; +import { type ParamListBase, type TabNavigationState } from '@react-navigation/native'; import { type MaterialTopTabDescriptorMap, @@ -14,7 +14,6 @@ type Props = MaterialTopTabNavigationConfig & { state: TabNavigationState, navigation: MaterialTopTabNavigationHelpers, descriptors: MaterialTopTabDescriptorMap, - tabBarPosition?: 'top' | 'bottom', ... }; diff --git a/types/patches/0008-upstream-rnav-Covariant-indexers-in-create-Navigator.patch b/types/patches/0008-upstream-rnav-Covariant-indexers-in-create-Navigator.patch index 9544bdcf7a6..334f9bbcdb7 100644 --- a/types/patches/0008-upstream-rnav-Covariant-indexers-in-create-Navigator.patch +++ b/types/patches/0008-upstream-rnav-Covariant-indexers-in-create-Navigator.patch @@ -8,27 +8,9 @@ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- - .../src/navigators/createMaterialTopTabNavigator.js.flow | 4 ++-- .../typescript/src/navigators/createStackNavigator.js.flow | 4 ++-- - 2 files changed, 4 insertions(+), 4 deletions(-) + 1 file changed, 2 insertions(+), 2 deletions(-) -diff --git types/@react-navigation/material-top-tabs/lib/typescript/src/navigators/createMaterialTopTabNavigator.js.flow types/@react-navigation/material-top-tabs/lib/typescript/src/navigators/createMaterialTopTabNavigator.js.flow -index 69f6df9c8..29d53b3ff 100644 ---- types/@react-navigation/material-top-tabs/lib/typescript/src/navigators/createMaterialTopTabNavigator.js.flow -+++ types/@react-navigation/material-top-tabs/lib/typescript/src/navigators/createMaterialTopTabNavigator.js.flow -@@ -21,10 +21,10 @@ type Props = DefaultNavigatorOptions & - MaterialTopTabNavigationConfig; - declare function MaterialTopTabNavigator(Props): $tsflower_subst$React$JSX$Element; - declare var _default: < -- ParamList: { [key: string]: { ... } | void }, -+ ParamList: { +[key: string]: { ... } | void }, - >() => $tsflower_import_type$_$_40_react_2d_navigation_2f_native$TypedNavigator< - ParamList, -- TabNavigationState<{ [key: string]: { ... } | void }>, -+ TabNavigationState<{ +[key: string]: { ... } | void }>, - MaterialTopTabNavigationOptions, - MaterialTopTabNavigationEventMap, - typeof MaterialTopTabNavigator, diff --git types/@react-navigation/stack/lib/typescript/src/navigators/createStackNavigator.js.flow types/@react-navigation/stack/lib/typescript/src/navigators/createStackNavigator.js.flow index 7a17b58e6..1842836b1 100644 --- types/@react-navigation/stack/lib/typescript/src/navigators/createStackNavigator.js.flow diff --git a/types/patches/0010-upstream-rnav-create-Navigator-type-surely-means-to-.patch b/types/patches/0010-upstream-rnav-create-Navigator-type-surely-means-to-.patch index aa64ad2f19c..1b490632140 100644 --- a/types/patches/0010-upstream-rnav-create-Navigator-type-surely-means-to-.patch +++ b/types/patches/0010-upstream-rnav-create-Navigator-type-surely-means-to-.patch @@ -14,14 +14,14 @@ Rather than to the upper bound on ParamList. 2 files changed, 2 insertions(+), 2 deletions(-) diff --git types/@react-navigation/material-top-tabs/lib/typescript/src/navigators/createMaterialTopTabNavigator.js.flow types/@react-navigation/material-top-tabs/lib/typescript/src/navigators/createMaterialTopTabNavigator.js.flow -index 29d53b3ff..def19204a 100644 +index 9435790b8..bc11a7c76 100644 --- types/@react-navigation/material-top-tabs/lib/typescript/src/navigators/createMaterialTopTabNavigator.js.flow +++ types/@react-navigation/material-top-tabs/lib/typescript/src/navigators/createMaterialTopTabNavigator.js.flow -@@ -24,7 +24,7 @@ declare var _default: < - ParamList: { +[key: string]: { ... } | void }, +@@ -30,7 +30,7 @@ declare var _default: < + ParamList: ParamListBase, >() => $tsflower_import_type$_$_40_react_2d_navigation_2f_native$TypedNavigator< ParamList, -- TabNavigationState<{ +[key: string]: { ... } | void }>, +- TabNavigationState, + TabNavigationState, MaterialTopTabNavigationOptions, MaterialTopTabNavigationEventMap, diff --git a/types/patches/0011-upstream-rnav-On-create-Navigator-cut-redundant-wron.patch b/types/patches/0011-upstream-rnav-On-create-Navigator-cut-redundant-wron.patch index 770c8ad2ee3..a199c32c078 100644 --- a/types/patches/0011-upstream-rnav-On-create-Navigator-cut-redundant-wron.patch +++ b/types/patches/0011-upstream-rnav-On-create-Navigator-cut-redundant-wron.patch @@ -16,25 +16,51 @@ to TypedNavigator on the line after that.) And TypedNavigator actually passes the ParamList type when it does so, so it has a chance of being right. --- - .../src/navigators/createMaterialTopTabNavigator.js.flow | 4 +--- - .../typescript/src/navigators/createStackNavigator.js.flow | 6 +++--- - 2 files changed, 4 insertions(+), 6 deletions(-) + .../src/navigators/createBottomTabNavigator.js.flow | 9 +-------- + .../src/navigators/createMaterialTopTabNavigator.js.flow | 9 +-------- + .../src/navigators/createStackNavigator.js.flow | 6 +++--- + 3 files changed, 5 insertions(+), 19 deletions(-) +diff --git types/@react-navigation/bottom-tabs/lib/typescript/src/navigators/createBottomTabNavigator.js.flow types/@react-navigation/bottom-tabs/lib/typescript/src/navigators/createBottomTabNavigator.js.flow +index 7e16fb708..ebf13d3dc 100644 +--- types/@react-navigation/bottom-tabs/lib/typescript/src/navigators/createBottomTabNavigator.js.flow ++++ types/@react-navigation/bottom-tabs/lib/typescript/src/navigators/createBottomTabNavigator.js.flow +@@ -17,14 +17,7 @@ import { + type BottomTabNavigationOptions, + } from '../types'; + +-type Props = DefaultNavigatorOptions< +- ParamListBase, +- TabNavigationState, +- BottomTabNavigationOptions, +- BottomTabNavigationEventMap, +-> & +- TabRouterOptions & +- BottomTabNavigationConfig; ++type Props = TabRouterOptions & BottomTabNavigationConfig; + declare function BottomTabNavigator(Props): $tsflower_subst$React$JSX$Element; + declare var _default: < + ParamList: ParamListBase, diff --git types/@react-navigation/material-top-tabs/lib/typescript/src/navigators/createMaterialTopTabNavigator.js.flow types/@react-navigation/material-top-tabs/lib/typescript/src/navigators/createMaterialTopTabNavigator.js.flow -index def19204a..2e5c9ffa6 100644 +index bc11a7c76..f0a91a5ad 100644 --- types/@react-navigation/material-top-tabs/lib/typescript/src/navigators/createMaterialTopTabNavigator.js.flow +++ types/@react-navigation/material-top-tabs/lib/typescript/src/navigators/createMaterialTopTabNavigator.js.flow -@@ -16,9 +16,7 @@ import { - type MaterialTopTabNavigationEventMap, +@@ -17,14 +17,7 @@ import { + type MaterialTopTabNavigationOptions, } from '../types'; --type Props = DefaultNavigatorOptions & +-type Props = DefaultNavigatorOptions< +- ParamListBase, +- TabNavigationState, +- MaterialTopTabNavigationOptions, +- MaterialTopTabNavigationEventMap, +-> & - TabRouterOptions & - MaterialTopTabNavigationConfig; +type Props = TabRouterOptions & MaterialTopTabNavigationConfig; declare function MaterialTopTabNavigator(Props): $tsflower_subst$React$JSX$Element; declare var _default: < - ParamList: { +[key: string]: { ... } | void }, + ParamList: ParamListBase, diff --git types/@react-navigation/stack/lib/typescript/src/navigators/createStackNavigator.js.flow types/@react-navigation/stack/lib/typescript/src/navigators/createStackNavigator.js.flow index 3c2939d32..f96ddf688 100644 --- types/@react-navigation/stack/lib/typescript/src/navigators/createStackNavigator.js.flow diff --git a/types/patches/0014-irreducible-rnav-Covariant-type-parameters-on-variou.patch b/types/patches/0014-irreducible-rnav-Covariant-type-parameters-on-variou.patch index fbecea55dd2..81f175ba5bb 100644 --- a/types/patches/0014-irreducible-rnav-Covariant-type-parameters-on-variou.patch +++ b/types/patches/0014-irreducible-rnav-Covariant-type-parameters-on-variou.patch @@ -14,18 +14,18 @@ NavigationHelpersCommon, NavigationState, PartialState. 5 files changed, 12 insertions(+), 12 deletions(-) diff --git types/@react-navigation/bottom-tabs/lib/typescript/src/types.js.flow types/@react-navigation/bottom-tabs/lib/typescript/src/types.js.flow -index d3c2017d4..3bc615faa 100644 +index 8908b03c2..ff27c12ba 100644 --- types/@react-navigation/bottom-tabs/lib/typescript/src/types.js.flow +++ types/@react-navigation/bottom-tabs/lib/typescript/src/types.js.flow -@@ -50,7 +50,7 @@ export type BottomTabNavigationHelpers = NavigationHelpers< +@@ -59,7 +59,7 @@ export type BottomTabNavigationHelpers = NavigationHelpers< TabActionHelpers; export type BottomTabNavigationProp< ParamList: ParamListBase, -- RouteName: $Keys = string, -+ +RouteName: $Keys = string, +- RouteName: $Keys = $Keys, ++ +RouteName: $Keys = $Keys, + NavigatorID: string | void = void, > = NavigationProp< ParamList, - RouteName, diff --git types/@react-navigation/core/lib/typescript/src/types.js.flow types/@react-navigation/core/lib/typescript/src/types.js.flow index 41f13ea18..ccdd92d43 100644 --- types/@react-navigation/core/lib/typescript/src/types.js.flow @@ -72,18 +72,18 @@ index 41f13ea18..ccdd92d43 100644 $ElementType, >; diff --git types/@react-navigation/material-top-tabs/lib/typescript/src/types.js.flow types/@react-navigation/material-top-tabs/lib/typescript/src/types.js.flow -index cf53d769d..8d2ea317f 100644 +index 123e771e5..d0ddf2a27 100644 --- types/@react-navigation/material-top-tabs/lib/typescript/src/types.js.flow +++ types/@react-navigation/material-top-tabs/lib/typescript/src/types.js.flow -@@ -42,7 +42,7 @@ export type MaterialTopTabNavigationHelpers = NavigationHelpers< +@@ -46,7 +46,7 @@ export type MaterialTopTabNavigationHelpers = NavigationHelpers< TabActionHelpers; export type MaterialTopTabNavigationProp< ParamList: ParamListBase, -- RouteName: $Keys = string, -+ +RouteName: $Keys = string, +- RouteName: $Keys = $Keys, ++ +RouteName: $Keys = $Keys, + NavigatorID: string | void = void, > = NavigationProp< ParamList, - RouteName, diff --git types/@react-navigation/routers/lib/typescript/src/types.js.flow types/@react-navigation/routers/lib/typescript/src/types.js.flow index ea0e29c32..6a0de188b 100644 --- types/@react-navigation/routers/lib/typescript/src/types.js.flow diff --git a/types/patches/0015-irreducible-rnav-EventMap-types-exact-and-covariant.patch b/types/patches/0015-irreducible-rnav-EventMap-types-exact-and-covariant.patch index 565477e6439..e3822776c17 100644 --- a/types/patches/0015-irreducible-rnav-EventMap-types-exact-and-covariant.patch +++ b/types/patches/0015-irreducible-rnav-EventMap-types-exact-and-covariant.patch @@ -14,12 +14,12 @@ subtypes of the latter's. 4 files changed, 37 insertions(+), 47 deletions(-) diff --git types/@react-navigation/bottom-tabs/lib/typescript/src/types.js.flow types/@react-navigation/bottom-tabs/lib/typescript/src/types.js.flow -index 3bc615faa..ed9343057 100644 +index ff27c12ba..93f9f4c0d 100644 --- types/@react-navigation/bottom-tabs/lib/typescript/src/types.js.flow +++ types/@react-navigation/bottom-tabs/lib/typescript/src/types.js.flow -@@ -32,15 +32,13 @@ import { - type RouteProp, - } from '@react-navigation/native'; +@@ -41,15 +41,13 @@ export type Layout = { + ... + }; -export type BottomTabNavigationEventMap = { - tabPress: { @@ -114,12 +114,12 @@ index ccdd92d43..1421d39dd 100644 export type NavigationContainerRef = NavigationHelpers & EventConsumer & { diff --git types/@react-navigation/material-top-tabs/lib/typescript/src/types.js.flow types/@react-navigation/material-top-tabs/lib/typescript/src/types.js.flow -index 8d2ea317f..36bc57918 100644 +index d0ddf2a27..0fd14123d 100644 --- types/@react-navigation/material-top-tabs/lib/typescript/src/types.js.flow +++ types/@react-navigation/material-top-tabs/lib/typescript/src/types.js.flow -@@ -23,17 +23,15 @@ import { - type RouteProp, - } from '@react-navigation/native'; +@@ -27,17 +27,15 @@ import type React from 'react'; + import { type PressableAndroidRippleConfig } from 'react-native'; + import { type SceneRendererProps, typeof TabBar, type TabViewProps } from 'react-native-tab-view'; -export type MaterialTopTabNavigationEventMap = { - tabPress: { diff --git a/types/patches/0017-tsflower-Handle-TS-reference-pragma-for-React-in-mat.patch b/types/patches/0017-tsflower-Handle-TS-reference-pragma-for-React-in-mat.patch deleted file mode 100644 index 922e8bdd003..00000000000 --- a/types/patches/0017-tsflower-Handle-TS-reference-pragma-for-React-in-mat.patch +++ /dev/null @@ -1,89 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Greg Price -Date: Fri, 27 May 2022 13:02:49 -0700 -Subject: [tsflower] Handle TS reference pragma for React in material-top-tabs -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -This seems like not a great practice in the library, but TsFlower -should deal with it anyway. - -What's happening is that in the input file, instead of importing React -in a normal JS way, it's using a TypeScript `` comment -to bring into scope everything defined in `@types/react`, including the -`React` namespace. - -As a result, TsFlower currently isn't able to spot that the references -to a `React` namespace are referring to the 'react' module, and doesn't -rewrite references like `React.ReactNode`. ---- - .../lib/typescript/src/types.js.flow | 15 ++++++++------- - 1 file changed, 8 insertions(+), 7 deletions(-) - -diff --git types/@react-navigation/material-top-tabs/lib/typescript/src/types.js.flow types/@react-navigation/material-top-tabs/lib/typescript/src/types.js.flow -index 36bc57918..1c02714a5 100644 ---- types/@react-navigation/material-top-tabs/lib/typescript/src/types.js.flow -+++ types/@react-navigation/material-top-tabs/lib/typescript/src/types.js.flow -@@ -3,6 +3,7 @@ - */ - import type { Partial } from 'tsflower/subst/lib'; - -+import type { ReactNode, ComponentProps } from 'tsflower/subst/react'; - import type { - StyleProp as $tsflower_subst$RN$StyleProp, - ViewStyle as $tsflower_subst$RN$ViewStyle, -@@ -67,12 +68,12 @@ export type MaterialTopTabNavigationOptions = { - focused: boolean, - color: string, - ... -- }) => React.ReactNode), -+ }) => ReactNode), - tabBarIcon?: (props: { - focused: boolean, - color: string, - ... -- }) => React.ReactNode, -+ }) => ReactNode, - tabBarAccessibilityLabel?: string, - tabBarTestID?: string, - ... -@@ -88,30 +89,30 @@ export type MaterialTopTabDescriptorMap = { [key: string]: MaterialTopTabDescrip - - export type MaterialTopTabNavigationConfig = Partial< - $Diff< -- React.ComponentProps, -+ ComponentProps, - {| - navigationState: mixed, - onIndexChange: mixed, - onSwipeStart: mixed, - onSwipeEnd: mixed, - renderScene: mixed, - renderTabBar: mixed, - renderPager: mixed, - renderLazyPlaceholder: mixed, - |}, - >, - > & { -- pager?: $ElementType, 'renderPager'>, -- lazyPlaceholder?: (props: { route: Route, ... }) => React.ReactNode, -- tabBar?: (props: MaterialTopTabBarProps) => React.ReactNode, -+ pager?: $ElementType, 'renderPager'>, -+ lazyPlaceholder?: (props: { route: Route, ... }) => ReactNode, -+ tabBar?: (props: MaterialTopTabBarProps) => ReactNode, - tabBarOptions?: MaterialTopTabBarOptions, - tabBarPosition?: 'top' | 'bottom', - ... - }; - - export type MaterialTopTabBarOptions = Partial< - $Diff< -- React.ComponentProps, -+ ComponentProps, - {| - [key: - | 'navigationState' --- -2.32.0 - diff --git a/types/patches/0018-tsflower-Resolve-re-export-indirection-on-CommonActi.patch b/types/patches/0017-tsflower-Resolve-re-export-indirection-on-CommonActi.patch similarity index 100% rename from types/patches/0018-tsflower-Resolve-re-export-indirection-on-CommonActi.patch rename to types/patches/0017-tsflower-Resolve-re-export-indirection-on-CommonActi.patch diff --git a/types/patches/0020-tsflower-Better-substitution-for-React.ForwardRefExo.patch b/types/patches/0018-tsflower-Better-substitution-for-React.ForwardRefExo.patch similarity index 100% rename from types/patches/0020-tsflower-Better-substitution-for-React.ForwardRefExo.patch rename to types/patches/0018-tsflower-Better-substitution-for-React.ForwardRefExo.patch diff --git a/types/patches/0019-tsflower-Fix-import-type-of-classes.patch b/types/patches/0019-tsflower-Fix-import-type-of-classes.patch deleted file mode 100644 index be626e9059d..00000000000 --- a/types/patches/0019-tsflower-Fix-import-type-of-classes.patch +++ /dev/null @@ -1,60 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Greg Price -Date: Fri, 27 May 2022 14:21:30 -0700 -Subject: [tsflower] Fix `import type` of classes - -This stems from the subtle difference in semantics between -`import type` in TS and `import type` in Flow. It should be -fixed in TsFlower. - -What's happening is that the source file here says: - - import type { TabBar, SceneRendererProps, TabView } from 'react-native-tab-view'; - -In TS, that means the import is "type-only" -- it's seen only by the -type-checker, and elided in the runtime code. - -But in Flow, that `type` modifier would mean it's an import *of* a type. - -The difference comes when these names TabBar and TabView refer to -values -- which they do, specifically they're classes -- and then the -code goes on to say something like `typeof TabBar` in a type -annotation. That's something that only the type-checker sees, so it's -fine with a TS `import type`; but it's referring to a value named -TabBar, not a type by that name, so it doesn't work with a Flow -`import type`. - -Currently, TsFlower sees the `type` modifier, and goes and emits a -`type` modifier. - -Instead, if the name we're importing has a value binding, we should -emit a plain old value import, regardless of the source's `type` -modifier. - -(That works because we're acting on type definitions anyway, and TS -`import type` is completely redundant in a type definition file. If -we were operating on runtime code, we'd have to be more careful -because a runtime import can have side effects. We could emit an -`import typeof`, and then rewrite `typeof` references to drop their -own `typeof`. In fact that's what we already do if the name has a -value binding and doesn't also have a type binding.) ---- - .../material-top-tabs/lib/typescript/src/types.js.flow | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git types/@react-navigation/material-top-tabs/lib/typescript/src/types.js.flow types/@react-navigation/material-top-tabs/lib/typescript/src/types.js.flow -index 1c02714a5..0dd4c30b6 100644 ---- types/@react-navigation/material-top-tabs/lib/typescript/src/types.js.flow -+++ types/@react-navigation/material-top-tabs/lib/typescript/src/types.js.flow -@@ -11,7 +11,7 @@ import type { - } from 'tsflower/subst/react-native'; - - import 'react-native'; --import { type TabBar, type SceneRendererProps, type TabView } from 'react-native-tab-view'; -+import { TabBar, type SceneRendererProps, TabView } from 'react-native-tab-view'; - - import { - type ParamListBase, --- -2.32.0 - diff --git a/types/patches/0021-tsflower-Manually-rewrite-Pick-from-TS-default-libra.patch b/types/patches/0019-tsflower-Manually-rewrite-Pick-from-TS-default-libra.patch similarity index 100% rename from types/patches/0021-tsflower-Manually-rewrite-Pick-from-TS-default-libra.patch rename to types/patches/0019-tsflower-Manually-rewrite-Pick-from-TS-default-libra.patch diff --git a/types/patches/0022-tsflower-Substitute-for-React.ReactText.patch b/types/patches/0020-tsflower-Substitute-for-React.ReactText.patch similarity index 100% rename from types/patches/0022-tsflower-Substitute-for-React.ReactText.patch rename to types/patches/0020-tsflower-Substitute-for-React.ReactText.patch diff --git a/types/patches/0023-adhoc-rnav-Manually-approximate-conditional-in-Route.patch b/types/patches/0021-adhoc-rnav-Manually-approximate-conditional-in-Route.patch similarity index 100% rename from types/patches/0023-adhoc-rnav-Manually-approximate-conditional-in-Route.patch rename to types/patches/0021-adhoc-rnav-Manually-approximate-conditional-in-Route.patch diff --git a/types/patches/0024-adhoc-rnav-Manually-approximate-conditionals-in-Even.patch b/types/patches/0022-adhoc-rnav-Manually-approximate-conditionals-in-Even.patch similarity index 100% rename from types/patches/0024-adhoc-rnav-Manually-approximate-conditionals-in-Even.patch rename to types/patches/0022-adhoc-rnav-Manually-approximate-conditionals-in-Even.patch diff --git a/types/patches/0025-rnav-Fix-odd-initialRouteName-index-signature-error.patch b/types/patches/0023-rnav-Fix-odd-initialRouteName-index-signature-error.patch similarity index 100% rename from types/patches/0025-rnav-Fix-odd-initialRouteName-index-signature-error.patch rename to types/patches/0023-rnav-Fix-odd-initialRouteName-index-signature-error.patch diff --git a/types/patches/0026-adhoc-rnav-Manually-implement-conditionals-in-functi.patch b/types/patches/0024-adhoc-rnav-Manually-implement-conditionals-in-functi.patch similarity index 100% rename from types/patches/0026-adhoc-rnav-Manually-implement-conditionals-in-functi.patch rename to types/patches/0024-adhoc-rnav-Manually-implement-conditionals-in-functi.patch diff --git a/types/patches/0027-tsflower-Replace-interface-extends-with-spread-for-n.patch b/types/patches/0025-tsflower-Replace-interface-extends-with-spread-for-n.patch similarity index 71% rename from types/patches/0027-tsflower-Replace-interface-extends-with-spread-for-n.patch rename to types/patches/0025-tsflower-Replace-interface-extends-with-spread-for-n.patch index 2be834b7509..dccb827d8c3 100644 --- a/types/patches/0027-tsflower-Replace-interface-extends-with-spread-for-n.patch +++ b/types/patches/0025-tsflower-Replace-interface-extends-with-spread-for-n.patch @@ -25,12 +25,54 @@ interface declaration to an object type, with `extends` turned into a spread, when the base is an object type -- as it is in these examples. --- - .../lib/typescript/src/SafeArea.types.js.flow | 24 +++++++++++-------- - .../typescript/src/SafeAreaContext.js.flow | 12 ++++++---- - .../src/specs/NativeSafeAreaProvider.js.flow | 8 ++++--- - .../src/specs/NativeSafeAreaView.js.flow | 10 ++++---- - 4 files changed, 32 insertions(+), 22 deletions(-) + .../PagerViewNativeComponent.js.flow | 30 ++++++++++--------- + .../lib/typescript/src/SafeArea.types.js.flow | 24 ++++++++------- + .../typescript/src/SafeAreaContext.js.flow | 12 ++++---- + .../src/specs/NativeSafeAreaProvider.js.flow | 8 +++-- + .../src/specs/NativeSafeAreaView.js.flow | 10 ++++--- + 5 files changed, 48 insertions(+), 36 deletions(-) +diff --git types/react-native-pager-view/lib/typescript/PagerViewNativeComponent.js.flow types/react-native-pager-view/lib/typescript/PagerViewNativeComponent.js.flow +index 06874a9bd..30a7c61e1 100644 +--- types/react-native-pager-view/lib/typescript/PagerViewNativeComponent.js.flow ++++ types/react-native-pager-view/lib/typescript/PagerViewNativeComponent.js.flow +@@ -24,20 +24,22 @@ export type OnPageScrollStateChangedEventData = Readonly<{ + ... + }>; + +-export interface NativeProps extends $tsflower_subst$RN$ViewProps { +- scrollEnabled?: WithDefault; +- layoutDirection?: WithDefault<'ltr' | 'rtl', 'ltr'>; +- initialPage?: Int32; +- orientation?: WithDefault<'horizontal' | 'vertical', 'horizontal'>; +- offscreenPageLimit?: Int32; +- pageMargin?: Int32; +- overScrollMode?: WithDefault<'auto' | 'always' | 'never', 'auto'>; +- overdrag?: WithDefault; +- keyboardDismissMode?: WithDefault<'none' | 'on-drag', 'none'>; +- onPageScroll?: DirectEventHandler; +- onPageSelected?: DirectEventHandler; +- onPageScrollStateChanged?: DirectEventHandler; +-} ++export type NativeProps = { ++ ...$tsflower_subst$RN$ViewProps, ++ scrollEnabled?: WithDefault, ++ layoutDirection?: WithDefault<'ltr' | 'rtl', 'ltr'>, ++ initialPage?: Int32, ++ orientation?: WithDefault<'horizontal' | 'vertical', 'horizontal'>, ++ offscreenPageLimit?: Int32, ++ pageMargin?: Int32, ++ overScrollMode?: WithDefault<'auto' | 'always' | 'never', 'auto'>, ++ overdrag?: WithDefault, ++ keyboardDismissMode?: WithDefault<'none' | 'on-drag', 'none'>, ++ onPageScroll?: DirectEventHandler, ++ onPageSelected?: DirectEventHandler, ++ onPageScrollStateChanged?: DirectEventHandler, ++ ... ++}; + + type PagerViewViewType = HostComponent; + diff --git types/react-native-safe-area-context/lib/typescript/src/SafeArea.types.js.flow types/react-native-safe-area-context/lib/typescript/src/SafeArea.types.js.flow index 3a71dca37..81a9fb120 100644 --- types/react-native-safe-area-context/lib/typescript/src/SafeArea.types.js.flow diff --git a/types/patches/0028-tsflower-Fix-import-typeof-to-import-type-for-Flow-o.patch b/types/patches/0026-tsflower-Fix-import-typeof-to-import-type-for-Flow-o.patch similarity index 100% rename from types/patches/0028-tsflower-Fix-import-typeof-to-import-type-for-Flow-o.patch rename to types/patches/0026-tsflower-Fix-import-typeof-to-import-type-for-Flow-o.patch diff --git a/types/patches/0029-upstream-rnav-Can-initialParams-really-be-partial.patch b/types/patches/0027-upstream-rnav-Can-initialParams-really-be-partial.patch similarity index 100% rename from types/patches/0029-upstream-rnav-Can-initialParams-really-be-partial.patch rename to types/patches/0027-upstream-rnav-Can-initialParams-really-be-partial.patch diff --git a/types/patches/0030-tsflower-Import-TurboModule-type-using-path-that-wor.patch b/types/patches/0028-tsflower-Import-TurboModule-type-using-path-that-wor.patch similarity index 100% rename from types/patches/0030-tsflower-Import-TurboModule-type-using-path-that-wor.patch rename to types/patches/0028-tsflower-Import-TurboModule-type-using-path-that-wor.patch diff --git a/types/patches/0031-tsflower-Fix-a-typeof-to-type-in-TurboModule-imports.patch b/types/patches/0029-tsflower-Fix-a-typeof-to-type-in-TurboModule-imports.patch similarity index 100% rename from types/patches/0031-tsflower-Fix-a-typeof-to-type-in-TurboModule-imports.patch rename to types/patches/0029-tsflower-Fix-a-typeof-to-type-in-TurboModule-imports.patch diff --git a/types/patches/0032-tsflower-expo-modules-core-Fix-export-.-of-types.patch b/types/patches/0030-tsflower-expo-modules-core-Fix-export-.-of-types.patch similarity index 100% rename from types/patches/0032-tsflower-expo-modules-core-Fix-export-.-of-types.patch rename to types/patches/0030-tsflower-expo-modules-core-Fix-export-.-of-types.patch diff --git a/types/patches/0033-upstream-expo-modules-core-Comment-suppress-DeviceEv.patch b/types/patches/0031-upstream-expo-modules-core-Comment-suppress-DeviceEv.patch similarity index 100% rename from types/patches/0033-upstream-expo-modules-core-Comment-suppress-DeviceEv.patch rename to types/patches/0031-upstream-expo-modules-core-Comment-suppress-DeviceEv.patch diff --git a/types/patches/0034-tsflower-expo-modules-core-Copy-PlatformOSType-from-.patch b/types/patches/0032-tsflower-expo-modules-core-Copy-PlatformOSType-from-.patch similarity index 100% rename from types/patches/0034-tsflower-expo-modules-core-Copy-PlatformOSType-from-.patch rename to types/patches/0032-tsflower-expo-modules-core-Copy-PlatformOSType-from-.patch diff --git a/types/patches/0035-tsflower-expo-modules-core-Fix-React-import-to-use-R.patch b/types/patches/0033-tsflower-expo-modules-core-Fix-React-import-to-use-R.patch similarity index 100% rename from types/patches/0035-tsflower-expo-modules-core-Fix-React-import-to-use-R.patch rename to types/patches/0033-tsflower-expo-modules-core-Fix-React-import-to-use-R.patch diff --git a/types/patches/0036-tsflower-expo-application-Translate-a-TS-enum.patch b/types/patches/0034-tsflower-expo-application-Translate-a-TS-enum.patch similarity index 100% rename from types/patches/0036-tsflower-expo-application-Translate-a-TS-enum.patch rename to types/patches/0034-tsflower-expo-application-Translate-a-TS-enum.patch diff --git a/types/patches/0037-tsflower-expo-screen-orientation-Translate-TS-enums.patch b/types/patches/0035-tsflower-expo-screen-orientation-Translate-TS-enums.patch similarity index 100% rename from types/patches/0037-tsflower-expo-screen-orientation-Translate-TS-enums.patch rename to types/patches/0035-tsflower-expo-screen-orientation-Translate-TS-enums.patch diff --git a/types/patches/0038-tsflower-expo-screen-orientation-Fix-export-.-of-typ.patch b/types/patches/0036-tsflower-expo-screen-orientation-Fix-export-.-of-typ.patch similarity index 100% rename from types/patches/0038-tsflower-expo-screen-orientation-Fix-export-.-of-typ.patch rename to types/patches/0036-tsflower-expo-screen-orientation-Fix-export-.-of-typ.patch diff --git a/types/patches/0039-shortcut-expo-screen-orientation-Clear-out-unused-wi.patch b/types/patches/0037-shortcut-expo-screen-orientation-Clear-out-unused-wi.patch similarity index 100% rename from types/patches/0039-shortcut-expo-screen-orientation-Clear-out-unused-wi.patch rename to types/patches/0037-shortcut-expo-screen-orientation-Clear-out-unused-wi.patch diff --git a/types/patches/0040-tsflower-expo-web-browser-Translate-TS-enum-WebBrows.patch b/types/patches/0038-tsflower-expo-web-browser-Translate-TS-enum-WebBrows.patch similarity index 100% rename from types/patches/0040-tsflower-expo-web-browser-Translate-TS-enum-WebBrows.patch rename to types/patches/0038-tsflower-expo-web-browser-Translate-TS-enum-WebBrows.patch diff --git a/types/patches/0041-tsflower-expo-web-browser-Translate-TS-enum-WebBrows.patch b/types/patches/0039-tsflower-expo-web-browser-Translate-TS-enum-WebBrows.patch similarity index 100% rename from types/patches/0041-tsflower-expo-web-browser-Translate-TS-enum-WebBrows.patch rename to types/patches/0039-tsflower-expo-web-browser-Translate-TS-enum-WebBrows.patch diff --git a/types/patches/0042-tsflower-expo-web-browser-Fix-export-.-of-types.patch b/types/patches/0040-tsflower-expo-web-browser-Fix-export-.-of-types.patch similarity index 100% rename from types/patches/0042-tsflower-expo-web-browser-Fix-export-.-of-types.patch rename to types/patches/0040-tsflower-expo-web-browser-Fix-export-.-of-types.patch diff --git a/types/patches/0043-tsflower-camera-roll-Mark-statics-as-static.patch b/types/patches/0041-tsflower-camera-roll-Mark-statics-as-static.patch similarity index 100% rename from types/patches/0043-tsflower-camera-roll-Mark-statics-as-static.patch rename to types/patches/0041-tsflower-camera-roll-Mark-statics-as-static.patch diff --git a/types/patches/0044-r-n-safe-area-c-Substitute-for-InstanceType.patch b/types/patches/0042-r-n-safe-area-c-Substitute-for-InstanceType.patch similarity index 100% rename from types/patches/0044-r-n-safe-area-c-Substitute-for-InstanceType.patch rename to types/patches/0042-r-n-safe-area-c-Substitute-for-InstanceType.patch diff --git a/types/patches/0045-tsflower-r-n-open-notification-Translate-a-ModuleDec.patch b/types/patches/0043-tsflower-r-n-open-notification-Translate-a-ModuleDec.patch similarity index 100% rename from types/patches/0045-tsflower-r-n-open-notification-Translate-a-ModuleDec.patch rename to types/patches/0043-tsflower-r-n-open-notification-Translate-a-ModuleDec.patch diff --git a/types/patches/0046-tsflower-Fill-in-simple-types-from-types-react-nativ.patch b/types/patches/0044-tsflower-Fill-in-simple-types-from-types-react-nativ.patch similarity index 100% rename from types/patches/0046-tsflower-Fill-in-simple-types-from-types-react-nativ.patch rename to types/patches/0044-tsflower-Fill-in-simple-types-from-types-react-nativ.patch diff --git a/types/patches/0047-tsflower-expo-mail-composer-Translate-TS-enum-MailCo.patch b/types/patches/0045-tsflower-expo-mail-composer-Translate-TS-enum-MailCo.patch similarity index 100% rename from types/patches/0047-tsflower-expo-mail-composer-Translate-TS-enum-MailCo.patch rename to types/patches/0045-tsflower-expo-mail-composer-Translate-TS-enum-MailCo.patch diff --git a/types/patches/0048-tsflower-rnsac-Find-NativeMethods-and-import-properl.patch b/types/patches/0046-tsflower-rnsac-Find-NativeMethods-and-import-properl.patch similarity index 100% rename from types/patches/0048-tsflower-rnsac-Find-NativeMethods-and-import-properl.patch rename to types/patches/0046-tsflower-rnsac-Find-NativeMethods-and-import-properl.patch diff --git a/types/patches/0049-tsflower-rnsac-Translate-an-import-type.patch b/types/patches/0047-tsflower-rnsac-Translate-an-import-type.patch similarity index 100% rename from types/patches/0049-tsflower-rnsac-Translate-an-import-type.patch rename to types/patches/0047-tsflower-rnsac-Translate-an-import-type.patch diff --git a/types/patches/0048-tsflower-Fix-import-typeof-to-import-type-for-more-F.patch b/types/patches/0048-tsflower-Fix-import-typeof-to-import-type-for-more-F.patch new file mode 100644 index 00000000000..5fb8196bcdf --- /dev/null +++ b/types/patches/0048-tsflower-Fix-import-typeof-to-import-type-for-more-F.patch @@ -0,0 +1,47 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Chris Bobbe +Date: Fri, 26 Jan 2024 11:43:38 -0800 +Subject: [tsflower] Fix `import typeof` to `import type` for more Flow-only + types + +See a previous patch that did the same thing in some other places. +--- + .../clipboard/dist/NativeClipboardModule.js.flow | 2 +- + .../lib/typescript/PagerViewNativeComponent.js.flow | 8 ++++---- + 2 files changed, 5 insertions(+), 5 deletions(-) + +diff --git types/@react-native-clipboard/clipboard/dist/NativeClipboardModule.js.flow types/@react-native-clipboard/clipboard/dist/NativeClipboardModule.js.flow +index 58fa7b277..ae2537986 100644 +--- types/@react-native-clipboard/clipboard/dist/NativeClipboardModule.js.flow ++++ types/@react-native-clipboard/clipboard/dist/NativeClipboardModule.js.flow +@@ -3,7 +3,7 @@ + */ + import type { EmitterSubscription as $tsflower_subst$RN$EmitterSubscription } from 'tsflower/subst/react-native'; + import { type TurboModule } from 'react-native/Libraries/TurboModule/RCTExport'; +-import { typeof Int32 } from 'react-native/Libraries/Types/CodegenTypes'; ++import { type Int32 } from 'react-native/Libraries/Types/CodegenTypes'; + + export interface Spec extends TurboModule { + getString(): Promise; +diff --git types/react-native-pager-view/lib/typescript/PagerViewNativeComponent.js.flow types/react-native-pager-view/lib/typescript/PagerViewNativeComponent.js.flow +index 30a7c61e1..9a0746824 100644 +--- types/react-native-pager-view/lib/typescript/PagerViewNativeComponent.js.flow ++++ types/react-native-pager-view/lib/typescript/PagerViewNativeComponent.js.flow +@@ -6,10 +6,10 @@ import type { ViewProps as $tsflower_subst$RN$ViewProps } from 'tsflower/subst/r + import * as React from 'react'; + import { type HostComponent } from 'react-native'; + import { +- typeof DirectEventHandler, +- typeof Double, +- typeof Int32, +- typeof WithDefault, ++ type DirectEventHandler, ++ type Double, ++ type Int32, ++ type WithDefault, + } from 'react-native/Libraries/Types/CodegenTypes'; + + export type OnPageScrollEventData = Readonly<{ +-- +2.32.0 + diff --git a/types/patches/0049-tsflower-r-n-pager-view-Fix-React-import-to-use-Reac.patch b/types/patches/0049-tsflower-r-n-pager-view-Fix-React-import-to-use-Reac.patch new file mode 100644 index 00000000000..77d106ccecf --- /dev/null +++ b/types/patches/0049-tsflower-r-n-pager-view-Fix-React-import-to-use-Reac.patch @@ -0,0 +1,25 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Chris Bobbe +Date: Thu, 11 Apr 2024 13:30:40 -0700 +Subject: [tsflower] r-n-pager-view: Fix React import, to use React.Element + +--- + types/react-native-pager-view/lib/typescript/PagerView.js.flow | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git types/react-native-pager-view/lib/typescript/PagerView.js.flow types/react-native-pager-view/lib/typescript/PagerView.js.flow +index bbc005685..4117ab86b 100644 +--- types/react-native-pager-view/lib/typescript/PagerView.js.flow ++++ types/react-native-pager-view/lib/typescript/PagerView.js.flow +@@ -2,7 +2,7 @@ + * @generated by TsFlower + */ + import type { JSX$Element as $tsflower_subst$React$JSX$Element } from 'tsflower/subst/react'; +-import React from 'react'; ++import * as React from 'react'; + import { type NativeProps as PagerViewProps } from './PagerViewNativeComponent'; + import PagerViewView from './PagerViewNativeComponent'; + +-- +2.32.0 + diff --git a/types/patches/0050-tsflower-Fix-a-typeof-to-type-in-Int32-import.patch b/types/patches/0050-tsflower-Fix-a-typeof-to-type-in-Int32-import.patch deleted file mode 100644 index 4776679906a..00000000000 --- a/types/patches/0050-tsflower-Fix-a-typeof-to-type-in-Int32-import.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Chris Bobbe -Date: Fri, 26 Jan 2024 11:43:38 -0800 -Subject: [tsflower] Fix a `typeof` to `type` in Int32 import - ---- - .../clipboard/dist/NativeClipboardModule.js.flow | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git types/@react-native-clipboard/clipboard/dist/NativeClipboardModule.js.flow types/@react-native-clipboard/clipboard/dist/NativeClipboardModule.js.flow -index 58fa7b277..ae2537986 100644 ---- types/@react-native-clipboard/clipboard/dist/NativeClipboardModule.js.flow -+++ types/@react-native-clipboard/clipboard/dist/NativeClipboardModule.js.flow -@@ -3,7 +3,7 @@ - */ - import type { EmitterSubscription as $tsflower_subst$RN$EmitterSubscription } from 'tsflower/subst/react-native'; - import { type TurboModule } from 'react-native/Libraries/TurboModule/RCTExport'; --import { typeof Int32 } from 'react-native/Libraries/Types/CodegenTypes'; -+import { type Int32 } from 'react-native/Libraries/Types/CodegenTypes'; - - export interface Spec extends TurboModule { - getString(): Promise; --- -2.32.0 - diff --git a/types/patches/0050-upstream-r-n-pager-view-FlowIgnore-an-unsafe-getters.patch b/types/patches/0050-upstream-r-n-pager-view-FlowIgnore-an-unsafe-getters.patch new file mode 100644 index 00000000000..74b07f5d854 --- /dev/null +++ b/types/patches/0050-upstream-r-n-pager-view-FlowIgnore-an-unsafe-getters.patch @@ -0,0 +1,24 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Chris Bobbe +Date: Thu, 11 Apr 2024 13:31:30 -0700 +Subject: [upstream] r-n-pager-view: $FlowIgnore an unsafe-getters-setters + +--- + types/react-native-pager-view/lib/typescript/PagerView.js.flow | 1 + + 1 file changed, 1 insertion(+) + +diff --git types/react-native-pager-view/lib/typescript/PagerView.js.flow types/react-native-pager-view/lib/typescript/PagerView.js.flow +index 4117ab86b..f69ca58c6 100644 +--- types/react-native-pager-view/lib/typescript/PagerView.js.flow ++++ types/react-native-pager-view/lib/typescript/PagerView.js.flow +@@ -16,6 +16,7 @@ declare export class PagerView extends React.Component { + setPageWithoutAnimation: (selectedPage: number) => void; + setScrollEnabled: (scrollEnabled: boolean) => void; + _onMoveShouldSetResponderCapture: any; ++ // $FlowIgnore[unsafe-getters-setters] + get deducedLayoutDirection(): any; + render(): $tsflower_subst$React$JSX$Element; + } +-- +2.32.0 + diff --git a/types/patches/0051-upstream-r-n-tab-view-Stop-passing-type-arg-to-Anima.patch b/types/patches/0051-upstream-r-n-tab-view-Stop-passing-type-arg-to-Anima.patch new file mode 100644 index 00000000000..a95748f8005 --- /dev/null +++ b/types/patches/0051-upstream-r-n-tab-view-Stop-passing-type-arg-to-Anima.patch @@ -0,0 +1,77 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Chris Bobbe +Date: Thu, 11 Apr 2024 13:41:30 -0700 +Subject: [upstream?] r-n-tab-view: Stop passing type arg to + AnimatedInterpolation + +This library's TypeScript must have been written against a +recent(ish) version of react-native's TypeScript types, in which +AnimatedInterpolation has a type param. That part seems to have +first appeared in the react-native types published as +@types/react-native 0.70.x: + https://github.com/DefinitelyTyped/DefinitelyTyped/blob/04ad8e431/types/react-native/v0.70/index.d.ts + +(Since then, react-native's TypeScript types have moved into the +project itself, and @types/react-native is no longer published.) +--- + .../lib/typescript/src/PagerViewAdapter.js.flow | 2 +- + .../lib/typescript/src/PanResponderAdapter.js.flow | 2 +- + .../react-native-tab-view/lib/typescript/src/TabBarItem.js.flow | 2 +- + types/react-native-tab-view/lib/typescript/src/types.js.flow | 2 +- + 4 files changed, 4 insertions(+), 4 deletions(-) + +diff --git types/react-native-tab-view/lib/typescript/src/PagerViewAdapter.js.flow types/react-native-tab-view/lib/typescript/src/PagerViewAdapter.js.flow +index d5342a5c2..6ebea3b6f 100644 +--- types/react-native-tab-view/lib/typescript/src/PagerViewAdapter.js.flow ++++ types/react-native-tab-view/lib/typescript/src/PagerViewAdapter.js.flow +@@ -17,7 +17,7 @@ type Props = PagerProps & { + navigationState: NavigationState, + children: ( + props: EventEmitterProps & { +- position: $tsflower_subst$RN$Animated$AnimatedInterpolation, ++ position: $tsflower_subst$RN$Animated$AnimatedInterpolation, + render: (children: $tsflower_subst$React$ReactNode) => $tsflower_subst$React$ReactNode, + jumpTo: (key: string) => void, + ... +diff --git types/react-native-tab-view/lib/typescript/src/PanResponderAdapter.js.flow types/react-native-tab-view/lib/typescript/src/PanResponderAdapter.js.flow +index dae46e123..7511489b8 100644 +--- types/react-native-tab-view/lib/typescript/src/PanResponderAdapter.js.flow ++++ types/react-native-tab-view/lib/typescript/src/PanResponderAdapter.js.flow +@@ -25,7 +25,7 @@ type Props = PagerProps & { + navigationState: NavigationState, + children: ( + props: EventEmitterProps & { +- position: $tsflower_subst$RN$Animated$AnimatedInterpolation, ++ position: $tsflower_subst$RN$Animated$AnimatedInterpolation, + render: (children: $tsflower_subst$React$ReactNode) => $tsflower_subst$React$ReactNode, + jumpTo: (key: string) => void, + ... +diff --git types/react-native-tab-view/lib/typescript/src/TabBarItem.js.flow types/react-native-tab-view/lib/typescript/src/TabBarItem.js.flow +index 0f395465b..cabdad0a3 100644 +--- types/react-native-tab-view/lib/typescript/src/TabBarItem.js.flow ++++ types/react-native-tab-view/lib/typescript/src/TabBarItem.js.flow +@@ -19,7 +19,7 @@ import { Animated, type PressableAndroidRippleConfig } from 'react-native'; + import { type NavigationState, type Route, type Scene } from './types'; + + export type Props = { +- position: $tsflower_subst$RN$Animated$AnimatedInterpolation, ++ position: $tsflower_subst$RN$Animated$AnimatedInterpolation, + route: T, + navigationState: NavigationState, + activeColor?: string, +diff --git types/react-native-tab-view/lib/typescript/src/types.js.flow types/react-native-tab-view/lib/typescript/src/types.js.flow +index 8f4235954..4d87d3baa 100644 +--- types/react-native-tab-view/lib/typescript/src/types.js.flow ++++ types/react-native-tab-view/lib/typescript/src/types.js.flow +@@ -39,7 +39,7 @@ export type Listener = (value: number) => void; + + export type SceneRendererProps = { + layout: Layout, +- position: $tsflower_subst$RN$Animated$AnimatedInterpolation, ++ position: $tsflower_subst$RN$Animated$AnimatedInterpolation, + jumpTo: (key: string) => void, + ... + }; +-- +2.32.0 + diff --git a/types/patches/0052-tsflower-react-native-Comment-out-uses-of-PressableA.patch b/types/patches/0052-tsflower-react-native-Comment-out-uses-of-PressableA.patch new file mode 100644 index 00000000000..7c1a309e330 --- /dev/null +++ b/types/patches/0052-tsflower-react-native-Comment-out-uses-of-PressableA.patch @@ -0,0 +1,87 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Chris Bobbe +Date: Thu, 11 Apr 2024 13:49:20 -0700 +Subject: [tsflower] react-native: Comment out uses of + PressableAndroidRippleConfig + +This doesn't seem hard to add to tsflower/subst/react-native, but +it's not likely we'll get much use out of it, and zulip-mobile is +now a legacy codebase anyway. +--- + .../material-top-tabs/lib/typescript/src/types.js.flow | 4 ++-- + .../lib/typescript/src/TabBar.js.flow | 4 ++-- + .../lib/typescript/src/TabBarItem.js.flow | 7 +++++-- + 3 files changed, 9 insertions(+), 6 deletions(-) + +diff --git types/@react-navigation/material-top-tabs/lib/typescript/src/types.js.flow types/@react-navigation/material-top-tabs/lib/typescript/src/types.js.flow +index 0fd14123d..4406ff24d 100644 +--- types/@react-navigation/material-top-tabs/lib/typescript/src/types.js.flow ++++ types/@react-navigation/material-top-tabs/lib/typescript/src/types.js.flow +@@ -24,7 +24,7 @@ import { + } from '@react-navigation/native'; + + import type React from 'react'; +-import { type PressableAndroidRippleConfig } from 'react-native'; ++// import { type PressableAndroidRippleConfig } from 'react-native'; // TODO(tsflower) + import { type SceneRendererProps, typeof TabBar, type TabViewProps } from 'react-native-tab-view'; + + export type MaterialTopTabNavigationEventMap = {| +@@ -114,7 +114,7 @@ export type MaterialTopTabNavigationOptions = { + tabBarContentContainerStyle?: $tsflower_subst$RN$StyleProp<$tsflower_subst$RN$ViewStyle>, + tabBarStyle?: $tsflower_subst$RN$StyleProp<$tsflower_subst$RN$ViewStyle>, + tabBarGap?: number, +- tabBarAndroidRipple?: PressableAndroidRippleConfig, ++ // tabBarAndroidRipple?: PressableAndroidRippleConfig, // TODO(tsflower) + swipeEnabled?: boolean, + animationEnabled?: boolean, + lazy?: boolean, +diff --git types/react-native-tab-view/lib/typescript/src/TabBar.js.flow types/react-native-tab-view/lib/typescript/src/TabBar.js.flow +index 30324e87c..77aa8ccdc 100644 +--- types/react-native-tab-view/lib/typescript/src/TabBar.js.flow ++++ types/react-native-tab-view/lib/typescript/src/TabBar.js.flow +@@ -13,7 +13,7 @@ import type { + } from 'tsflower/subst/react-native'; + + import * as React from 'react'; +-import { type PressableAndroidRippleConfig } from 'react-native'; ++// import { type PressableAndroidRippleConfig } from 'react-native'; // TODO(tsflower) + import { type Props as IndicatorProps } from './TabBarIndicator'; + import { type Props as TabBarItemProps } from './TabBarItem'; + +@@ -66,7 +66,7 @@ export type Props = SceneRendererProps & { + style?: $tsflower_subst$RN$StyleProp<$tsflower_subst$RN$ViewStyle>, + gap?: number, + testID?: string, +- android_ripple?: PressableAndroidRippleConfig, ++ // android_ripple?: PressableAndroidRippleConfig, // TODO(tsflower) + ... + }; + +diff --git types/react-native-tab-view/lib/typescript/src/TabBarItem.js.flow types/react-native-tab-view/lib/typescript/src/TabBarItem.js.flow +index cabdad0a3..34251807a 100644 +--- types/react-native-tab-view/lib/typescript/src/TabBarItem.js.flow ++++ types/react-native-tab-view/lib/typescript/src/TabBarItem.js.flow +@@ -15,7 +15,10 @@ import type { + } from 'tsflower/subst/react'; + + import * as React from 'react'; +-import { Animated, type PressableAndroidRippleConfig } from 'react-native'; ++import { ++ Animated, ++ // type PressableAndroidRippleConfig, // TODO(tsflower) ++} from 'react-native'; + import { type NavigationState, type Route, type Scene } from './types'; + + export type Props = { +@@ -49,7 +52,7 @@ export type Props = { + defaultTabWidth?: number, + labelStyle?: $tsflower_subst$RN$StyleProp<$tsflower_subst$RN$TextStyle>, + style: $tsflower_subst$RN$StyleProp<$tsflower_subst$RN$ViewStyle>, +- android_ripple?: PressableAndroidRippleConfig, ++ // android_ripple?: PressableAndroidRippleConfig, // TODO(tsflower) + ... + }; + +-- +2.32.0 + diff --git a/types/patches/0053-tsflower-react-navigation-Refer-to-a-type-more-direc.patch b/types/patches/0053-tsflower-react-navigation-Refer-to-a-type-more-direc.patch new file mode 100644 index 00000000000..5a258f87f45 --- /dev/null +++ b/types/patches/0053-tsflower-react-navigation-Refer-to-a-type-more-direc.patch @@ -0,0 +1,54 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Chris Bobbe +Date: Thu, 11 Apr 2024 14:09:05 -0700 +Subject: [tsflower?] react-navigation: Refer to a type more directly + +TypeScript's `Parameters` type seems particularly hard to translate +to Flow and it may be impossible. +--- + .../lib/typescript/src/types.js.flow | 22 +++++++++---------- + 1 file changed, 10 insertions(+), 12 deletions(-) + +diff --git types/@react-navigation/material-top-tabs/lib/typescript/src/types.js.flow types/@react-navigation/material-top-tabs/lib/typescript/src/types.js.flow +index 4406ff24d..6e3b1b9e4 100644 +--- types/@react-navigation/material-top-tabs/lib/typescript/src/types.js.flow ++++ types/@react-navigation/material-top-tabs/lib/typescript/src/types.js.flow +@@ -25,7 +25,12 @@ import { + + import type React from 'react'; + // import { type PressableAndroidRippleConfig } from 'react-native'; // TODO(tsflower) +-import { type SceneRendererProps, typeof TabBar, type TabViewProps } from 'react-native-tab-view'; ++import { ++ type SceneRendererProps, ++ typeof TabBar, ++ type TabBarIndicatorProps, ++ type TabViewProps, ++} from 'react-native-tab-view'; + + export type MaterialTopTabNavigationEventMap = {| + tabPress: {| +@@ -87,17 +92,10 @@ export type MaterialTopTabNavigationOptions = { + tabBarShowIcon?: boolean, + tabBarBadge?: () => $tsflower_subst$React$ReactNode, + tabBarIndicator?: ( +- props: $Diff< +- $ElementType< +- Parameters< +- NonNullable< +- $ElementType<$tsflower_subst$React$ComponentProps, 'renderIndicator'>, +- >, +- >, +- 0, +- >, +- {| navigationState: mixed |}, +- > & { state: TabNavigationState, ... }, ++ props: $Diff>, {| navigationState: mixed |}> & { ++ state: TabNavigationState, ++ ... ++ }, + ) => $tsflower_subst$React$ReactNode, + tabBarIndicatorStyle?: $tsflower_subst$RN$StyleProp<$tsflower_subst$RN$ViewStyle>, + tabBarIndicatorContainerStyle?: $tsflower_subst$RN$StyleProp<$tsflower_subst$RN$ViewStyle>, +-- +2.32.0 + diff --git a/types/patches/0054-tsflower-r-n-pager-view-Fix-export-.-of-types.patch b/types/patches/0054-tsflower-r-n-pager-view-Fix-export-.-of-types.patch new file mode 100644 index 00000000000..55b141d0248 --- /dev/null +++ b/types/patches/0054-tsflower-r-n-pager-view-Fix-export-.-of-types.patch @@ -0,0 +1,43 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Chris Bobbe +Date: Thu, 11 Apr 2024 14:21:06 -0700 +Subject: [tsflower] r-n-pager-view: Fix export { ... } of types + +--- + .../lib/typescript/index.js.flow | 18 ++++++++---------- + 1 file changed, 8 insertions(+), 10 deletions(-) + +diff --git types/react-native-pager-view/lib/typescript/index.js.flow types/react-native-pager-view/lib/typescript/index.js.flow +index b9966a3f1..bb200a456 100644 +--- types/react-native-pager-view/lib/typescript/index.js.flow ++++ types/react-native-pager-view/lib/typescript/index.js.flow +@@ -7,18 +7,16 @@ import { PagerView } from './PagerView'; + export default PagerView; + + import { +- type OnPageScrollEventData as PagerViewOnPageScrollEventData, +- type OnPageSelectedEventData as PagerViewOnPageSelectedEventData, +- type OnPageScrollStateChangedEventData as PageScrollStateChangedNativeEventData, +- type NativeProps, ++ type OnPageScrollEventData as PagerViewOnPageScrollEventData_, ++ type OnPageSelectedEventData as PagerViewOnPageSelectedEventData_, ++ type OnPageScrollStateChangedEventData as PageScrollStateChangedNativeEventData_, ++ type NativeProps as NativeProps_, + } from './PagerViewNativeComponent'; + +-export { +- PagerViewOnPageScrollEventData, +- PagerViewOnPageSelectedEventData, +- PageScrollStateChangedNativeEventData, +- NativeProps as PagerViewProps, +-}; ++export type PagerViewOnPageScrollEventData = PagerViewOnPageScrollEventData_; ++export type PagerViewOnPageSelectedEventData = PagerViewOnPageSelectedEventData_; ++export type PageScrollStateChangedNativeEventData = PageScrollStateChangedNativeEventData_; ++export type PagerViewProps = NativeProps_; + export type PagerViewOnPageScrollEvent = + $tsflower_subst$RN$NativeSyntheticEvent; + export type PagerViewOnPageSelectedEvent = +-- +2.32.0 + diff --git a/types/patches/0055-irreducible-rnav-Make-top-and-bottom-tab-bar-options.patch b/types/patches/0055-irreducible-rnav-Make-top-and-bottom-tab-bar-options.patch new file mode 100644 index 00000000000..65a63664c94 --- /dev/null +++ b/types/patches/0055-irreducible-rnav-Make-top-and-bottom-tab-bar-options.patch @@ -0,0 +1,85 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Chris Bobbe +Date: Thu, 11 Apr 2024 14:49:54 -0700 +Subject: [irreducible] rnav: Make top and bottom tab-bar options exact + +Maybe someday TypeScript will have exact object types. +--- + .../bottom-tabs/lib/typescript/src/types.js.flow | 6 +++--- + .../elements/lib/typescript/src/types.js.flow | 5 ++--- + .../material-top-tabs/lib/typescript/src/types.js.flow | 5 ++--- + 3 files changed, 7 insertions(+), 9 deletions(-) + +diff --git types/@react-navigation/bottom-tabs/lib/typescript/src/types.js.flow types/@react-navigation/bottom-tabs/lib/typescript/src/types.js.flow +index 93f9f4c0d..240852d71 100644 +--- types/@react-navigation/bottom-tabs/lib/typescript/src/types.js.flow ++++ types/@react-navigation/bottom-tabs/lib/typescript/src/types.js.flow +@@ -107,7 +107,8 @@ export type TabBarVisibilityAnimationConfig = + | TimingKeyboardAnimationConfig + | SpringKeyboardAnimationConfig; + +-export type BottomTabNavigationOptions = HeaderOptions & { ++export type BottomTabNavigationOptions = {| ++ ...HeaderOptions, + title?: string, + tabBarLabel?: + | string +@@ -154,8 +155,7 @@ export type BottomTabNavigationOptions = HeaderOptions & { + headerShown?: boolean, + unmountOnBlur?: boolean, + freezeOnBlur?: boolean, +- ... +-}; ++|}; + + export type BottomTabDescriptor = Descriptor< + BottomTabNavigationOptions, +diff --git types/@react-navigation/elements/lib/typescript/src/types.js.flow types/@react-navigation/elements/lib/typescript/src/types.js.flow +index 1270d287b..8fdc33df0 100644 +--- types/@react-navigation/elements/lib/typescript/src/types.js.flow ++++ types/@react-navigation/elements/lib/typescript/src/types.js.flow +@@ -17,7 +17,7 @@ export type Layout = { + ... + }; + +-export type HeaderOptions = { ++export type HeaderOptions = {| + headerTitle?: string | ((props: HeaderTitleProps) => React.ReactNode), + headerTitleAlign?: 'left' | 'center', + headerTitleStyle?: $tsflower_subst$RN$Animated$WithAnimatedValue< +@@ -65,8 +65,7 @@ export type HeaderOptions = { + >, + headerShadowVisible?: boolean, + headerStatusBarHeight?: number, +- ... +-}; ++|}; + + export type HeaderTitleProps = { + children: string, +diff --git types/@react-navigation/material-top-tabs/lib/typescript/src/types.js.flow types/@react-navigation/material-top-tabs/lib/typescript/src/types.js.flow +index 6e3b1b9e4..7abe20b5f 100644 +--- types/@react-navigation/material-top-tabs/lib/typescript/src/types.js.flow ++++ types/@react-navigation/material-top-tabs/lib/typescript/src/types.js.flow +@@ -71,7 +71,7 @@ export type MaterialTopTabScreenProps< + ... + }; + +-export type MaterialTopTabNavigationOptions = { ++export type MaterialTopTabNavigationOptions = {| + title?: string, + tabBarLabel?: + | string +@@ -118,8 +118,7 @@ export type MaterialTopTabNavigationOptions = { + lazy?: boolean, + lazyPreloadDistance?: number, + lazyPlaceholder?: () => $tsflower_subst$React$ReactNode, +- ... +-}; ++|}; + + export type MaterialTopTabDescriptor = Descriptor< + MaterialTopTabNavigationOptions, +-- +2.32.0 + diff --git a/types/patches/0056-tsflower-rnav-Handle-an-instance-of-reference-types-.patch b/types/patches/0056-tsflower-rnav-Handle-an-instance-of-reference-types-.patch new file mode 100644 index 00000000000..ba28bf8f65f --- /dev/null +++ b/types/patches/0056-tsflower-rnav-Handle-an-instance-of-reference-types-.patch @@ -0,0 +1,79 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Chris Bobbe +Date: Thu, 11 Apr 2024 15:54:50 -0700 +Subject: [tsflower] rnav: Handle an instance of /// + +This is in the TsFlower TODO: + https://github.com/gnprice/tsflower?tab=readme-ov-file#todo +--- + .../elements/lib/typescript/src/types.js.flow | 12 +++++++----- + 1 file changed, 7 insertions(+), 5 deletions(-) + +diff --git types/@react-navigation/elements/lib/typescript/src/types.js.flow types/@react-navigation/elements/lib/typescript/src/types.js.flow +index 8fdc33df0..30869a992 100644 +--- types/@react-navigation/elements/lib/typescript/src/types.js.flow ++++ types/@react-navigation/elements/lib/typescript/src/types.js.flow +@@ -1,6 +1,8 @@ + /* @flow + * @generated by TsFlower + */ ++ ++import type { ReactNode as $tsflower_subst$React$ReactNode } from 'tsflower/subst/react'; + import type { + WithAnimatedValue as $tsflower_subst$RN$Animated$WithAnimatedValue, + StyleProp as $tsflower_subst$RN$StyleProp, +@@ -18,7 +20,7 @@ export type Layout = { + }; + + export type HeaderOptions = {| +- headerTitle?: string | ((props: HeaderTitleProps) => React.ReactNode), ++ headerTitle?: string | ((props: HeaderTitleProps) => $tsflower_subst$React$ReactNode), + headerTitleAlign?: 'left' | 'center', + headerTitleStyle?: $tsflower_subst$RN$Animated$WithAnimatedValue< + $tsflower_subst$RN$StyleProp<$tsflower_subst$RN$TextStyle>, +@@ -33,29 +35,29 @@ export type HeaderOptions = {| + pressOpacity?: number, + labelVisible?: boolean, + ... +- }) => React.ReactNode, ++ }) => $tsflower_subst$React$ReactNode, + headerLeftLabelVisible?: boolean, + headerLeftContainerStyle?: $tsflower_subst$RN$Animated$WithAnimatedValue< + $tsflower_subst$RN$StyleProp<$tsflower_subst$RN$ViewStyle>, + >, + headerRight?: (props: { + tintColor?: string, + pressColor?: string, + pressOpacity?: number, + ... +- }) => React.ReactNode, ++ }) => $tsflower_subst$React$ReactNode, + headerRightContainerStyle?: $tsflower_subst$RN$Animated$WithAnimatedValue< + $tsflower_subst$RN$StyleProp<$tsflower_subst$RN$ViewStyle>, + >, + headerPressColor?: string, + headerPressOpacity?: number, + headerTintColor?: string, + headerBackground?: (props: { + style: $tsflower_subst$RN$Animated$WithAnimatedValue< + $tsflower_subst$RN$StyleProp<$tsflower_subst$RN$ViewStyle>, + >, + ... +- }) => React.ReactNode, ++ }) => $tsflower_subst$React$ReactNode, + headerBackgroundContainerStyle?: $tsflower_subst$RN$Animated$WithAnimatedValue< + $tsflower_subst$RN$StyleProp<$tsflower_subst$RN$ViewStyle>, + >, +@@ -89,7 +91,7 @@ export type HeaderButtonProps = { + export type HeaderBackButtonProps = HeaderButtonProps & { + disabled?: boolean, + onPress?: () => void, +- backImage?: (props: { tintColor: string, ... }) => React.ReactNode, ++ backImage?: (props: { tintColor: string, ... }) => $tsflower_subst$React$ReactNode, + label?: string, + truncatedLabel?: string, + labelVisible?: boolean, +-- +2.32.0 + diff --git a/types/patches/0057-shortcut-rnav-Copy-paste-translated-Props-type-rathe.patch b/types/patches/0057-shortcut-rnav-Copy-paste-translated-Props-type-rathe.patch new file mode 100644 index 00000000000..e3683fbf97f --- /dev/null +++ b/types/patches/0057-shortcut-rnav-Copy-paste-translated-Props-type-rathe.patch @@ -0,0 +1,51 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Chris Bobbe +Date: Thu, 11 Apr 2024 16:22:37 -0700 +Subject: [shortcut] rnav: Copy-paste translated Props type rather than + importing + +I don't really know what this @react-native-masked-view/masked-view +stuff is about. This @react-navigation/elements package lists it as +a *dev* dependency and calls it "optional": + https://github.com/react-navigation/react-navigation/blob/6.x/packages/elements/src/MaskedViewNative.tsx#L17 + +Anyway, the type we want from it is simple, so we just translate it +and copy-paste it here, instead of adding the dependency and giving +more work to tools/tsflower. +--- + .../typescript/src/MaskedViewNative.js.flow | 18 ++++++------------ + 1 file changed, 6 insertions(+), 12 deletions(-) + +diff --git types/@react-navigation/elements/lib/typescript/src/MaskedViewNative.js.flow types/@react-navigation/elements/lib/typescript/src/MaskedViewNative.js.flow +index 39da71d49..cc5fc2306 100644 +--- types/@react-navigation/elements/lib/typescript/src/MaskedViewNative.js.flow ++++ types/@react-navigation/elements/lib/typescript/src/MaskedViewNative.js.flow +@@ -1,19 +1,13 @@ + /* @flow + * @generated by TsFlower + */ +-import typeof * as $tsflower_import_typeof$_$_40_react_2d_native_2d_masked_2d_view_2f_masked_2d_view from '@react-native-masked-view/masked-view'; ++import type { JSX$Element as $tsflower_subst$React$JSX$Element } from 'tsflower/subst/react'; ++import type { ViewProps as $tsflower_subst$RN$ViewProps } from 'tsflower/subst/react-native'; + +-import type { +- ComponentProps as $tsflower_subst$React$ComponentProps, +- JSX$Element as $tsflower_subst$React$JSX$Element, +-} from 'tsflower/subst/react'; +- +-import * as React from 'react'; +-type MaskedViewType = $ElementType< +- $tsflower_import_typeof$_$_40_react_2d_native_2d_masked_2d_view_2f_masked_2d_view, +- 'default', +->; +-type Props = $tsflower_subst$React$ComponentProps & { ++type Props = { ++ ...$tsflower_subst$RN$ViewProps, ++ maskElement: React$Element, ++ androidRenderingMode?: 'software' | 'hardware', + children: React$Element, + ... + }; +-- +2.32.0 + diff --git a/types/react-native-pager-view/index.js.flow b/types/react-native-pager-view/index.js.flow new file mode 100644 index 00000000000..9d491e42ef3 --- /dev/null +++ b/types/react-native-pager-view/index.js.flow @@ -0,0 +1,4 @@ +/* @flow + * @generated + */ +export * from './lib/typescript/index.js.flow'; diff --git a/types/react-native-pager-view/lib/typescript/PagerView.js.flow b/types/react-native-pager-view/lib/typescript/PagerView.js.flow new file mode 100644 index 00000000000..f69ca58c64c --- /dev/null +++ b/types/react-native-pager-view/lib/typescript/PagerView.js.flow @@ -0,0 +1,22 @@ +/* @flow + * @generated by TsFlower + */ +import type { JSX$Element as $tsflower_subst$React$JSX$Element } from 'tsflower/subst/react'; +import * as React from 'react'; +import { type NativeProps as PagerViewProps } from './PagerViewNativeComponent'; +import PagerViewView from './PagerViewNativeComponent'; + +declare export class PagerView extends React.Component { + isScrolling: any; + pagerView: React.ElementRef | null; + _onPageScroll: any; + _onPageScrollStateChanged: any; + _onPageSelected: any; + setPage: (selectedPage: number) => void; + setPageWithoutAnimation: (selectedPage: number) => void; + setScrollEnabled: (scrollEnabled: boolean) => void; + _onMoveShouldSetResponderCapture: any; + // $FlowIgnore[unsafe-getters-setters] + get deducedLayoutDirection(): any; + render(): $tsflower_subst$React$JSX$Element; +} diff --git a/types/react-native-pager-view/lib/typescript/PagerViewNativeComponent.js.flow b/types/react-native-pager-view/lib/typescript/PagerViewNativeComponent.js.flow new file mode 100644 index 00000000000..9a074682480 --- /dev/null +++ b/types/react-native-pager-view/lib/typescript/PagerViewNativeComponent.js.flow @@ -0,0 +1,60 @@ +/* @flow + * @generated by TsFlower + */ +import type { Readonly } from 'tsflower/subst/lib'; +import type { ViewProps as $tsflower_subst$RN$ViewProps } from 'tsflower/subst/react-native'; +import * as React from 'react'; +import { type HostComponent } from 'react-native'; +import { + type DirectEventHandler, + type Double, + type Int32, + type WithDefault, +} from 'react-native/Libraries/Types/CodegenTypes'; + +export type OnPageScrollEventData = Readonly<{ + position: Double, + offset: Double, + ... +}>; + +export type OnPageSelectedEventData = Readonly<{ position: Double, ... }>; +export type OnPageScrollStateChangedEventData = Readonly<{ + pageScrollState: 'idle' | 'dragging' | 'settling', + ... +}>; + +export type NativeProps = { + ...$tsflower_subst$RN$ViewProps, + scrollEnabled?: WithDefault, + layoutDirection?: WithDefault<'ltr' | 'rtl', 'ltr'>, + initialPage?: Int32, + orientation?: WithDefault<'horizontal' | 'vertical', 'horizontal'>, + offscreenPageLimit?: Int32, + pageMargin?: Int32, + overScrollMode?: WithDefault<'auto' | 'always' | 'never', 'auto'>, + overdrag?: WithDefault, + keyboardDismissMode?: WithDefault<'none' | 'on-drag', 'none'>, + onPageScroll?: DirectEventHandler, + onPageSelected?: DirectEventHandler, + onPageScrollStateChanged?: DirectEventHandler, + ... +}; + +type PagerViewViewType = HostComponent; + +export interface NativeCommands { + setPage: (viewRef: React.ElementRef, selectedPage: Int32) => void; + setPageWithoutAnimation: ( + viewRef: React.ElementRef, + selectedPage: Int32, + ) => void; + setScrollEnabledImperatively: ( + viewRef: React.ElementRef, + scrollEnabled: boolean, + ) => void; +} + +declare export var Commands: NativeCommands; +declare var _default: HostComponent; +export default _default; diff --git a/types/react-native-pager-view/lib/typescript/index.js.flow b/types/react-native-pager-view/lib/typescript/index.js.flow new file mode 100644 index 00000000000..bb200a456ae --- /dev/null +++ b/types/react-native-pager-view/lib/typescript/index.js.flow @@ -0,0 +1,25 @@ +/* @flow + * @generated by TsFlower + */ +import type { NativeSyntheticEvent as $tsflower_subst$RN$NativeSyntheticEvent } from 'tsflower/subst/react-native'; +import * as ReactNative from 'react-native'; +import { PagerView } from './PagerView'; +export default PagerView; + +import { + type OnPageScrollEventData as PagerViewOnPageScrollEventData_, + type OnPageSelectedEventData as PagerViewOnPageSelectedEventData_, + type OnPageScrollStateChangedEventData as PageScrollStateChangedNativeEventData_, + type NativeProps as NativeProps_, +} from './PagerViewNativeComponent'; + +export type PagerViewOnPageScrollEventData = PagerViewOnPageScrollEventData_; +export type PagerViewOnPageSelectedEventData = PagerViewOnPageSelectedEventData_; +export type PageScrollStateChangedNativeEventData = PageScrollStateChangedNativeEventData_; +export type PagerViewProps = NativeProps_; +export type PagerViewOnPageScrollEvent = + $tsflower_subst$RN$NativeSyntheticEvent; +export type PagerViewOnPageSelectedEvent = + $tsflower_subst$RN$NativeSyntheticEvent; +export type PageScrollStateChangedNativeEvent = + $tsflower_subst$RN$NativeSyntheticEvent; diff --git a/types/react-native-pager-view/lib/typescript/utils.js.flow b/types/react-native-pager-view/lib/typescript/utils.js.flow new file mode 100644 index 00000000000..3da3c9e8791 --- /dev/null +++ b/types/react-native-pager-view/lib/typescript/utils.js.flow @@ -0,0 +1,12 @@ +/* @flow + * @generated by TsFlower + */ +import type { + ReactNode as $tsflower_subst$React$ReactNode, + JSX$Element as $tsflower_subst$React$JSX$Element, +} from 'tsflower/subst/react'; + +import 'react'; +declare export var childrenWithOverriddenStyle: ( + children?: $tsflower_subst$React$ReactNode, +) => $tsflower_subst$React$JSX$Element[] | null | void; diff --git a/types/react-native-reanimated/index.js.flow b/types/react-native-reanimated/index.js.flow deleted file mode 100644 index b400c1e1b21..00000000000 --- a/types/react-native-reanimated/index.js.flow +++ /dev/null @@ -1,8 +0,0 @@ -// @flow -// Simple manual stubs, while we focus on other libraries. - -export class Node {} -export class Value {} -export class View {} - -export default { Node, Value, View }; diff --git a/types/react-native-tab-view/lib/typescript/src/Pager.android.js.flow b/types/react-native-tab-view/lib/typescript/src/Pager.android.js.flow new file mode 100644 index 00000000000..03c61e58d15 --- /dev/null +++ b/types/react-native-tab-view/lib/typescript/src/Pager.android.js.flow @@ -0,0 +1,4 @@ +/* @flow + * @generated by TsFlower + */ +export { PagerViewAdapter as Pager } from './PagerViewAdapter'; diff --git a/types/react-native-tab-view/lib/typescript/src/Pager.ios.js.flow b/types/react-native-tab-view/lib/typescript/src/Pager.ios.js.flow new file mode 100644 index 00000000000..03c61e58d15 --- /dev/null +++ b/types/react-native-tab-view/lib/typescript/src/Pager.ios.js.flow @@ -0,0 +1,4 @@ +/* @flow + * @generated by TsFlower + */ +export { PagerViewAdapter as Pager } from './PagerViewAdapter'; diff --git a/types/react-native-tab-view/lib/typescript/src/Pager.js.flow b/types/react-native-tab-view/lib/typescript/src/Pager.js.flow index 881695e3b44..e946b03bdfd 100644 --- a/types/react-native-tab-view/lib/typescript/src/Pager.js.flow +++ b/types/react-native-tab-view/lib/typescript/src/Pager.js.flow @@ -1,105 +1,4 @@ /* @flow * @generated by TsFlower */ -import type { - ReactNode as $tsflower_subst$React$ReactNode, - ComponentProps as $tsflower_subst$React$ComponentProps, - RefObject as $tsflower_subst$React$RefObject, - Context as $tsflower_subst$React$Context, -} from 'tsflower/subst/react'; - -import * as React from 'react'; -import { PanGestureHandler } from 'react-native-gesture-handler'; -import Animated from 'react-native-reanimated'; - -import { - type Layout, - type NavigationState, - type Route, - type PagerCommonProps, - type EventEmitterProps, -} from './types'; - -export type Props = PagerCommonProps & { - onIndexChange: (index: number) => void, - navigationState: NavigationState, - layout: Layout, - removeClippedSubviews?: boolean, - children: ( - props: EventEmitterProps & { - position: Animated.Node, - render: (children: $tsflower_subst$React$ReactNode) => $tsflower_subst$React$ReactNode, - jumpTo: (key: string) => void, - ... - }, - ) => $tsflower_subst$React$ReactNode, - gestureHandlerProps: $tsflower_subst$React$ComponentProps, - ... -}; - -type ComponentState = { - enabled: boolean, - childPanGestureHandlerRefs: $tsflower_subst$React$RefObject[], - ... -}; - -declare export default class Pager extends React.Component, ComponentState> { - defaultProps: { - swipeVelocityImpact: number, - springVelocityScale: number, - ... - }; - state: { - enabled: boolean, - childPanGestureHandlerRefs: $tsflower_subst$React$RefObject[], - ... - }; - componentDidMount(): void; - componentDidUpdate(prevProps: Props): void; - componentWillUnmount(): void; - mounted: boolean; - contextType: $tsflower_subst$React$Context<{ ... }>; - providerVal: any; - gestureHandlerRef: any; - clock: any; - velocityX: any; - gestureX: any; - gestureState: any; - offsetX: any; - gesturesEnabled: any; - progress: any; - index: any; - nextIndex: any; - lastEnteredIndex: any; - isSwiping: any; - isSwipeGesture: any; - indexAtSwipeEnd: any; - routesLength: any; - layoutWidth: any; - swipeVelocityImpact: any; - springVelocityScale: any; - position: any; - springConfig: any; - timingConfig: any; - initialVelocityForSpring: any; - currentIndexValue: any; - pendingIndexValue: any; - previouslyFocusedTextInput: any; - enterListeners: any; - interactionHandle: any; - jumpToIndex: any; - jumpTo: any; - addListener: any; - removeListener: any; - handleEnteredIndexChange: any; - transitionTo: any; - handleGestureEvent: any; - extrapolatedPosition: any; - toggleEnabled: any; - maybeCancel: any; - translateX: any; - getTranslateX: any; - render(): $tsflower_subst$React$ReactNode; -} - -export {}; +export { PanResponderAdapter as Pager } from './PanResponderAdapter'; diff --git a/types/react-native-tab-view/lib/typescript/src/PagerViewAdapter.js.flow b/types/react-native-tab-view/lib/typescript/src/PagerViewAdapter.js.flow new file mode 100644 index 00000000000..6ebea3b6faf --- /dev/null +++ b/types/react-native-tab-view/lib/typescript/src/PagerViewAdapter.js.flow @@ -0,0 +1,32 @@ +/* @flow + * @generated by TsFlower + */ +import type { AnimatedInterpolation as $tsflower_subst$RN$Animated$AnimatedInterpolation } from 'tsflower/subst/react-native'; + +import type { + ReactNode as $tsflower_subst$React$ReactNode, + JSXElementConstructor as $tsflower_subst$React$JSXElementConstructor, +} from 'tsflower/subst/react'; + +import * as React from 'react'; +import { Animated } from 'react-native'; +import { type EventEmitterProps, type NavigationState, type PagerProps, type Route } from './types'; + +type Props = PagerProps & { + onIndexChange: (index: number) => void, + navigationState: NavigationState, + children: ( + props: EventEmitterProps & { + position: $tsflower_subst$RN$Animated$AnimatedInterpolation, + render: (children: $tsflower_subst$React$ReactNode) => $tsflower_subst$React$ReactNode, + jumpTo: (key: string) => void, + ... + }, + ) => React$Element, + ... +}; + +declare export function PagerViewAdapter( + Props, +): React$Element>; +export {}; diff --git a/types/react-native-tab-view/lib/typescript/src/PanResponderAdapter.js.flow b/types/react-native-tab-view/lib/typescript/src/PanResponderAdapter.js.flow new file mode 100644 index 00000000000..7511489b81c --- /dev/null +++ b/types/react-native-tab-view/lib/typescript/src/PanResponderAdapter.js.flow @@ -0,0 +1,40 @@ +/* @flow + * @generated by TsFlower + */ +import type { AnimatedInterpolation as $tsflower_subst$RN$Animated$AnimatedInterpolation } from 'tsflower/subst/react-native'; + +import type { + ReactNode as $tsflower_subst$React$ReactNode, + JSXElementConstructor as $tsflower_subst$React$JSXElementConstructor, +} from 'tsflower/subst/react'; + +import * as React from 'react'; +import { Animated } from 'react-native'; + +import { + type EventEmitterProps, + type Layout, + type NavigationState, + type PagerProps, + type Route, +} from './types'; + +type Props = PagerProps & { + layout: Layout, + onIndexChange: (index: number) => void, + navigationState: NavigationState, + children: ( + props: EventEmitterProps & { + position: $tsflower_subst$RN$Animated$AnimatedInterpolation, + render: (children: $tsflower_subst$React$ReactNode) => $tsflower_subst$React$ReactNode, + jumpTo: (key: string) => void, + ... + }, + ) => React$Element, + ... +}; + +declare export function PanResponderAdapter( + Props, +): React$Element>; +export {}; diff --git a/types/react-native-tab-view/lib/typescript/src/PlatformPressable.js.flow b/types/react-native-tab-view/lib/typescript/src/PlatformPressable.js.flow new file mode 100644 index 00000000000..32a21e0b65a --- /dev/null +++ b/types/react-native-tab-view/lib/typescript/src/PlatformPressable.js.flow @@ -0,0 +1,21 @@ +/* @flow + * @generated by TsFlower + */ +import type { PressableProps as $tsflower_subst$RN$PressableProps } from 'tsflower/subst/react-native'; + +import type { + ReactNode as $tsflower_subst$React$ReactNode, + JSX$Element as $tsflower_subst$React$JSX$Element, +} from 'tsflower/subst/react'; + +import * as React from 'react'; +import 'react-native'; + +export type Props = $tsflower_subst$RN$PressableProps & { + pressColor?: string, + pressOpacity?: number, + children: $tsflower_subst$React$ReactNode, + ... +}; + +declare export function PlatformPressable(Props): $tsflower_subst$React$JSX$Element; diff --git a/types/react-native-tab-view/lib/typescript/src/SceneMap.js.flow b/types/react-native-tab-view/lib/typescript/src/SceneMap.js.flow index 0d678e134fa..a4b091f0bcf 100644 --- a/types/react-native-tab-view/lib/typescript/src/SceneMap.js.flow +++ b/types/react-native-tab-view/lib/typescript/src/SceneMap.js.flow @@ -4,7 +4,9 @@ import type { JSX$Element as $tsflower_subst$React$JSX$Element } from 'tsflower/subst/react'; import * as React from 'react'; import { type SceneRendererProps } from './types'; -declare export default function SceneMap(scenes: { +type SceneProps = { route: any, ... } & $Diff; +declare export function SceneMap(scenes: { [key: string]: React.ComponentType, ... -}): (SceneRendererProps & { route: any, ... }) => $tsflower_subst$React$JSX$Element; +}): SceneProps => $tsflower_subst$React$JSX$Element; +export {}; diff --git a/types/react-native-tab-view/lib/typescript/src/SceneView.js.flow b/types/react-native-tab-view/lib/typescript/src/SceneView.js.flow index 63634b9dca1..cc1c0513935 100644 --- a/types/react-native-tab-view/lib/typescript/src/SceneView.js.flow +++ b/types/react-native-tab-view/lib/typescript/src/SceneView.js.flow @@ -15,10 +15,10 @@ import * as React from 'react'; import 'react-native'; import { - type SceneRendererProps, type EventEmitterProps, type NavigationState, type Route, + type SceneRendererProps, } from './types'; type Props = SceneRendererProps & @@ -32,16 +32,5 @@ type Props = SceneRendererProps & ... }; -type State = { loading: boolean, ... }; - -declare export default class SceneView extends React.Component, State> { - getDerivedStateFromProps(props: Props, state: State): { loading: boolean, ... } | null; - state: { loading: boolean, ... }; - componentDidMount(): void; - componentDidUpdate(prevProps: Props, prevState: State): void; - componentWillUnmount(): void; - handleEnter: any; - render(): $tsflower_subst$React$JSX$Element; -} - +declare export function SceneView(Props): $tsflower_subst$React$JSX$Element; export {}; diff --git a/types/react-native-tab-view/lib/typescript/src/ScrollPager.js.flow b/types/react-native-tab-view/lib/typescript/src/ScrollPager.js.flow deleted file mode 100644 index 7908822ed90..00000000000 --- a/types/react-native-tab-view/lib/typescript/src/ScrollPager.js.flow +++ /dev/null @@ -1,41 +0,0 @@ -/* @flow - * @generated by TsFlower - */ -import type { ReactNode as $tsflower_subst$React$ReactNode } from 'tsflower/subst/react'; -import * as React from 'react'; -import { type Props } from './Pager'; -import { type Route } from './types'; - -type State = { - initialOffset: { - x: number, - y: number, - ... - }, - ... -}; - -declare export default class ScrollPager - extends React.Component & { overscroll?: boolean, ... }, State> -{ - defaultProps: { bounces: boolean, ... }; - componentDidMount(): void; - componentDidUpdate(prevProps: Props): void; - componentWillUnmount(): void; - initialOffset: any; - wasTouched: any; - interactionHandle: any; - scrollViewRef: any; - jumpTo: any; - scrollTo: any; - enterListeners: any; - addListener: any; - removeListener: any; - position: any; - onScroll: any; - layoutWidthNode: any; - relativePosition: any; - render(): $tsflower_subst$React$ReactNode; -} - -export {}; diff --git a/types/react-native-tab-view/lib/typescript/src/TabBar.js.flow b/types/react-native-tab-view/lib/typescript/src/TabBar.js.flow index dca3c0b8a4d..77aa8ccdc35 100644 --- a/types/react-native-tab-view/lib/typescript/src/TabBar.js.flow +++ b/types/react-native-tab-view/lib/typescript/src/TabBar.js.flow @@ -13,17 +13,16 @@ import type { } from 'tsflower/subst/react-native'; import * as React from 'react'; -import 'react-native'; -import { type Props as TabBarItemProps } from './TabBarItem'; +// import { type PressableAndroidRippleConfig } from 'react-native'; // TODO(tsflower) import { type Props as IndicatorProps } from './TabBarIndicator'; +import { type Props as TabBarItemProps } from './TabBarItem'; import { + type Event, + type NavigationState, type Route, type Scene, type SceneRendererProps, - type NavigationState, - type Layout, - type Event, } from './types'; export type Props = SceneRendererProps & { @@ -34,10 +33,10 @@ export type Props = SceneRendererProps & { inactiveColor?: string, pressColor?: string, pressOpacity?: number, - getLabelText: (scene: Scene) => string | void, - getAccessible: (scene: Scene) => boolean | void, - getAccessibilityLabel: (scene: Scene) => string | void, - getTestID: (scene: Scene) => string | void, + getLabelText?: (scene: Scene) => string | void, + getAccessible?: (scene: Scene) => boolean | void, + getAccessibilityLabel?: (scene: Scene) => string | void, + getTestID?: (scene: Scene) => string | void, renderLabel?: ( scene: Scene & { focused: boolean, @@ -53,7 +52,7 @@ export type Props = SceneRendererProps & { }, ) => $tsflower_subst$React$ReactNode, renderBadge?: (scene: Scene) => $tsflower_subst$React$ReactNode, - renderIndicator: (props: IndicatorProps) => $tsflower_subst$React$ReactNode, + renderIndicator?: (props: IndicatorProps) => $tsflower_subst$React$ReactNode, renderTabBarItem?: ( props: TabBarItemProps & { key: string, ... }, ) => React$Element, @@ -65,42 +64,10 @@ export type Props = SceneRendererProps & { labelStyle?: $tsflower_subst$RN$StyleProp<$tsflower_subst$RN$TextStyle>, contentContainerStyle?: $tsflower_subst$RN$StyleProp<$tsflower_subst$RN$ViewStyle>, style?: $tsflower_subst$RN$StyleProp<$tsflower_subst$RN$ViewStyle>, + gap?: number, + testID?: string, + // android_ripple?: PressableAndroidRippleConfig, // TODO(tsflower) ... }; -type State = { - layout: Layout, - tabWidths: { [key: string]: number, ... }, - ... -}; - -declare export default class TabBar extends React.Component, State> { - defaultProps: { - getLabelText: (Scene) => string | void, - getAccessible: (Scene) => boolean, - getAccessibilityLabel: (Scene) => string | void, - getTestID: (Scene) => string | void, - renderIndicator: (props: IndicatorProps) => $tsflower_subst$React$JSX$Element, - ... - }; - state: State; - componentDidUpdate(prevProps: Props, prevState: State): void; - componentWillUnmount(): void; - measuredTabWidths: any; - scrollAmount: any; - scrollViewRef: any; - cancelNextFrameCb: any; - getFlattenedTabWidth: any; - getComputedTabWidth: any; - getMemoizedTabWidthGettter: any; - getMaxScrollDistance: any; - getTabBarWidth: any; - normalizeScrollValue: any; - getScrollAmount: any; - resetScroll: any; - handleLayout: any; - getTranslateX: any; - render(): $tsflower_subst$React$JSX$Element; -} - -export {}; +declare export function TabBar(Props): $tsflower_subst$React$JSX$Element; diff --git a/types/react-native-tab-view/lib/typescript/src/TabBarIndicator.js.flow b/types/react-native-tab-view/lib/typescript/src/TabBarIndicator.js.flow index 1487a7c05ed..ba6256ea734 100644 --- a/types/react-native-tab-view/lib/typescript/src/TabBarIndicator.js.flow +++ b/types/react-native-tab-view/lib/typescript/src/TabBarIndicator.js.flow @@ -7,9 +7,8 @@ import type { } from 'tsflower/subst/react-native'; import type { JSX$Element as $tsflower_subst$React$JSX$Element } from 'tsflower/subst/react'; -import * as React from 'react'; import 'react-native'; -import { type Route, type SceneRendererProps, type NavigationState } from './types'; +import { type NavigationState, type Route, type SceneRendererProps } from './types'; export type GetTabWidth = (index: number) => number; export type Props = SceneRendererProps & { @@ -17,16 +16,8 @@ export type Props = SceneRendererProps & { width: string | number, style?: $tsflower_subst$RN$StyleProp<$tsflower_subst$RN$ViewStyle>, getTabWidth: GetTabWidth, + gap?: number, ... }; -declare export default class TabBarIndicator extends React.Component> { - componentDidMount(): void; - componentDidUpdate(): void; - fadeInIndicator: any; - isIndicatorShown: any; - opacity: any; - getTranslateX: any; - getWidth: any; - render(): $tsflower_subst$React$JSX$Element; -} +declare export function TabBarIndicator(Props): $tsflower_subst$React$JSX$Element; diff --git a/types/react-native-tab-view/lib/typescript/src/TabBarItem.js.flow b/types/react-native-tab-view/lib/typescript/src/TabBarItem.js.flow index 62d21f272ce..34251807a20 100644 --- a/types/react-native-tab-view/lib/typescript/src/TabBarItem.js.flow +++ b/types/react-native-tab-view/lib/typescript/src/TabBarItem.js.flow @@ -2,24 +2,27 @@ * @generated by TsFlower */ import type { - ReactNode as $tsflower_subst$React$ReactNode, - JSX$Element as $tsflower_subst$React$JSX$Element, -} from 'tsflower/subst/react'; - -import type { + AnimatedInterpolation as $tsflower_subst$RN$Animated$AnimatedInterpolation, LayoutChangeEvent as $tsflower_subst$RN$LayoutChangeEvent, StyleProp as $tsflower_subst$RN$StyleProp, TextStyle as $tsflower_subst$RN$TextStyle, ViewStyle as $tsflower_subst$RN$ViewStyle, } from 'tsflower/subst/react-native'; +import type { + ReactNode as $tsflower_subst$React$ReactNode, + JSX$Element as $tsflower_subst$React$JSX$Element, +} from 'tsflower/subst/react'; + import * as React from 'react'; -import 'react-native'; -import { type Scene, type Route, type NavigationState } from './types'; -import Animated from 'react-native-reanimated'; +import { + Animated, + // type PressableAndroidRippleConfig, // TODO(tsflower) +} from 'react-native'; +import { type NavigationState, type Route, type Scene } from './types'; export type Props = { - position: Animated.Node, + position: $tsflower_subst$RN$Animated$AnimatedInterpolation, route: T, navigationState: NavigationState, activeColor?: string, @@ -46,13 +49,11 @@ export type Props = { onLayout?: (event: $tsflower_subst$RN$LayoutChangeEvent) => void, onPress: () => void, onLongPress: () => void, + defaultTabWidth?: number, labelStyle?: $tsflower_subst$RN$StyleProp<$tsflower_subst$RN$TextStyle>, style: $tsflower_subst$RN$StyleProp<$tsflower_subst$RN$ViewStyle>, + // android_ripple?: PressableAndroidRippleConfig, // TODO(tsflower) ... }; -declare export default class TabBarItem extends React.Component> { - getActiveOpacity: any; - getInactiveOpacity: any; - render(): $tsflower_subst$React$JSX$Element; -} +declare export function TabBarItem(props: Props): $tsflower_subst$React$JSX$Element; diff --git a/types/react-native-tab-view/lib/typescript/src/TabBarItemLabel.js.flow b/types/react-native-tab-view/lib/typescript/src/TabBarItemLabel.js.flow new file mode 100644 index 00000000000..df8c22d3eb2 --- /dev/null +++ b/types/react-native-tab-view/lib/typescript/src/TabBarItemLabel.js.flow @@ -0,0 +1,28 @@ +/* @flow + * @generated by TsFlower + */ +import type { + StyleProp as $tsflower_subst$RN$StyleProp, + ViewStyle as $tsflower_subst$RN$ViewStyle, +} from 'tsflower/subst/react-native'; + +import type { + ReactNode as $tsflower_subst$React$ReactNode, + MemoExoticComponent as $tsflower_subst$React$MemoExoticComponent, + JSX$Element as $tsflower_subst$React$JSX$Element, +} from 'tsflower/subst/react'; + +import React from 'react'; +import 'react-native'; + +declare interface TabBarItemLabelProps { + color: string; + label?: string; + labelStyle: $tsflower_subst$RN$StyleProp<$tsflower_subst$RN$ViewStyle>; + icon: $tsflower_subst$React$ReactNode; +} + +declare export var TabBarItemLabel: $tsflower_subst$React$MemoExoticComponent< + (TabBarItemLabelProps) => $tsflower_subst$React$JSX$Element | null, +>; +export {}; diff --git a/types/react-native-tab-view/lib/typescript/src/TabView.js.flow b/types/react-native-tab-view/lib/typescript/src/TabView.js.flow index 2718d4a4547..caddb568dec 100644 --- a/types/react-native-tab-view/lib/typescript/src/TabView.js.flow +++ b/types/react-native-tab-view/lib/typescript/src/TabView.js.flow @@ -3,10 +3,11 @@ */ import type { ReactNode as $tsflower_subst$React$ReactNode, - ComponentProps as $tsflower_subst$React$ComponentProps, JSX$Element as $tsflower_subst$React$JSX$Element, } from 'tsflower/subst/react'; +import type { Partial } from 'tsflower/subst/lib'; + import type { StyleProp as $tsflower_subst$RN$StyleProp, ViewStyle as $tsflower_subst$RN$ViewStyle, @@ -14,74 +15,31 @@ import type { import * as React from 'react'; import 'react-native'; -import { PanGestureHandler } from 'react-native-gesture-handler'; -import Animated from 'react-native-reanimated'; -import { type Props as TabBarProps } from './TabBar'; import { type Layout, type NavigationState, + type PagerProps, type Route, type SceneRendererProps, - type PagerCommonProps, } from './types'; -import { type Props as ChildProps } from './Pager'; - -export type Props = PagerCommonProps & { - position?: Animated.Value, +export type Props = PagerProps & { onIndexChange: (index: number) => void, navigationState: NavigationState, renderScene: (props: SceneRendererProps & { route: T, ... }) => $tsflower_subst$React$ReactNode, - renderLazyPlaceholder: (props: { route: T, ... }) => $tsflower_subst$React$ReactNode, - renderTabBar: ( + renderLazyPlaceholder?: (props: { route: T, ... }) => $tsflower_subst$React$ReactNode, + renderTabBar?: ( props: SceneRendererProps & { navigationState: NavigationState, ... }, ) => $tsflower_subst$React$ReactNode, - tabBarPosition: 'top' | 'bottom', - initialLayout?: { - width?: number, - height?: number, - ... - }, - lazy: (props: { route: T, ... }) => boolean | boolean, - lazyPreloadDistance: number, - removeClippedSubviews?: boolean, + tabBarPosition?: 'top' | 'bottom', + initialLayout?: Partial, + lazy?: (props: { route: T, ... }) => boolean | boolean, + lazyPreloadDistance?: number, sceneContainerStyle?: $tsflower_subst$RN$StyleProp<$tsflower_subst$RN$ViewStyle>, + pagerStyle?: $tsflower_subst$RN$StyleProp<$tsflower_subst$RN$ViewStyle>, style?: $tsflower_subst$RN$StyleProp<$tsflower_subst$RN$ViewStyle>, - gestureHandlerProps: $tsflower_subst$React$ComponentProps, - renderPager: (props: ChildProps) => $tsflower_subst$React$ReactNode, ... }; -type State = { layout: Layout, ... }; - -declare export default class TabView extends React.Component, State> { - defaultProps: { - tabBarPosition: string, - renderTabBar: (props: TabBarProps

) => $tsflower_subst$React$JSX$Element, - renderLazyPlaceholder: () => null, - keyboardDismissMode: string, - swipeEnabled: boolean, - lazy: boolean, - lazyPreloadDistance: number, - removeClippedSubviews: boolean, - springConfig: { ... }, - timingConfig: { ... }, - gestureHandlerProps: { ... }, - renderPager: (props: ChildProps) => $tsflower_subst$React$JSX$Element, - ... - }; - state: { - layout: { - width: number, - height: number, - ... - }, - ... - }; - jumpToIndex: any; - handleLayout: any; - render(): $tsflower_subst$React$JSX$Element; -} - -export {}; +declare export function TabView(Props): $tsflower_subst$React$JSX$Element; diff --git a/types/react-native-tab-view/lib/typescript/src/index.js.flow b/types/react-native-tab-view/lib/typescript/src/index.js.flow index dc193d35390..16f879044d0 100644 --- a/types/react-native-tab-view/lib/typescript/src/index.js.flow +++ b/types/react-native-tab-view/lib/typescript/src/index.js.flow @@ -1,15 +1,13 @@ /* @flow * @generated by TsFlower */ -export { default as TabBar } from './TabBar'; +export { SceneMap } from './SceneMap'; export { Props as TabBarProps } from './TabBar'; -export { default as TabView } from './TabView'; -export { Props as TabViewProps } from './TabView'; -export { default as TabBarIndicator } from './TabBarIndicator'; +export { TabBar } from './TabBar'; export { Props as TabBarIndicatorProps } from './TabBarIndicator'; -export { default as TabBarItem } from './TabBarItem'; +export { TabBarIndicator } from './TabBarIndicator'; export { Props as TabBarItemProps } from './TabBarItem'; -export { default as TouchableItem } from './TouchableItem'; -export { default as SceneMap } from './SceneMap'; -export { default as ScrollPager } from './ScrollPager'; -export { Route, NavigationState, SceneRendererProps } from './types'; +export { TabBarItem } from './TabBarItem'; +export { Props as TabViewProps } from './TabView'; +export { TabView } from './TabView'; +export { NavigationState, Route, SceneRendererProps } from './types'; diff --git a/types/react-native-tab-view/lib/typescript/src/memoize.js.flow b/types/react-native-tab-view/lib/typescript/src/memoize.js.flow deleted file mode 100644 index 3737c4a1df6..00000000000 --- a/types/react-native-tab-view/lib/typescript/src/memoize.js.flow +++ /dev/null @@ -1,10 +0,0 @@ -/* @flow - * @generated by TsFlower - */ -declare export default function memoize< - Result, - Deps: /* tsflower-warning: unimplemented: 'readonly' as type operator */ - any[] /* readonly any[] */, ->( - callback: (...deps: Deps) => Result, -): (...dependencies: Deps) => Result; diff --git a/types/react-native-tab-view/lib/typescript/src/types.js.flow b/types/react-native-tab-view/lib/typescript/src/types.js.flow index c250fa202a0..4d87d3baaf2 100644 --- a/types/react-native-tab-view/lib/typescript/src/types.js.flow +++ b/types/react-native-tab-view/lib/typescript/src/types.js.flow @@ -1,7 +1,9 @@ /* @flow * @generated by TsFlower */ -import Animated from 'react-native-reanimated'; +import type { AnimatedInterpolation as $tsflower_subst$RN$Animated$AnimatedInterpolation } from 'tsflower/subst/react-native'; +import { typeof Animated } from 'react-native'; +import { type PagerViewProps } from 'react-native-pager-view'; export type Route = { key: string, @@ -37,32 +39,29 @@ export type Listener = (value: number) => void; export type SceneRendererProps = { layout: Layout, - position: Animated.Node, + position: $tsflower_subst$RN$Animated$AnimatedInterpolation, jumpTo: (key: string) => void, ... }; -export type EventEmitterProps = { - addListener: (type: 'enter', listener: Listener) => void, - removeListener: (type: 'enter', listener: Listener) => void, - ... -}; +export type EventEmitterProps = { addEnterListener: (listener: Listener) => () => void, ... }; -export type PagerCommonProps = { - keyboardDismissMode: 'none' | 'on-drag' | 'auto', - swipeEnabled: boolean, - swipeVelocityImpact?: number, +export type PagerProps = $Diff< + PagerViewProps, + {| + initialPage: mixed, + scrollEnabled: mixed, + onPageScroll: mixed, + onPageSelected: mixed, + onPageScrollStateChanged: mixed, + keyboardDismissMode: mixed, + children: mixed, + |}, +> & { + keyboardDismissMode?: 'none' | 'on-drag' | 'auto', + swipeEnabled?: boolean, + animationEnabled?: boolean, onSwipeStart?: () => void, onSwipeEnd?: () => void, - springVelocityScale?: number, - springConfig: { - damping?: number, - mass?: number, - stiffness?: number, - restSpeedThreshold?: number, - restDisplacementThreshold?: number, - ... - }, - timingConfig: { duration?: number, ... }, ... }; diff --git a/types/react-native-tab-view/lib/typescript/src/useAnimatedValue.js.flow b/types/react-native-tab-view/lib/typescript/src/useAnimatedValue.js.flow new file mode 100644 index 00000000000..1de31a8957d --- /dev/null +++ b/types/react-native-tab-view/lib/typescript/src/useAnimatedValue.js.flow @@ -0,0 +1,5 @@ +/* @flow + * @generated by TsFlower + */ +import { Animated } from 'react-native'; +declare export function useAnimatedValue(initialValue: number): Animated.Value; diff --git a/yarn.lock b/yarn.lock index 238a791eaac..3a037b694ed 100644 --- a/yarn.lock +++ b/yarn.lock @@ -805,7 +805,7 @@ "@babel/helper-plugin-utils" "^7.24.0" "@babel/plugin-syntax-numeric-separator" "^7.10.4" -"@babel/plugin-transform-object-assign@^7.0.0", "@babel/plugin-transform-object-assign@^7.10.4": +"@babel/plugin-transform-object-assign@^7.0.0": version "7.24.1" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-assign/-/plugin-transform-object-assign-7.24.1.tgz#46a70169e56970aafd13a6ae677d5b497fc227e7" integrity sha512-I1kctor9iKtupb7jv7FyjApHCuKLBKCblVAeHVK9PB6FW7GI0ac6RtobC3MwwJy8CZ1JxuhQmnbrsqI5G8hAIg== @@ -2359,13 +2359,14 @@ resolved "https://registry.yarnpkg.com/@react-native/polyfills/-/polyfills-2.0.0.tgz#4c40b74655c83982c8cf47530ee7dc13d957b6aa" integrity sha512-K0aGNn1TjalKj+65D7ycc1//H9roAQ51GJVk5ZJQFb2teECGmzd86bYDC0aYdbRf7gtovescq4Zt6FR0tgXiHQ== -"@react-navigation/bottom-tabs@npm:@zulip/react-navigation-bottom-tabs@5.11.16-0.zulip.1": - version "5.11.16-0.zulip.1" - resolved "https://registry.yarnpkg.com/@zulip/react-navigation-bottom-tabs/-/react-navigation-bottom-tabs-5.11.16-0.zulip.1.tgz#658fe0e4c468f5ede0f4bb6f7412415397d9f94d" - integrity sha512-C0fWmWfDMda+q06WQWtEL3x9fib0KvOOGBOxPDPfzCKlLiiVeMUGwWKaoAsEPm/d+w7Ktg3kgs9LdgM1ugWlmg== +"@react-navigation/bottom-tabs@^6.5.20": + version "6.5.20" + resolved "https://registry.yarnpkg.com/@react-navigation/bottom-tabs/-/bottom-tabs-6.5.20.tgz#5335e75b02c527ef0569bd97d4f9185d65616e49" + integrity sha512-ow6Z06iS4VqBO8d7FP+HsGjJLWt2xTWIvuWjpoCvsM/uQXzCRDIjBv9HaKcXbF0yTW7IMir0oDAbU5PFzEDdgA== dependencies: - color "^3.1.3" - react-native-iphone-x-helper "^1.3.0" + "@react-navigation/elements" "^1.3.30" + color "^4.2.3" + warn-once "^0.1.0" "@react-navigation/core@^5.16.1": version "5.16.1" @@ -2378,12 +2379,18 @@ query-string "^6.13.6" react-is "^16.13.0" -"@react-navigation/material-top-tabs@^5.2.19": - version "5.3.19" - resolved "https://registry.yarnpkg.com/@react-navigation/material-top-tabs/-/material-top-tabs-5.3.19.tgz#64f3a933f5d7e86e99f3d57d9f0c1e833ffa7e4f" - integrity sha512-I7bEF99THxxcY7kCUZ5pPmwXr6kgo6L2sg3P1YJo+CcBWSGvGiHyNbZXNs15HuKRuFvEuueChNV9n8QuKBWbDA== +"@react-navigation/elements@^1.3.30": + version "1.3.30" + resolved "https://registry.yarnpkg.com/@react-navigation/elements/-/elements-1.3.30.tgz#a81371f599af1070b12014f05d6c09b1a611fd9a" + integrity sha512-plhc8UvCZs0UkV+sI+3bisIyn78wz9O/BiWZXpounu72k/R/Sj5PuZYFJ1fi6psvriUveMCGh4LeZckAZu2qiQ== + +"@react-navigation/material-top-tabs@^6.6.13": + version "6.6.13" + resolved "https://registry.yarnpkg.com/@react-navigation/material-top-tabs/-/material-top-tabs-6.6.13.tgz#d32a787d61ae7115797672cbaf477df149b7deba" + integrity sha512-utwS0SLl/dq6+PHWGOz4rNNkYzveqvbffXJ6TIrUdaWDDysjBa4btHUOVvXfNADIK4LafmbuRi0xA/zd6HoCPQ== dependencies: - color "^3.1.3" + color "^4.2.3" + warn-once "^0.1.0" "@react-navigation/native@^5.7.6": version "5.9.8" @@ -2834,10 +2841,10 @@ resolved "https://registry.yarnpkg.com/@types/q/-/q-1.5.8.tgz#95f6c6a08f2ad868ba230ead1d2d7f7be3db3837" integrity sha512-hroOstUScF6zhIi+5+x0dzqrHA1EJi+Irri6b1fxolMTqqHIV/Cg77EtnQcZqZCu8hR3mX2BzIxN4/GzI68Kfw== -"@types/react-native@~0.67.6": - version "0.67.26" - resolved "https://registry.yarnpkg.com/@types/react-native/-/react-native-0.67.26.tgz#68b873afe03695b7081b3ed102946b2e0cd0fc84" - integrity sha512-4UTZWwgJfHeBp0MqxmugfdA03mYrFRtZ8GXeV29ZyAlyNXpjs719WrrsGF7CcdacXDe+blG08wIEk0JxuZ+a5A== +"@types/react-native@^0.68.20": + version "0.68.20" + resolved "https://registry.yarnpkg.com/@types/react-native/-/react-native-0.68.20.tgz#333b0805953528242023162d7bbef0bf7413ff17" + integrity sha512-2eUTRheFyjL8vUdsOIX29POhkxfqzh1aj6TDhrF0QHZEQRwN74xNzUlcXA1cor/1MgS7Nz6gW/2Hj6jBHjAS9g== dependencies: "@types/react" "^17" @@ -4393,7 +4400,7 @@ color@^3.1.3: color-convert "^1.9.3" color-string "^1.6.0" -color@^4.0.1: +color@^4.0.1, color@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/color/-/color-4.2.3.tgz#d781ecb5e57224ee43ea9627560107c0e0c6463a" integrity sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A== @@ -9542,11 +9549,6 @@ mkdirp@^1.0.3, mkdirp@^1.0.4: resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== -mockdate@^3.0.2: - version "3.0.5" - resolved "https://registry.yarnpkg.com/mockdate/-/mockdate-3.0.5.tgz#789be686deb3149e7df2b663d2bc4392bc3284fb" - integrity sha512-iniQP4rj1FhBdBYS/+eQv7j1tadJ9lJtdzgOpvsOHng/GbcDh2Fhdeq+ZRldrPYdXvCyfFUmFeEwEGXZB5I/AQ== - ms@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" @@ -10783,22 +10785,17 @@ react-native-open-notification@^0.1.4: resolved "https://registry.yarnpkg.com/react-native-open-notification/-/react-native-open-notification-0.1.4.tgz#20b7c03a1543ce36f3f99ff9924c67eef2688aa9" integrity sha512-TPeFRsao6nDFW5nvBseD6nheRCN1U3poaY90iDzBY1MEEVepClqfEC9Iw0cqj7LYnpDSF8V25fb/SpjEg3HdQQ== +react-native-pager-view@^6.3.0: + version "6.3.0" + resolved "https://registry.yarnpkg.com/react-native-pager-view/-/react-native-pager-view-6.3.0.tgz#7e734e84b1692f877591335373f6fd92f0d67aa6" + integrity sha512-ufJOoVa9pFL1J/yb4hpsCqp8n1qTlcF5VvwqvCacHX//D7hSeRscsiIXg1u1pXNWwllvACb+mqxec/3Uj2mxrA== + react-native-photo-view@alwx/react-native-photo-view#91b873c85: version "1.5.3" resolved "https://codeload.github.com/alwx/react-native-photo-view/tar.gz/91b873c85c5c48af41b93cf6bf34e0a40502f754" dependencies: prop-types "^15.5.10" -"react-native-reanimated@^2.2.0 <2.3.0": - version "2.2.4" - resolved "https://registry.yarnpkg.com/react-native-reanimated/-/react-native-reanimated-2.2.4.tgz#36c5d15028b0bd7d479fba5199117ac870c7a532" - integrity sha512-Nn648MfEEnTCEiWsl1YmfkojiLyV0NMY0EiRdDRbZNfJVfxBuyqhCxI/4Jd7aBi162qpgf8XK2mByYgvF4zLrQ== - dependencies: - "@babel/plugin-transform-object-assign" "^7.10.4" - fbjs "^3.0.0" - mockdate "^3.0.2" - string-hash-64 "^1.0.3" - react-native-safe-area-context@^4.3.1: version "4.9.0" resolved "https://registry.yarnpkg.com/react-native-safe-area-context/-/react-native-safe-area-context-4.9.0.tgz#21a570ca3594cb4259ba65f93befaa60d91bcbd0" @@ -10817,10 +10814,12 @@ react-native-simple-toast@^1.1.4: resolved "https://registry.yarnpkg.com/react-native-simple-toast/-/react-native-simple-toast-1.1.4.tgz#6a962beea87b86228a4f8c51bc93761108740b1c" integrity sha512-7D8o8L445XDz7Rdh0pMgCIWuevv1FnGyuD7F8Nz/XhzMInmU4jL5VFJI25VVqQ2uGTaUSuo2ogXSgKnv6p9NJg== -react-native-tab-view@^2.15.2: - version "2.16.0" - resolved "https://registry.yarnpkg.com/react-native-tab-view/-/react-native-tab-view-2.16.0.tgz#cae72c7084394bd328fac5fefb86cd966df37a86" - integrity sha512-ac2DmT7+l13wzIFqtbfXn4wwfgtPoKzWjjZyrK1t+T8sdemuUvD4zIt+UImg03fu3s3VD8Wh/fBrIdcqQyZJWg== +react-native-tab-view@^3.5.2: + version "3.5.2" + resolved "https://registry.yarnpkg.com/react-native-tab-view/-/react-native-tab-view-3.5.2.tgz#2789b8af6148b16835869566bf13dc3b0e6c1b46" + integrity sha512-nE5WqjbeEPsWQx4mtz81QGVvgHRhujTNIIZiMCx3Bj6CBFDafbk7XZp9ocmtzXUQaZ4bhtVS43R4FIiR4LboJw== + dependencies: + use-latest-callback "^0.1.5" react-native-url-polyfill@^1.3.0: version "1.3.0" @@ -11957,11 +11956,6 @@ strict-uri-encode@^2.0.0: resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz#b9c7330c7042862f6b142dc274bbcc5866ce3546" integrity sha512-QwiXZgpRcKkhTj2Scnn++4PKtWsH0kpzZ62L2R6c/LUVYv7hVnZqcg2+sMuT6R7Jusu1vviK/MFsu6kNJfWlEQ== -string-hash-64@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/string-hash-64/-/string-hash-64-1.0.3.tgz#0deb56df58678640db5c479ccbbb597aaa0de322" - integrity sha512-D5OKWKvDhyVWWn2x5Y9b+37NUllks34q1dCDhk/vYcso9fmhs+Tl3KR/gE4v5UNj2UA35cnX4KdVVGkG1deKqw== - string-length@^4.0.1: version "4.0.2" resolved "https://registry.yarnpkg.com/string-length/-/string-length-4.0.2.tgz#a8a8dc7bd5c1a82b9b3c8b87e125f66871b6e57a" @@ -12936,6 +12930,11 @@ url-parse@^1.5.3, url-parse@^1.5.9: querystringify "^2.1.1" requires-port "^1.0.0" +use-latest-callback@^0.1.5: + version "0.1.9" + resolved "https://registry.yarnpkg.com/use-latest-callback/-/use-latest-callback-0.1.9.tgz#10191dc54257e65a8e52322127643a8940271e2a" + integrity sha512-CL/29uS74AwreI/f2oz2hLTW7ZqVeV5+gxFeGudzQrgkCytrHw33G4KbnQOrRlAEzzAFXi7dDLMC9zhWcVpzmw== + "use-subscription@>=1.0.0 <1.6.0": version "1.5.1" resolved "https://registry.yarnpkg.com/use-subscription/-/use-subscription-1.5.1.tgz#73501107f02fad84c6dd57965beb0b75c68c42d1"