diff --git a/native/chat/message-list-header-title.react.js b/native/chat/message-list-header-title.react.js --- a/native/chat/message-list-header-title.react.js +++ b/native/chat/message-list-header-title.react.js @@ -2,7 +2,7 @@ import { HeaderTitle, - type StackHeaderTitleInputProps, + type HeaderTitleInputProps, } from '@react-navigation/elements'; import * as React from 'react'; import { View, Platform } from 'react-native'; @@ -21,7 +21,7 @@ +navigate: $PropertyType, 'navigate'>, +isSearchEmpty: boolean, +areSettingsEnabled: boolean, - ...StackHeaderTitleInputProps, + ...HeaderTitleInputProps, }; type Props = { ...BaseProps, diff --git a/native/flow-typed/npm/@react-navigation/bottom-tabs_v6.x.x.js b/native/flow-typed/npm/@react-navigation/bottom-tabs_v6.x.x.js --- a/native/flow-typed/npm/@react-navigation/bottom-tabs_v6.x.x.js +++ b/native/flow-typed/npm/@react-navigation/bottom-tabs_v6.x.x.js @@ -1339,9 +1339,23 @@ +styleInterpolator: StackHeaderStyleInterpolator, |}; + declare export type BottomTabHeaderProps = {| + +navigation: BottomTabNavigationHelpers<>, + +route: RouteProp<>, + +options: BottomTabOptions, + +layout: {| +width: number, +height: number |}, + |}; + + declare export type DrawerHeaderProps = {| + +navigation: DrawerNavigationHelpers<>, + +route: RouteProp<>, + +options: DrawerOptions, + +layout: {| +width: number, +height: number |}, + |}; + declare export type StackHeaderLeftButtonProps = $Partial<{| +onPress: (() => void), - +pressColorAndroid: string; + +pressColor: string, +backImage: (props: {| tintColor: string |}) => React$Node, +tintColor: string, +label: string, @@ -1353,9 +1367,21 @@ +screenLayout: {| +width: number, +height: number |}, +titleLayout: {| +width: number, +height: number |}, +canGoBack: boolean, + +pressOpacity: number, + +disabled: boolean, + +accessibilityLabel: string, + +testID: string, + +style: ViewStyleProp, + |}>; + + declare export type HeaderLeftButtonProps = $Partial<{| + +tintColor: string, + +pressColor: string, + +pressOpacity: number, + +labelVisible: boolean, |}>; - declare type StackHeaderTitleInputBase = { + declare type HeaderTitleInputBase = { +onLayout: LayoutEvent => void, +children: string, +allowFontScaling: ?boolean, @@ -1364,8 +1390,32 @@ ... }; - declare export type StackHeaderTitleInputProps = - $Exact; + declare export type HeaderTitleInputProps = + $Exact; + + declare export type HeaderCommonOptions = $Partial<{| + +header: T => React$Node, + +headerShown: boolean, + + +headerTitle: string | ( HeaderTitleInputProps => React$Node), + +headerTitleAlign: 'left' | 'center', + +headerTitleStyle: AnimatedTextStyleProp, + +headerTitleContainerStyle: ViewStyleProp, + +headerTintColor: string, + +headerTitleAllowFontScaling: boolean, + +headerLeft: U => React$Node, + +headerLeftContainerStyle: ViewStyleProp, + +headerRight: {| tintColor?: string |} => React$Node, + +headerRightContainerStyle: ViewStyleProp, + +headerBackground: ({| style: ViewStyleProp |}) => React$Node, + +headerStyle: ViewStyleProp, + +headerTransparent: boolean, + +headerStatusBarHeight: number, + +headerShadowVisible: boolean, + +headerBackgroundContainerStyle: ViewStyleProp, + +headerPressColor: string, + +headerPressOpacity: number, + |}>; declare export type StackOptions = $Partial<{| +title: string, @@ -1384,30 +1434,18 @@ // Transition ...TransitionPreset, // Header - +header: StackHeaderProps => React$Node, - +headerShown: boolean, + ...HeaderCommonOptions< + StackHeaderProps, + StackHeaderLeftButtonProps, + >, +headerMode: 'float' | 'screen', - +headerTitle: string | (StackHeaderTitleInputProps => React$Node), - +headerTitleAlign: 'left' | 'center', - +headerTitleStyle: AnimatedTextStyleProp, - +headerTitleContainerStyle: ViewStyleProp, - +headerTintColor: string, - +headerTitleAllowFontScaling: boolean, +headerBackAllowFontScaling: boolean, +headerBackTitle: string | null, +headerBackTitleStyle: TextStyleProp, +headerBackTitleVisible: boolean, +headerTruncatedBackTitle: string, - +headerLeft: StackHeaderLeftButtonProps => React$Node, - +headerLeftContainerStyle: ViewStyleProp, - +headerRight: {| tintColor?: string |} => React$Node, - +headerRightContainerStyle: ViewStyleProp, +headerBackImage: $PropertyType, - +headerPressColorAndroid: string, - +headerBackground: ({| style: ViewStyleProp |}) => React$Node, - +headerStyle: ViewStyleProp, - +headerTransparent: boolean, - +headerStatusBarHeight: number, + +headerBackAccessibilityLabel: string, |}>; /** @@ -1553,8 +1591,11 @@ +tabBarLabelPosition: 'beside-icon' | 'below-icon', +tabBarStyle: ViewStyleProp, +unmountOnBlur: boolean, - +headerShown: boolean, +lazy: boolean, + ...HeaderCommonOptions< + BottomTabHeaderProps, + HeaderLeftButtonProps, + >, |}>; /** @@ -2002,7 +2043,10 @@ +swipeMinDistance: number, +keyboardDismissMode: 'on-drag' | 'none', +unmountOnBlur: boolean, - +headerShown: boolean, + ...HeaderCommonOptions< + DrawerHeaderProps, + HeaderLeftButtonProps, + >, |}>; /** diff --git a/native/flow-typed/npm/@react-navigation/devtools_v6.x.x.js b/native/flow-typed/npm/@react-navigation/devtools_v6.x.x.js --- a/native/flow-typed/npm/@react-navigation/devtools_v6.x.x.js +++ b/native/flow-typed/npm/@react-navigation/devtools_v6.x.x.js @@ -1339,9 +1339,23 @@ +styleInterpolator: StackHeaderStyleInterpolator, |}; + declare export type BottomTabHeaderProps = {| + +navigation: BottomTabNavigationHelpers<>, + +route: RouteProp<>, + +options: BottomTabOptions, + +layout: {| +width: number, +height: number |}, + |}; + + declare export type DrawerHeaderProps = {| + +navigation: DrawerNavigationHelpers<>, + +route: RouteProp<>, + +options: DrawerOptions, + +layout: {| +width: number, +height: number |}, + |}; + declare export type StackHeaderLeftButtonProps = $Partial<{| +onPress: (() => void), - +pressColorAndroid: string; + +pressColor: string, +backImage: (props: {| tintColor: string |}) => React$Node, +tintColor: string, +label: string, @@ -1353,9 +1367,21 @@ +screenLayout: {| +width: number, +height: number |}, +titleLayout: {| +width: number, +height: number |}, +canGoBack: boolean, + +pressOpacity: number, + +disabled: boolean, + +accessibilityLabel: string, + +testID: string, + +style: ViewStyleProp, + |}>; + + declare export type HeaderLeftButtonProps = $Partial<{| + +tintColor: string, + +pressColor: string, + +pressOpacity: number, + +labelVisible: boolean, |}>; - declare type StackHeaderTitleInputBase = { + declare type HeaderTitleInputBase = { +onLayout: LayoutEvent => void, +children: string, +allowFontScaling: ?boolean, @@ -1364,8 +1390,32 @@ ... }; - declare export type StackHeaderTitleInputProps = - $Exact; + declare export type HeaderTitleInputProps = + $Exact; + + declare export type HeaderCommonOptions = $Partial<{| + +header: T => React$Node, + +headerShown: boolean, + + +headerTitle: string | ( HeaderTitleInputProps => React$Node), + +headerTitleAlign: 'left' | 'center', + +headerTitleStyle: AnimatedTextStyleProp, + +headerTitleContainerStyle: ViewStyleProp, + +headerTintColor: string, + +headerTitleAllowFontScaling: boolean, + +headerLeft: U => React$Node, + +headerLeftContainerStyle: ViewStyleProp, + +headerRight: {| tintColor?: string |} => React$Node, + +headerRightContainerStyle: ViewStyleProp, + +headerBackground: ({| style: ViewStyleProp |}) => React$Node, + +headerStyle: ViewStyleProp, + +headerTransparent: boolean, + +headerStatusBarHeight: number, + +headerShadowVisible: boolean, + +headerBackgroundContainerStyle: ViewStyleProp, + +headerPressColor: string, + +headerPressOpacity: number, + |}>; declare export type StackOptions = $Partial<{| +title: string, @@ -1384,30 +1434,18 @@ // Transition ...TransitionPreset, // Header - +header: StackHeaderProps => React$Node, - +headerShown: boolean, + ...HeaderCommonOptions< + StackHeaderProps, + StackHeaderLeftButtonProps, + >, +headerMode: 'float' | 'screen', - +headerTitle: string | (StackHeaderTitleInputProps => React$Node), - +headerTitleAlign: 'left' | 'center', - +headerTitleStyle: AnimatedTextStyleProp, - +headerTitleContainerStyle: ViewStyleProp, - +headerTintColor: string, - +headerTitleAllowFontScaling: boolean, +headerBackAllowFontScaling: boolean, +headerBackTitle: string | null, +headerBackTitleStyle: TextStyleProp, +headerBackTitleVisible: boolean, +headerTruncatedBackTitle: string, - +headerLeft: StackHeaderLeftButtonProps => React$Node, - +headerLeftContainerStyle: ViewStyleProp, - +headerRight: {| tintColor?: string |} => React$Node, - +headerRightContainerStyle: ViewStyleProp, +headerBackImage: $PropertyType, - +headerPressColorAndroid: string, - +headerBackground: ({| style: ViewStyleProp |}) => React$Node, - +headerStyle: ViewStyleProp, - +headerTransparent: boolean, - +headerStatusBarHeight: number, + +headerBackAccessibilityLabel: string, |}>; /** @@ -1553,8 +1591,11 @@ +tabBarLabelPosition: 'beside-icon' | 'below-icon', +tabBarStyle: ViewStyleProp, +unmountOnBlur: boolean, - +headerShown: boolean, +lazy: boolean, + ...HeaderCommonOptions< + BottomTabHeaderProps, + HeaderLeftButtonProps, + >, |}>; /** @@ -2002,7 +2043,10 @@ +swipeMinDistance: number, +keyboardDismissMode: 'on-drag' | 'none', +unmountOnBlur: boolean, - +headerShown: boolean, + ...HeaderCommonOptions< + DrawerHeaderProps, + HeaderLeftButtonProps, + >, |}>; /** diff --git a/native/flow-typed/npm/@react-navigation/drawer_v6.x.x.js b/native/flow-typed/npm/@react-navigation/drawer_v6.x.x.js --- a/native/flow-typed/npm/@react-navigation/drawer_v6.x.x.js +++ b/native/flow-typed/npm/@react-navigation/drawer_v6.x.x.js @@ -1339,9 +1339,23 @@ +styleInterpolator: StackHeaderStyleInterpolator, |}; + declare export type BottomTabHeaderProps = {| + +navigation: BottomTabNavigationHelpers<>, + +route: RouteProp<>, + +options: BottomTabOptions, + +layout: {| +width: number, +height: number |}, + |}; + + declare export type DrawerHeaderProps = {| + +navigation: DrawerNavigationHelpers<>, + +route: RouteProp<>, + +options: DrawerOptions, + +layout: {| +width: number, +height: number |}, + |}; + declare export type StackHeaderLeftButtonProps = $Partial<{| +onPress: (() => void), - +pressColorAndroid: string; + +pressColor: string, +backImage: (props: {| tintColor: string |}) => React$Node, +tintColor: string, +label: string, @@ -1353,9 +1367,21 @@ +screenLayout: {| +width: number, +height: number |}, +titleLayout: {| +width: number, +height: number |}, +canGoBack: boolean, + +pressOpacity: number, + +disabled: boolean, + +accessibilityLabel: string, + +testID: string, + +style: ViewStyleProp, + |}>; + + declare export type HeaderLeftButtonProps = $Partial<{| + +tintColor: string, + +pressColor: string, + +pressOpacity: number, + +labelVisible: boolean, |}>; - declare type StackHeaderTitleInputBase = { + declare type HeaderTitleInputBase = { +onLayout: LayoutEvent => void, +children: string, +allowFontScaling: ?boolean, @@ -1364,8 +1390,32 @@ ... }; - declare export type StackHeaderTitleInputProps = - $Exact; + declare export type HeaderTitleInputProps = + $Exact; + + declare export type HeaderCommonOptions = $Partial<{| + +header: T => React$Node, + +headerShown: boolean, + + +headerTitle: string | ( HeaderTitleInputProps => React$Node), + +headerTitleAlign: 'left' | 'center', + +headerTitleStyle: AnimatedTextStyleProp, + +headerTitleContainerStyle: ViewStyleProp, + +headerTintColor: string, + +headerTitleAllowFontScaling: boolean, + +headerLeft: U => React$Node, + +headerLeftContainerStyle: ViewStyleProp, + +headerRight: {| tintColor?: string |} => React$Node, + +headerRightContainerStyle: ViewStyleProp, + +headerBackground: ({| style: ViewStyleProp |}) => React$Node, + +headerStyle: ViewStyleProp, + +headerTransparent: boolean, + +headerStatusBarHeight: number, + +headerShadowVisible: boolean, + +headerBackgroundContainerStyle: ViewStyleProp, + +headerPressColor: string, + +headerPressOpacity: number, + |}>; declare export type StackOptions = $Partial<{| +title: string, @@ -1384,30 +1434,18 @@ // Transition ...TransitionPreset, // Header - +header: StackHeaderProps => React$Node, - +headerShown: boolean, + ...HeaderCommonOptions< + StackHeaderProps, + StackHeaderLeftButtonProps, + >, +headerMode: 'float' | 'screen', - +headerTitle: string | (StackHeaderTitleInputProps => React$Node), - +headerTitleAlign: 'left' | 'center', - +headerTitleStyle: AnimatedTextStyleProp, - +headerTitleContainerStyle: ViewStyleProp, - +headerTintColor: string, - +headerTitleAllowFontScaling: boolean, +headerBackAllowFontScaling: boolean, +headerBackTitle: string | null, +headerBackTitleStyle: TextStyleProp, +headerBackTitleVisible: boolean, +headerTruncatedBackTitle: string, - +headerLeft: StackHeaderLeftButtonProps => React$Node, - +headerLeftContainerStyle: ViewStyleProp, - +headerRight: {| tintColor?: string |} => React$Node, - +headerRightContainerStyle: ViewStyleProp, +headerBackImage: $PropertyType, - +headerPressColorAndroid: string, - +headerBackground: ({| style: ViewStyleProp |}) => React$Node, - +headerStyle: ViewStyleProp, - +headerTransparent: boolean, - +headerStatusBarHeight: number, + +headerBackAccessibilityLabel: string, |}>; /** @@ -1553,8 +1591,11 @@ +tabBarLabelPosition: 'beside-icon' | 'below-icon', +tabBarStyle: ViewStyleProp, +unmountOnBlur: boolean, - +headerShown: boolean, +lazy: boolean, + ...HeaderCommonOptions< + BottomTabHeaderProps, + HeaderLeftButtonProps, + >, |}>; /** @@ -2002,7 +2043,10 @@ +swipeMinDistance: number, +keyboardDismissMode: 'on-drag' | 'none', +unmountOnBlur: boolean, - +headerShown: boolean, + ...HeaderCommonOptions< + DrawerHeaderProps, + HeaderLeftButtonProps, + >, |}>; /** diff --git a/native/flow-typed/npm/@react-navigation/elements_v1.x.x.js b/native/flow-typed/npm/@react-navigation/elements_v1.x.x.js --- a/native/flow-typed/npm/@react-navigation/elements_v1.x.x.js +++ b/native/flow-typed/npm/@react-navigation/elements_v1.x.x.js @@ -1336,9 +1336,23 @@ +styleInterpolator: StackHeaderStyleInterpolator, |}; + declare export type BottomTabHeaderProps = {| + +navigation: BottomTabNavigationHelpers<>, + +route: RouteProp<>, + +options: BottomTabOptions, + +layout: {| +width: number, +height: number |}, + |}; + + declare export type DrawerHeaderProps = {| + +navigation: DrawerNavigationHelpers<>, + +route: RouteProp<>, + +options: DrawerOptions, + +layout: {| +width: number, +height: number |}, + |}; + declare export type StackHeaderLeftButtonProps = $Partial<{| +onPress: (() => void), - +pressColorAndroid: string; + +pressColor: string, +backImage: (props: {| tintColor: string |}) => React$Node, +tintColor: string, +label: string, @@ -1350,9 +1364,21 @@ +screenLayout: {| +width: number, +height: number |}, +titleLayout: {| +width: number, +height: number |}, +canGoBack: boolean, + +pressOpacity: number, + +disabled: boolean, + +accessibilityLabel: string, + +testID: string, + +style: ViewStyleProp, |}>; - declare type StackHeaderTitleInputBase = { + declare export type HeaderLeftButtonProps = $Partial<{| + +tintColor: string, + +pressColor: string, + +pressOpacity: number, + +labelVisible: boolean, + |}>; + + declare type HeaderTitleInputBase = { +onLayout: LayoutEvent => void, +children: string, +allowFontScaling: ?boolean, @@ -1361,8 +1387,32 @@ ... }; - declare export type StackHeaderTitleInputProps = - $Exact; + declare export type HeaderTitleInputProps = + $Exact; + + declare export type HeaderCommonOptions = $Partial<{| + +header: T => React$Node, + +headerShown: boolean, + + +headerTitle: string | ( HeaderTitleInputProps => React$Node), + +headerTitleAlign: 'left' | 'center', + +headerTitleStyle: AnimatedTextStyleProp, + +headerTitleContainerStyle: ViewStyleProp, + +headerTintColor: string, + +headerTitleAllowFontScaling: boolean, + +headerLeft: U => React$Node, + +headerLeftContainerStyle: ViewStyleProp, + +headerRight: {| tintColor?: string |} => React$Node, + +headerRightContainerStyle: ViewStyleProp, + +headerBackground: ({| style: ViewStyleProp |}) => React$Node, + +headerStyle: ViewStyleProp, + +headerTransparent: boolean, + +headerStatusBarHeight: number, + +headerShadowVisible: boolean, + +headerBackgroundContainerStyle: ViewStyleProp, + +headerPressColor: string, + +headerPressOpacity: number, + |}>; declare export type StackOptions = $Partial<{| +title: string, @@ -1381,30 +1431,18 @@ // Transition ...TransitionPreset, // Header - +header: StackHeaderProps => React$Node, - +headerShown: boolean, + ...HeaderCommonOptions< + StackHeaderProps, + StackHeaderLeftButtonProps, + >, +headerMode: 'float' | 'screen', - +headerTitle: string | (StackHeaderTitleInputProps => React$Node), - +headerTitleAlign: 'left' | 'center', - +headerTitleStyle: AnimatedTextStyleProp, - +headerTitleContainerStyle: ViewStyleProp, - +headerTintColor: string, - +headerTitleAllowFontScaling: boolean, +headerBackAllowFontScaling: boolean, +headerBackTitle: string | null, +headerBackTitleStyle: TextStyleProp, +headerBackTitleVisible: boolean, +headerTruncatedBackTitle: string, - +headerLeft: StackHeaderLeftButtonProps => React$Node, - +headerLeftContainerStyle: ViewStyleProp, - +headerRight: {| tintColor?: string |} => React$Node, - +headerRightContainerStyle: ViewStyleProp, +headerBackImage: $PropertyType, - +headerPressColorAndroid: string, - +headerBackground: ({| style: ViewStyleProp |}) => React$Node, - +headerStyle: ViewStyleProp, - +headerTransparent: boolean, - +headerStatusBarHeight: number, + +headerBackAccessibilityLabel: string, |}>; /** @@ -1550,8 +1588,11 @@ +tabBarLabelPosition: 'beside-icon' | 'below-icon', +tabBarStyle: ViewStyleProp, +unmountOnBlur: boolean, - +headerShown: boolean, +lazy: boolean, + ...HeaderCommonOptions< + BottomTabHeaderProps, + HeaderLeftButtonProps, + >, |}>; /** @@ -1999,7 +2040,10 @@ +swipeMinDistance: number, +keyboardDismissMode: 'on-drag' | 'none', +unmountOnBlur: boolean, - +headerShown: boolean, + ...HeaderCommonOptions< + DrawerHeaderProps, + HeaderLeftButtonProps, + >, |}>; /** @@ -2217,7 +2261,7 @@ * Header components */ - declare export type StackHeaderTitleProps = $Partial; + declare export type StackHeaderTitleProps = $Partial; declare export var HeaderTitle: React$ComponentType; declare export type HeaderBackButtonProps = $Partial<{| diff --git a/native/flow-typed/npm/@react-navigation/material-top-tabs_v6.x.x.js b/native/flow-typed/npm/@react-navigation/material-top-tabs_v6.x.x.js --- a/native/flow-typed/npm/@react-navigation/material-top-tabs_v6.x.x.js +++ b/native/flow-typed/npm/@react-navigation/material-top-tabs_v6.x.x.js @@ -1339,9 +1339,23 @@ +styleInterpolator: StackHeaderStyleInterpolator, |}; + declare export type BottomTabHeaderProps = {| + +navigation: BottomTabNavigationHelpers<>, + +route: RouteProp<>, + +options: BottomTabOptions, + +layout: {| +width: number, +height: number |}, + |}; + + declare export type DrawerHeaderProps = {| + +navigation: DrawerNavigationHelpers<>, + +route: RouteProp<>, + +options: DrawerOptions, + +layout: {| +width: number, +height: number |}, + |}; + declare export type StackHeaderLeftButtonProps = $Partial<{| +onPress: (() => void), - +pressColorAndroid: string; + +pressColor: string, +backImage: (props: {| tintColor: string |}) => React$Node, +tintColor: string, +label: string, @@ -1353,9 +1367,21 @@ +screenLayout: {| +width: number, +height: number |}, +titleLayout: {| +width: number, +height: number |}, +canGoBack: boolean, + +pressOpacity: number, + +disabled: boolean, + +accessibilityLabel: string, + +testID: string, + +style: ViewStyleProp, + |}>; + + declare export type HeaderLeftButtonProps = $Partial<{| + +tintColor: string, + +pressColor: string, + +pressOpacity: number, + +labelVisible: boolean, |}>; - declare type StackHeaderTitleInputBase = { + declare type HeaderTitleInputBase = { +onLayout: LayoutEvent => void, +children: string, +allowFontScaling: ?boolean, @@ -1364,8 +1390,32 @@ ... }; - declare export type StackHeaderTitleInputProps = - $Exact; + declare export type HeaderTitleInputProps = + $Exact; + + declare export type HeaderCommonOptions = $Partial<{| + +header: T => React$Node, + +headerShown: boolean, + + +headerTitle: string | ( HeaderTitleInputProps => React$Node), + +headerTitleAlign: 'left' | 'center', + +headerTitleStyle: AnimatedTextStyleProp, + +headerTitleContainerStyle: ViewStyleProp, + +headerTintColor: string, + +headerTitleAllowFontScaling: boolean, + +headerLeft: U => React$Node, + +headerLeftContainerStyle: ViewStyleProp, + +headerRight: {| tintColor?: string |} => React$Node, + +headerRightContainerStyle: ViewStyleProp, + +headerBackground: ({| style: ViewStyleProp |}) => React$Node, + +headerStyle: ViewStyleProp, + +headerTransparent: boolean, + +headerStatusBarHeight: number, + +headerShadowVisible: boolean, + +headerBackgroundContainerStyle: ViewStyleProp, + +headerPressColor: string, + +headerPressOpacity: number, + |}>; declare export type StackOptions = $Partial<{| +title: string, @@ -1384,30 +1434,18 @@ // Transition ...TransitionPreset, // Header - +header: StackHeaderProps => React$Node, - +headerShown: boolean, + ...HeaderCommonOptions< + StackHeaderProps, + StackHeaderLeftButtonProps, + >, +headerMode: 'float' | 'screen', - +headerTitle: string | (StackHeaderTitleInputProps => React$Node), - +headerTitleAlign: 'left' | 'center', - +headerTitleStyle: AnimatedTextStyleProp, - +headerTitleContainerStyle: ViewStyleProp, - +headerTintColor: string, - +headerTitleAllowFontScaling: boolean, +headerBackAllowFontScaling: boolean, +headerBackTitle: string | null, +headerBackTitleStyle: TextStyleProp, +headerBackTitleVisible: boolean, +headerTruncatedBackTitle: string, - +headerLeft: StackHeaderLeftButtonProps => React$Node, - +headerLeftContainerStyle: ViewStyleProp, - +headerRight: {| tintColor?: string |} => React$Node, - +headerRightContainerStyle: ViewStyleProp, +headerBackImage: $PropertyType, - +headerPressColorAndroid: string, - +headerBackground: ({| style: ViewStyleProp |}) => React$Node, - +headerStyle: ViewStyleProp, - +headerTransparent: boolean, - +headerStatusBarHeight: number, + +headerBackAccessibilityLabel: string, |}>; /** @@ -1553,8 +1591,11 @@ +tabBarLabelPosition: 'beside-icon' | 'below-icon', +tabBarStyle: ViewStyleProp, +unmountOnBlur: boolean, - +headerShown: boolean, +lazy: boolean, + ...HeaderCommonOptions< + BottomTabHeaderProps, + HeaderLeftButtonProps, + >, |}>; /** @@ -2002,7 +2043,10 @@ +swipeMinDistance: number, +keyboardDismissMode: 'on-drag' | 'none', +unmountOnBlur: boolean, - +headerShown: boolean, + ...HeaderCommonOptions< + DrawerHeaderProps, + HeaderLeftButtonProps, + >, |}>; /** diff --git a/native/flow-typed/npm/@react-navigation/native_v6.x.x.js b/native/flow-typed/npm/@react-navigation/native_v6.x.x.js --- a/native/flow-typed/npm/@react-navigation/native_v6.x.x.js +++ b/native/flow-typed/npm/@react-navigation/native_v6.x.x.js @@ -1339,9 +1339,23 @@ +styleInterpolator: StackHeaderStyleInterpolator, |}; + declare export type BottomTabHeaderProps = {| + +navigation: BottomTabNavigationHelpers<>, + +route: RouteProp<>, + +options: BottomTabOptions, + +layout: {| +width: number, +height: number |}, + |}; + + declare export type DrawerHeaderProps = {| + +navigation: DrawerNavigationHelpers<>, + +route: RouteProp<>, + +options: DrawerOptions, + +layout: {| +width: number, +height: number |}, + |}; + declare export type StackHeaderLeftButtonProps = $Partial<{| +onPress: (() => void), - +pressColorAndroid: string; + +pressColor: string, +backImage: (props: {| tintColor: string |}) => React$Node, +tintColor: string, +label: string, @@ -1353,9 +1367,21 @@ +screenLayout: {| +width: number, +height: number |}, +titleLayout: {| +width: number, +height: number |}, +canGoBack: boolean, + +pressOpacity: number, + +disabled: boolean, + +accessibilityLabel: string, + +testID: string, + +style: ViewStyleProp, + |}>; + + declare export type HeaderLeftButtonProps = $Partial<{| + +tintColor: string, + +pressColor: string, + +pressOpacity: number, + +labelVisible: boolean, |}>; - declare type StackHeaderTitleInputBase = { + declare type HeaderTitleInputBase = { +onLayout: LayoutEvent => void, +children: string, +allowFontScaling: ?boolean, @@ -1364,8 +1390,32 @@ ... }; - declare export type StackHeaderTitleInputProps = - $Exact; + declare export type HeaderTitleInputProps = + $Exact; + + declare export type HeaderCommonOptions = $Partial<{| + +header: T => React$Node, + +headerShown: boolean, + + +headerTitle: string | ( HeaderTitleInputProps => React$Node), + +headerTitleAlign: 'left' | 'center', + +headerTitleStyle: AnimatedTextStyleProp, + +headerTitleContainerStyle: ViewStyleProp, + +headerTintColor: string, + +headerTitleAllowFontScaling: boolean, + +headerLeft: U => React$Node, + +headerLeftContainerStyle: ViewStyleProp, + +headerRight: {| tintColor?: string |} => React$Node, + +headerRightContainerStyle: ViewStyleProp, + +headerBackground: ({| style: ViewStyleProp |}) => React$Node, + +headerStyle: ViewStyleProp, + +headerTransparent: boolean, + +headerStatusBarHeight: number, + +headerShadowVisible: boolean, + +headerBackgroundContainerStyle: ViewStyleProp, + +headerPressColor: string, + +headerPressOpacity: number, + |}>; declare export type StackOptions = $Partial<{| +title: string, @@ -1384,30 +1434,18 @@ // Transition ...TransitionPreset, // Header - +header: StackHeaderProps => React$Node, - +headerShown: boolean, + ...HeaderCommonOptions< + StackHeaderProps, + StackHeaderLeftButtonProps, + >, +headerMode: 'float' | 'screen', - +headerTitle: string | (StackHeaderTitleInputProps => React$Node), - +headerTitleAlign: 'left' | 'center', - +headerTitleStyle: AnimatedTextStyleProp, - +headerTitleContainerStyle: ViewStyleProp, - +headerTintColor: string, - +headerTitleAllowFontScaling: boolean, +headerBackAllowFontScaling: boolean, +headerBackTitle: string | null, +headerBackTitleStyle: TextStyleProp, +headerBackTitleVisible: boolean, +headerTruncatedBackTitle: string, - +headerLeft: StackHeaderLeftButtonProps => React$Node, - +headerLeftContainerStyle: ViewStyleProp, - +headerRight: {| tintColor?: string |} => React$Node, - +headerRightContainerStyle: ViewStyleProp, +headerBackImage: $PropertyType, - +headerPressColorAndroid: string, - +headerBackground: ({| style: ViewStyleProp |}) => React$Node, - +headerStyle: ViewStyleProp, - +headerTransparent: boolean, - +headerStatusBarHeight: number, + +headerBackAccessibilityLabel: string, |}>; /** @@ -1553,8 +1591,11 @@ +tabBarLabelPosition: 'beside-icon' | 'below-icon', +tabBarStyle: ViewStyleProp, +unmountOnBlur: boolean, - +headerShown: boolean, +lazy: boolean, + ...HeaderCommonOptions< + BottomTabHeaderProps, + HeaderLeftButtonProps, + >, |}>; /** @@ -2002,7 +2043,10 @@ +swipeMinDistance: number, +keyboardDismissMode: 'on-drag' | 'none', +unmountOnBlur: boolean, - +headerShown: boolean, + ...HeaderCommonOptions< + DrawerHeaderProps, + HeaderLeftButtonProps, + >, |}>; /** diff --git a/native/flow-typed/npm/@react-navigation/stack_v6.x.x.js b/native/flow-typed/npm/@react-navigation/stack_v6.x.x.js --- a/native/flow-typed/npm/@react-navigation/stack_v6.x.x.js +++ b/native/flow-typed/npm/@react-navigation/stack_v6.x.x.js @@ -1339,9 +1339,23 @@ +styleInterpolator: StackHeaderStyleInterpolator, |}; + declare export type BottomTabHeaderProps = {| + +navigation: BottomTabNavigationHelpers<>, + +route: RouteProp<>, + +options: BottomTabOptions, + +layout: {| +width: number, +height: number |}, + |}; + + declare export type DrawerHeaderProps = {| + +navigation: DrawerNavigationHelpers<>, + +route: RouteProp<>, + +options: DrawerOptions, + +layout: {| +width: number, +height: number |}, + |}; + declare export type StackHeaderLeftButtonProps = $Partial<{| +onPress: (() => void), - +pressColorAndroid: string; + +pressColor: string, +backImage: (props: {| tintColor: string |}) => React$Node, +tintColor: string, +label: string, @@ -1353,9 +1367,21 @@ +screenLayout: {| +width: number, +height: number |}, +titleLayout: {| +width: number, +height: number |}, +canGoBack: boolean, + +pressOpacity: number, + +disabled: boolean, + +accessibilityLabel: string, + +testID: string, + +style: ViewStyleProp, + |}>; + + declare export type HeaderLeftButtonProps = $Partial<{| + +tintColor: string, + +pressColor: string, + +pressOpacity: number, + +labelVisible: boolean, |}>; - declare type StackHeaderTitleInputBase = { + declare type HeaderTitleInputBase = { +onLayout: LayoutEvent => void, +children: string, +allowFontScaling: ?boolean, @@ -1364,8 +1390,32 @@ ... }; - declare export type StackHeaderTitleInputProps = - $Exact; + declare export type HeaderTitleInputProps = + $Exact; + + declare export type HeaderCommonOptions = $Partial<{| + +header: T => React$Node, + +headerShown: boolean, + + +headerTitle: string | ( HeaderTitleInputProps => React$Node), + +headerTitleAlign: 'left' | 'center', + +headerTitleStyle: AnimatedTextStyleProp, + +headerTitleContainerStyle: ViewStyleProp, + +headerTintColor: string, + +headerTitleAllowFontScaling: boolean, + +headerLeft: U => React$Node, + +headerLeftContainerStyle: ViewStyleProp, + +headerRight: {| tintColor?: string |} => React$Node, + +headerRightContainerStyle: ViewStyleProp, + +headerBackground: ({| style: ViewStyleProp |}) => React$Node, + +headerStyle: ViewStyleProp, + +headerTransparent: boolean, + +headerStatusBarHeight: number, + +headerShadowVisible: boolean, + +headerBackgroundContainerStyle: ViewStyleProp, + +headerPressColor: string, + +headerPressOpacity: number, + |}>; declare export type StackOptions = $Partial<{| +title: string, @@ -1384,30 +1434,18 @@ // Transition ...TransitionPreset, // Header - +header: StackHeaderProps => React$Node, - +headerShown: boolean, + ...HeaderCommonOptions< + StackHeaderProps, + StackHeaderLeftButtonProps, + >, +headerMode: 'float' | 'screen', - +headerTitle: string | (StackHeaderTitleInputProps => React$Node), - +headerTitleAlign: 'left' | 'center', - +headerTitleStyle: AnimatedTextStyleProp, - +headerTitleContainerStyle: ViewStyleProp, - +headerTintColor: string, - +headerTitleAllowFontScaling: boolean, +headerBackAllowFontScaling: boolean, +headerBackTitle: string | null, +headerBackTitleStyle: TextStyleProp, +headerBackTitleVisible: boolean, +headerTruncatedBackTitle: string, - +headerLeft: StackHeaderLeftButtonProps => React$Node, - +headerLeftContainerStyle: ViewStyleProp, - +headerRight: {| tintColor?: string |} => React$Node, - +headerRightContainerStyle: ViewStyleProp, +headerBackImage: $PropertyType, - +headerPressColorAndroid: string, - +headerBackground: ({| style: ViewStyleProp |}) => React$Node, - +headerStyle: ViewStyleProp, - +headerTransparent: boolean, - +headerStatusBarHeight: number, + +headerBackAccessibilityLabel: string, |}>; /** @@ -1553,8 +1591,11 @@ +tabBarLabelPosition: 'beside-icon' | 'below-icon', +tabBarStyle: ViewStyleProp, +unmountOnBlur: boolean, - +headerShown: boolean, +lazy: boolean, + ...HeaderCommonOptions< + BottomTabHeaderProps, + HeaderLeftButtonProps, + >, |}>; /** @@ -2002,7 +2043,10 @@ +swipeMinDistance: number, +keyboardDismissMode: 'on-drag' | 'none', +unmountOnBlur: boolean, - +headerShown: boolean, + ...HeaderCommonOptions< + DrawerHeaderProps, + HeaderLeftButtonProps, + >, |}>; /**