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 @@ -1329,21 +1329,40 @@ |}, |}; - declare export type StackHeaderProps = {| - +navigation: StackNavigationHelpers<>, + declare export type HeaderProps = {| + +navigation: NavHelpers, +route: RouteProp<>, - +options: StackOptions, + +options: ScreenOptions, +layout: {| +width: number, +height: number |}, + |}; + + declare export type StackHeaderProps = {| + ...HeaderProps, StackOptions>, +progress: AnimatedInterpolation, +back?: {| +title: string |}, +styleInterpolator: StackHeaderStyleInterpolator, |}; + declare export type HeaderButtonProps = $Partial<{| + +tintColor: string, + +pressColor: string, + +pressOpacity: number, + |}>; + + declare export type HeaderLeftButtonProps = $Partial<{| + ...HeaderButtonProps, + +labelVisible: boolean, + |}>; + + declare export type StackHeaderButtonProps = $Partial<{| + ...HeaderButtonProps, + +canGoBack: boolean, + |}>; + declare export type StackHeaderLeftButtonProps = $Partial<{| + ...StackHeaderButtonProps, +onPress: (() => void), - +pressColorAndroid: string; +backImage: (props: {| tintColor: string |}) => React$Node, - +tintColor: string, +label: string, +truncatedLabel: string, +labelVisible: boolean, @@ -1352,10 +1371,12 @@ +onLabelLayout: LayoutEvent => void, +screenLayout: {| +width: number, +height: number |}, +titleLayout: {| +width: number, +height: number |}, - +canGoBack: boolean, + +disabled: boolean, + +accessibilityLabel: string, + +style: ViewStyleProp, |}>; - declare type StackHeaderTitleInputBase = { + declare type HeaderTitleInputBase = { +onLayout: LayoutEvent => void, +children: string, +allowFontScaling: ?boolean, @@ -1364,8 +1385,36 @@ ... }; - declare export type StackHeaderTitleInputProps = - $Exact; + declare export type HeaderTitleInputProps = + $Exact; + + declare export type HeaderCommonOptions< + NavHeaderProps, + NavHeaderLeftProps, + NavHeaderRightProps, + > = $Partial<{| + +header: NavHeaderProps => React$Node, + +headerShown: boolean, + + +headerTitle: string | ( HeaderTitleInputProps => React$Node), + +headerTitleAlign: 'left' | 'center', + +headerTitleStyle: AnimatedTextStyleProp, + +headerTitleContainerStyle: ViewStyleProp, + +headerTintColor: string, + +headerTitleAllowFontScaling: boolean, + +headerLeft: NavHeaderLeftProps => React$Node, + +headerLeftContainerStyle: ViewStyleProp, + +headerRight: NavHeaderRightProps => 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 +1433,19 @@ // Transition ...TransitionPreset, // Header - +header: StackHeaderProps => React$Node, - +headerShown: boolean, + ...HeaderCommonOptions< + StackHeaderProps, + StackHeaderLeftButtonProps, + StackHeaderButtonProps, + >, +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,12 @@ +tabBarLabelPosition: 'beside-icon' | 'below-icon', +tabBarStyle: ViewStyleProp, +unmountOnBlur: boolean, - +headerShown: boolean, +lazy: boolean, + ...HeaderCommonOptions< + HeaderProps, BottomTabOptions>, + HeaderLeftButtonProps, + HeaderButtonProps, + >, |}>; /** @@ -2002,7 +2044,11 @@ +swipeMinDistance: number, +keyboardDismissMode: 'on-drag' | 'none', +unmountOnBlur: boolean, - +headerShown: boolean, + ...HeaderCommonOptions< + HeaderProps, DrawerOptions>, + HeaderLeftButtonProps, + HeaderButtonProps, + >, |}>; /** 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 @@ -1329,21 +1329,40 @@ |}, |}; - declare export type StackHeaderProps = {| - +navigation: StackNavigationHelpers<>, + declare export type HeaderProps = {| + +navigation: NavHelpers, +route: RouteProp<>, - +options: StackOptions, + +options: ScreenOptions, +layout: {| +width: number, +height: number |}, + |}; + + declare export type StackHeaderProps = {| + ...HeaderProps, StackOptions>, +progress: AnimatedInterpolation, +back?: {| +title: string |}, +styleInterpolator: StackHeaderStyleInterpolator, |}; + declare export type HeaderButtonProps = $Partial<{| + +tintColor: string, + +pressColor: string, + +pressOpacity: number, + |}>; + + declare export type HeaderLeftButtonProps = $Partial<{| + ...HeaderButtonProps, + +labelVisible: boolean, + |}>; + + declare export type StackHeaderButtonProps = $Partial<{| + ...HeaderButtonProps, + +canGoBack: boolean, + |}>; + declare export type StackHeaderLeftButtonProps = $Partial<{| + ...StackHeaderButtonProps, +onPress: (() => void), - +pressColorAndroid: string; +backImage: (props: {| tintColor: string |}) => React$Node, - +tintColor: string, +label: string, +truncatedLabel: string, +labelVisible: boolean, @@ -1352,10 +1371,12 @@ +onLabelLayout: LayoutEvent => void, +screenLayout: {| +width: number, +height: number |}, +titleLayout: {| +width: number, +height: number |}, - +canGoBack: boolean, + +disabled: boolean, + +accessibilityLabel: string, + +style: ViewStyleProp, |}>; - declare type StackHeaderTitleInputBase = { + declare type HeaderTitleInputBase = { +onLayout: LayoutEvent => void, +children: string, +allowFontScaling: ?boolean, @@ -1364,8 +1385,36 @@ ... }; - declare export type StackHeaderTitleInputProps = - $Exact; + declare export type HeaderTitleInputProps = + $Exact; + + declare export type HeaderCommonOptions< + NavHeaderProps, + NavHeaderLeftProps, + NavHeaderRightProps, + > = $Partial<{| + +header: NavHeaderProps => React$Node, + +headerShown: boolean, + + +headerTitle: string | ( HeaderTitleInputProps => React$Node), + +headerTitleAlign: 'left' | 'center', + +headerTitleStyle: AnimatedTextStyleProp, + +headerTitleContainerStyle: ViewStyleProp, + +headerTintColor: string, + +headerTitleAllowFontScaling: boolean, + +headerLeft: NavHeaderLeftProps => React$Node, + +headerLeftContainerStyle: ViewStyleProp, + +headerRight: NavHeaderRightProps => 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 +1433,19 @@ // Transition ...TransitionPreset, // Header - +header: StackHeaderProps => React$Node, - +headerShown: boolean, + ...HeaderCommonOptions< + StackHeaderProps, + StackHeaderLeftButtonProps, + StackHeaderButtonProps, + >, +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,12 @@ +tabBarLabelPosition: 'beside-icon' | 'below-icon', +tabBarStyle: ViewStyleProp, +unmountOnBlur: boolean, - +headerShown: boolean, +lazy: boolean, + ...HeaderCommonOptions< + HeaderProps, BottomTabOptions>, + HeaderLeftButtonProps, + HeaderButtonProps, + >, |}>; /** @@ -2002,7 +2044,11 @@ +swipeMinDistance: number, +keyboardDismissMode: 'on-drag' | 'none', +unmountOnBlur: boolean, - +headerShown: boolean, + ...HeaderCommonOptions< + HeaderProps, DrawerOptions>, + HeaderLeftButtonProps, + HeaderButtonProps, + >, |}>; /** 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 @@ -1329,21 +1329,40 @@ |}, |}; - declare export type StackHeaderProps = {| - +navigation: StackNavigationHelpers<>, + declare export type HeaderProps = {| + +navigation: NavHelpers, +route: RouteProp<>, - +options: StackOptions, + +options: ScreenOptions, +layout: {| +width: number, +height: number |}, + |}; + + declare export type StackHeaderProps = {| + ...HeaderProps, StackOptions>, +progress: AnimatedInterpolation, +back?: {| +title: string |}, +styleInterpolator: StackHeaderStyleInterpolator, |}; + declare export type HeaderButtonProps = $Partial<{| + +tintColor: string, + +pressColor: string, + +pressOpacity: number, + |}>; + + declare export type HeaderLeftButtonProps = $Partial<{| + ...HeaderButtonProps, + +labelVisible: boolean, + |}>; + + declare export type StackHeaderButtonProps = $Partial<{| + ...HeaderButtonProps, + +canGoBack: boolean, + |}>; + declare export type StackHeaderLeftButtonProps = $Partial<{| + ...StackHeaderButtonProps, +onPress: (() => void), - +pressColorAndroid: string; +backImage: (props: {| tintColor: string |}) => React$Node, - +tintColor: string, +label: string, +truncatedLabel: string, +labelVisible: boolean, @@ -1352,10 +1371,12 @@ +onLabelLayout: LayoutEvent => void, +screenLayout: {| +width: number, +height: number |}, +titleLayout: {| +width: number, +height: number |}, - +canGoBack: boolean, + +disabled: boolean, + +accessibilityLabel: string, + +style: ViewStyleProp, |}>; - declare type StackHeaderTitleInputBase = { + declare type HeaderTitleInputBase = { +onLayout: LayoutEvent => void, +children: string, +allowFontScaling: ?boolean, @@ -1364,8 +1385,36 @@ ... }; - declare export type StackHeaderTitleInputProps = - $Exact; + declare export type HeaderTitleInputProps = + $Exact; + + declare export type HeaderCommonOptions< + NavHeaderProps, + NavHeaderLeftProps, + NavHeaderRightProps, + > = $Partial<{| + +header: NavHeaderProps => React$Node, + +headerShown: boolean, + + +headerTitle: string | ( HeaderTitleInputProps => React$Node), + +headerTitleAlign: 'left' | 'center', + +headerTitleStyle: AnimatedTextStyleProp, + +headerTitleContainerStyle: ViewStyleProp, + +headerTintColor: string, + +headerTitleAllowFontScaling: boolean, + +headerLeft: NavHeaderLeftProps => React$Node, + +headerLeftContainerStyle: ViewStyleProp, + +headerRight: NavHeaderRightProps => 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 +1433,19 @@ // Transition ...TransitionPreset, // Header - +header: StackHeaderProps => React$Node, - +headerShown: boolean, + ...HeaderCommonOptions< + StackHeaderProps, + StackHeaderLeftButtonProps, + StackHeaderButtonProps, + >, +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,12 @@ +tabBarLabelPosition: 'beside-icon' | 'below-icon', +tabBarStyle: ViewStyleProp, +unmountOnBlur: boolean, - +headerShown: boolean, +lazy: boolean, + ...HeaderCommonOptions< + HeaderProps, BottomTabOptions>, + HeaderLeftButtonProps, + HeaderButtonProps, + >, |}>; /** @@ -2002,7 +2044,11 @@ +swipeMinDistance: number, +keyboardDismissMode: 'on-drag' | 'none', +unmountOnBlur: boolean, - +headerShown: boolean, + ...HeaderCommonOptions< + HeaderProps, DrawerOptions>, + HeaderLeftButtonProps, + HeaderButtonProps, + >, |}>; /** 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 @@ -1326,21 +1326,40 @@ |}, |}; - declare export type StackHeaderProps = {| - +navigation: StackNavigationHelpers<>, + declare export type HeaderProps = {| + +navigation: NavHelpers, +route: RouteProp<>, - +options: StackOptions, + +options: ScreenOptions, +layout: {| +width: number, +height: number |}, + |}; + + declare export type StackHeaderProps = {| + ...HeaderProps, StackOptions>, +progress: AnimatedInterpolation, +back?: {| +title: string |}, +styleInterpolator: StackHeaderStyleInterpolator, |}; + declare export type HeaderButtonProps = $Partial<{| + +tintColor: string, + +pressColor: string, + +pressOpacity: number, + |}>; + + declare export type HeaderLeftButtonProps = $Partial<{| + ...HeaderButtonProps, + +labelVisible: boolean, + |}>; + + declare export type StackHeaderButtonProps = $Partial<{| + ...HeaderButtonProps, + +canGoBack: boolean, + |}>; + declare export type StackHeaderLeftButtonProps = $Partial<{| + ...StackHeaderButtonProps, +onPress: (() => void), - +pressColorAndroid: string; +backImage: (props: {| tintColor: string |}) => React$Node, - +tintColor: string, +label: string, +truncatedLabel: string, +labelVisible: boolean, @@ -1349,10 +1368,12 @@ +onLabelLayout: LayoutEvent => void, +screenLayout: {| +width: number, +height: number |}, +titleLayout: {| +width: number, +height: number |}, - +canGoBack: boolean, + +disabled: boolean, + +accessibilityLabel: string, + +style: ViewStyleProp, |}>; - declare type StackHeaderTitleInputBase = { + declare type HeaderTitleInputBase = { +onLayout: LayoutEvent => void, +children: string, +allowFontScaling: ?boolean, @@ -1361,8 +1382,36 @@ ... }; - declare export type StackHeaderTitleInputProps = - $Exact; + declare export type HeaderTitleInputProps = + $Exact; + + declare export type HeaderCommonOptions< + NavHeaderProps, + NavHeaderLeftProps, + NavHeaderRightProps, + > = $Partial<{| + +header: NavHeaderProps => React$Node, + +headerShown: boolean, + + +headerTitle: string | ( HeaderTitleInputProps => React$Node), + +headerTitleAlign: 'left' | 'center', + +headerTitleStyle: AnimatedTextStyleProp, + +headerTitleContainerStyle: ViewStyleProp, + +headerTintColor: string, + +headerTitleAllowFontScaling: boolean, + +headerLeft: NavHeaderLeftProps => React$Node, + +headerLeftContainerStyle: ViewStyleProp, + +headerRight: NavHeaderRightProps => 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 +1430,19 @@ // Transition ...TransitionPreset, // Header - +header: StackHeaderProps => React$Node, - +headerShown: boolean, + ...HeaderCommonOptions< + StackHeaderProps, + StackHeaderLeftButtonProps, + StackHeaderButtonProps, + >, +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,12 @@ +tabBarLabelPosition: 'beside-icon' | 'below-icon', +tabBarStyle: ViewStyleProp, +unmountOnBlur: boolean, - +headerShown: boolean, +lazy: boolean, + ...HeaderCommonOptions< + HeaderProps, BottomTabOptions>, + HeaderLeftButtonProps, + HeaderButtonProps, + >, |}>; /** @@ -1999,7 +2041,11 @@ +swipeMinDistance: number, +keyboardDismissMode: 'on-drag' | 'none', +unmountOnBlur: boolean, - +headerShown: boolean, + ...HeaderCommonOptions< + HeaderProps, DrawerOptions>, + HeaderLeftButtonProps, + HeaderButtonProps, + >, |}>; /** @@ -2217,7 +2263,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 @@ -1329,21 +1329,40 @@ |}, |}; - declare export type StackHeaderProps = {| - +navigation: StackNavigationHelpers<>, + declare export type HeaderProps = {| + +navigation: NavHelpers, +route: RouteProp<>, - +options: StackOptions, + +options: ScreenOptions, +layout: {| +width: number, +height: number |}, + |}; + + declare export type StackHeaderProps = {| + ...HeaderProps, StackOptions>, +progress: AnimatedInterpolation, +back?: {| +title: string |}, +styleInterpolator: StackHeaderStyleInterpolator, |}; + declare export type HeaderButtonProps = $Partial<{| + +tintColor: string, + +pressColor: string, + +pressOpacity: number, + |}>; + + declare export type HeaderLeftButtonProps = $Partial<{| + ...HeaderButtonProps, + +labelVisible: boolean, + |}>; + + declare export type StackHeaderButtonProps = $Partial<{| + ...HeaderButtonProps, + +canGoBack: boolean, + |}>; + declare export type StackHeaderLeftButtonProps = $Partial<{| + ...StackHeaderButtonProps, +onPress: (() => void), - +pressColorAndroid: string; +backImage: (props: {| tintColor: string |}) => React$Node, - +tintColor: string, +label: string, +truncatedLabel: string, +labelVisible: boolean, @@ -1352,10 +1371,12 @@ +onLabelLayout: LayoutEvent => void, +screenLayout: {| +width: number, +height: number |}, +titleLayout: {| +width: number, +height: number |}, - +canGoBack: boolean, + +disabled: boolean, + +accessibilityLabel: string, + +style: ViewStyleProp, |}>; - declare type StackHeaderTitleInputBase = { + declare type HeaderTitleInputBase = { +onLayout: LayoutEvent => void, +children: string, +allowFontScaling: ?boolean, @@ -1364,8 +1385,36 @@ ... }; - declare export type StackHeaderTitleInputProps = - $Exact; + declare export type HeaderTitleInputProps = + $Exact; + + declare export type HeaderCommonOptions< + NavHeaderProps, + NavHeaderLeftProps, + NavHeaderRightProps, + > = $Partial<{| + +header: NavHeaderProps => React$Node, + +headerShown: boolean, + + +headerTitle: string | ( HeaderTitleInputProps => React$Node), + +headerTitleAlign: 'left' | 'center', + +headerTitleStyle: AnimatedTextStyleProp, + +headerTitleContainerStyle: ViewStyleProp, + +headerTintColor: string, + +headerTitleAllowFontScaling: boolean, + +headerLeft: NavHeaderLeftProps => React$Node, + +headerLeftContainerStyle: ViewStyleProp, + +headerRight: NavHeaderRightProps => 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 +1433,19 @@ // Transition ...TransitionPreset, // Header - +header: StackHeaderProps => React$Node, - +headerShown: boolean, + ...HeaderCommonOptions< + StackHeaderProps, + StackHeaderLeftButtonProps, + StackHeaderButtonProps, + >, +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,12 @@ +tabBarLabelPosition: 'beside-icon' | 'below-icon', +tabBarStyle: ViewStyleProp, +unmountOnBlur: boolean, - +headerShown: boolean, +lazy: boolean, + ...HeaderCommonOptions< + HeaderProps, BottomTabOptions>, + HeaderLeftButtonProps, + HeaderButtonProps, + >, |}>; /** @@ -2002,7 +2044,11 @@ +swipeMinDistance: number, +keyboardDismissMode: 'on-drag' | 'none', +unmountOnBlur: boolean, - +headerShown: boolean, + ...HeaderCommonOptions< + HeaderProps, DrawerOptions>, + HeaderLeftButtonProps, + HeaderButtonProps, + >, |}>; /** 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 @@ -1329,21 +1329,40 @@ |}, |}; - declare export type StackHeaderProps = {| - +navigation: StackNavigationHelpers<>, + declare export type HeaderProps = {| + +navigation: NavHelpers, +route: RouteProp<>, - +options: StackOptions, + +options: ScreenOptions, +layout: {| +width: number, +height: number |}, + |}; + + declare export type StackHeaderProps = {| + ...HeaderProps, StackOptions>, +progress: AnimatedInterpolation, +back?: {| +title: string |}, +styleInterpolator: StackHeaderStyleInterpolator, |}; + declare export type HeaderButtonProps = $Partial<{| + +tintColor: string, + +pressColor: string, + +pressOpacity: number, + |}>; + + declare export type HeaderLeftButtonProps = $Partial<{| + ...HeaderButtonProps, + +labelVisible: boolean, + |}>; + + declare export type StackHeaderButtonProps = $Partial<{| + ...HeaderButtonProps, + +canGoBack: boolean, + |}>; + declare export type StackHeaderLeftButtonProps = $Partial<{| + ...StackHeaderButtonProps, +onPress: (() => void), - +pressColorAndroid: string; +backImage: (props: {| tintColor: string |}) => React$Node, - +tintColor: string, +label: string, +truncatedLabel: string, +labelVisible: boolean, @@ -1352,10 +1371,12 @@ +onLabelLayout: LayoutEvent => void, +screenLayout: {| +width: number, +height: number |}, +titleLayout: {| +width: number, +height: number |}, - +canGoBack: boolean, + +disabled: boolean, + +accessibilityLabel: string, + +style: ViewStyleProp, |}>; - declare type StackHeaderTitleInputBase = { + declare type HeaderTitleInputBase = { +onLayout: LayoutEvent => void, +children: string, +allowFontScaling: ?boolean, @@ -1364,8 +1385,36 @@ ... }; - declare export type StackHeaderTitleInputProps = - $Exact; + declare export type HeaderTitleInputProps = + $Exact; + + declare export type HeaderCommonOptions< + NavHeaderProps, + NavHeaderLeftProps, + NavHeaderRightProps, + > = $Partial<{| + +header: NavHeaderProps => React$Node, + +headerShown: boolean, + + +headerTitle: string | ( HeaderTitleInputProps => React$Node), + +headerTitleAlign: 'left' | 'center', + +headerTitleStyle: AnimatedTextStyleProp, + +headerTitleContainerStyle: ViewStyleProp, + +headerTintColor: string, + +headerTitleAllowFontScaling: boolean, + +headerLeft: NavHeaderLeftProps => React$Node, + +headerLeftContainerStyle: ViewStyleProp, + +headerRight: NavHeaderRightProps => 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 +1433,19 @@ // Transition ...TransitionPreset, // Header - +header: StackHeaderProps => React$Node, - +headerShown: boolean, + ...HeaderCommonOptions< + StackHeaderProps, + StackHeaderLeftButtonProps, + StackHeaderButtonProps, + >, +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,12 @@ +tabBarLabelPosition: 'beside-icon' | 'below-icon', +tabBarStyle: ViewStyleProp, +unmountOnBlur: boolean, - +headerShown: boolean, +lazy: boolean, + ...HeaderCommonOptions< + HeaderProps, BottomTabOptions>, + HeaderLeftButtonProps, + HeaderButtonProps, + >, |}>; /** @@ -2002,7 +2044,11 @@ +swipeMinDistance: number, +keyboardDismissMode: 'on-drag' | 'none', +unmountOnBlur: boolean, - +headerShown: boolean, + ...HeaderCommonOptions< + HeaderProps, DrawerOptions>, + HeaderLeftButtonProps, + HeaderButtonProps, + >, |}>; /** 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 @@ -1329,21 +1329,40 @@ |}, |}; - declare export type StackHeaderProps = {| - +navigation: StackNavigationHelpers<>, + declare export type HeaderProps = {| + +navigation: NavHelpers, +route: RouteProp<>, - +options: StackOptions, + +options: ScreenOptions, +layout: {| +width: number, +height: number |}, + |}; + + declare export type StackHeaderProps = {| + ...HeaderProps, StackOptions>, +progress: AnimatedInterpolation, +back?: {| +title: string |}, +styleInterpolator: StackHeaderStyleInterpolator, |}; + declare export type HeaderButtonProps = $Partial<{| + +tintColor: string, + +pressColor: string, + +pressOpacity: number, + |}>; + + declare export type HeaderLeftButtonProps = $Partial<{| + ...HeaderButtonProps, + +labelVisible: boolean, + |}>; + + declare export type StackHeaderButtonProps = $Partial<{| + ...HeaderButtonProps, + +canGoBack: boolean, + |}>; + declare export type StackHeaderLeftButtonProps = $Partial<{| + ...StackHeaderButtonProps, +onPress: (() => void), - +pressColorAndroid: string; +backImage: (props: {| tintColor: string |}) => React$Node, - +tintColor: string, +label: string, +truncatedLabel: string, +labelVisible: boolean, @@ -1352,10 +1371,12 @@ +onLabelLayout: LayoutEvent => void, +screenLayout: {| +width: number, +height: number |}, +titleLayout: {| +width: number, +height: number |}, - +canGoBack: boolean, + +disabled: boolean, + +accessibilityLabel: string, + +style: ViewStyleProp, |}>; - declare type StackHeaderTitleInputBase = { + declare type HeaderTitleInputBase = { +onLayout: LayoutEvent => void, +children: string, +allowFontScaling: ?boolean, @@ -1364,8 +1385,36 @@ ... }; - declare export type StackHeaderTitleInputProps = - $Exact; + declare export type HeaderTitleInputProps = + $Exact; + + declare export type HeaderCommonOptions< + NavHeaderProps, + NavHeaderLeftProps, + NavHeaderRightProps, + > = $Partial<{| + +header: NavHeaderProps => React$Node, + +headerShown: boolean, + + +headerTitle: string | ( HeaderTitleInputProps => React$Node), + +headerTitleAlign: 'left' | 'center', + +headerTitleStyle: AnimatedTextStyleProp, + +headerTitleContainerStyle: ViewStyleProp, + +headerTintColor: string, + +headerTitleAllowFontScaling: boolean, + +headerLeft: NavHeaderLeftProps => React$Node, + +headerLeftContainerStyle: ViewStyleProp, + +headerRight: NavHeaderRightProps => 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 +1433,19 @@ // Transition ...TransitionPreset, // Header - +header: StackHeaderProps => React$Node, - +headerShown: boolean, + ...HeaderCommonOptions< + StackHeaderProps, + StackHeaderLeftButtonProps, + StackHeaderButtonProps, + >, +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,12 @@ +tabBarLabelPosition: 'beside-icon' | 'below-icon', +tabBarStyle: ViewStyleProp, +unmountOnBlur: boolean, - +headerShown: boolean, +lazy: boolean, + ...HeaderCommonOptions< + HeaderProps, BottomTabOptions>, + HeaderLeftButtonProps, + HeaderButtonProps, + >, |}>; /** @@ -2002,7 +2044,11 @@ +swipeMinDistance: number, +keyboardDismissMode: 'on-drag' | 'none', +unmountOnBlur: boolean, - +headerShown: boolean, + ...HeaderCommonOptions< + HeaderProps, DrawerOptions>, + HeaderLeftButtonProps, + HeaderButtonProps, + >, |}>; /** @@ -2236,7 +2282,9 @@ * Header components */ - declare export var Header: React$ComponentType; + declare export var Header: React$ComponentType< + StackHeaderProps + >; /** * Style/animation options