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 @@ -3,7 +3,7 @@ import Icon from '@expo/vector-icons/Ionicons'; 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 @@ -1310,6 +1310,73 @@ +headerStyleInterpolator: StackHeaderStyleInterpolator, |}; + /** + * Header common options + */ + + declare export type SceneProgress = {| + +current: AnimatedInterpolation, + +next?: AnimatedInterpolation, + +previous?: AnimatedInterpolation, + |}; + + declare export type HeaderProps = {| + +navigation: NavProp, + +route: RouteProp<>, + +options: ScreenOptions, + +layout: {| +width: number, +height: number |}, + |}; + + declare export type HeaderButtonProps = $Partial<{| + +tintColor: string, + +pressColor: string, + +pressOpacity: number, + |}>; + + declare export type HeaderLeftButtonProps = $Partial<{| + ...HeaderButtonProps, + +labelVisible: boolean, + |}>; + + declare type HeaderTitleInputBase = { + +onLayout: LayoutEvent => void, + +children: string, + +allowFontScaling: ?boolean, + +tintColor: ?string, + +style: ?AnimatedTextStyleProp, + ... + }; + + 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: AnimatedViewStyleProp, + +headerTintColor: string, + +headerTitleAllowFontScaling: boolean, + +headerLeft: NavHeaderLeftProps => React$Node, + +headerLeftContainerStyle: AnimatedViewStyleProp, + +headerRight: NavHeaderRightProps => React$Node, + +headerRightContainerStyle: AnimatedViewStyleProp, + +headerBackground: ({| style: AnimatedViewStyleProp |}) => React$Node, + +headerStyle: AnimatedViewStyleProp, + +headerTransparent: boolean, + +headerStatusBarHeight: number, + +headerShadowVisible: boolean, + +headerBackgroundContainerStyle: AnimatedViewStyleProp, + +headerPressColor: string, + +headerPressOpacity: number, + |}>; + /** * Stack options */ @@ -1322,28 +1389,25 @@ declare type Scene = {| +route: T, +descriptor: StackDescriptor, - +progress: {| - +current: AnimatedInterpolation, - +next?: AnimatedInterpolation, - +previous?: AnimatedInterpolation, - |}, + +progress: SceneProgress, |}; declare export type StackHeaderProps = {| - +navigation: StackNavigationHelpers<>, - +route: RouteProp<>, - +options: StackOptions, - +layout: {| +width: number, +height: number |}, - +progress: AnimatedInterpolation, + ...HeaderProps, StackOptions>, + +progress: SceneProgress, +back?: {| +title: string |}, +styleInterpolator: StackHeaderStyleInterpolator, |}; + 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,21 +1416,11 @@ +onLabelLayout: LayoutEvent => void, +screenLayout: {| +width: number, +height: number |}, +titleLayout: {| +width: number, +height: number |}, - +canGoBack: boolean, + +disabled: boolean, + +accessibilityLabel: string, + +style: ViewStyleProp, |}>; - declare type StackHeaderTitleInputBase = { - +onLayout: LayoutEvent => void, - +children: string, - +allowFontScaling: ?boolean, - +tintColor: ?string, - +style: ?AnimatedTextStyleProp, - ... - }; - - declare export type StackHeaderTitleInputProps = - $Exact; - declare export type StackOptions = $Partial<{| +title: string, +cardShadowEnabled: boolean, @@ -1384,30 +1438,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 +1596,12 @@ +tabBarLabelPosition: 'beside-icon' | 'below-icon', +tabBarStyle: ViewStyleProp, +unmountOnBlur: boolean, - +headerShown: boolean, +lazy: boolean, + ...HeaderCommonOptions< + HeaderProps, BottomTabOptions>, + HeaderLeftButtonProps, + HeaderButtonProps, + >, |}>; /** @@ -2002,7 +2049,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 @@ -1310,6 +1310,73 @@ +headerStyleInterpolator: StackHeaderStyleInterpolator, |}; + /** + * Header common options + */ + + declare export type SceneProgress = {| + +current: AnimatedInterpolation, + +next?: AnimatedInterpolation, + +previous?: AnimatedInterpolation, + |}; + + declare export type HeaderProps = {| + +navigation: NavProp, + +route: RouteProp<>, + +options: ScreenOptions, + +layout: {| +width: number, +height: number |}, + |}; + + declare export type HeaderButtonProps = $Partial<{| + +tintColor: string, + +pressColor: string, + +pressOpacity: number, + |}>; + + declare export type HeaderLeftButtonProps = $Partial<{| + ...HeaderButtonProps, + +labelVisible: boolean, + |}>; + + declare type HeaderTitleInputBase = { + +onLayout: LayoutEvent => void, + +children: string, + +allowFontScaling: ?boolean, + +tintColor: ?string, + +style: ?AnimatedTextStyleProp, + ... + }; + + 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: AnimatedViewStyleProp, + +headerTintColor: string, + +headerTitleAllowFontScaling: boolean, + +headerLeft: NavHeaderLeftProps => React$Node, + +headerLeftContainerStyle: AnimatedViewStyleProp, + +headerRight: NavHeaderRightProps => React$Node, + +headerRightContainerStyle: AnimatedViewStyleProp, + +headerBackground: ({| style: AnimatedViewStyleProp |}) => React$Node, + +headerStyle: AnimatedViewStyleProp, + +headerTransparent: boolean, + +headerStatusBarHeight: number, + +headerShadowVisible: boolean, + +headerBackgroundContainerStyle: AnimatedViewStyleProp, + +headerPressColor: string, + +headerPressOpacity: number, + |}>; + /** * Stack options */ @@ -1322,28 +1389,25 @@ declare type Scene = {| +route: T, +descriptor: StackDescriptor, - +progress: {| - +current: AnimatedInterpolation, - +next?: AnimatedInterpolation, - +previous?: AnimatedInterpolation, - |}, + +progress: SceneProgress, |}; declare export type StackHeaderProps = {| - +navigation: StackNavigationHelpers<>, - +route: RouteProp<>, - +options: StackOptions, - +layout: {| +width: number, +height: number |}, - +progress: AnimatedInterpolation, + ...HeaderProps, StackOptions>, + +progress: SceneProgress, +back?: {| +title: string |}, +styleInterpolator: StackHeaderStyleInterpolator, |}; + 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,21 +1416,11 @@ +onLabelLayout: LayoutEvent => void, +screenLayout: {| +width: number, +height: number |}, +titleLayout: {| +width: number, +height: number |}, - +canGoBack: boolean, + +disabled: boolean, + +accessibilityLabel: string, + +style: ViewStyleProp, |}>; - declare type StackHeaderTitleInputBase = { - +onLayout: LayoutEvent => void, - +children: string, - +allowFontScaling: ?boolean, - +tintColor: ?string, - +style: ?AnimatedTextStyleProp, - ... - }; - - declare export type StackHeaderTitleInputProps = - $Exact; - declare export type StackOptions = $Partial<{| +title: string, +cardShadowEnabled: boolean, @@ -1384,30 +1438,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 +1596,12 @@ +tabBarLabelPosition: 'beside-icon' | 'below-icon', +tabBarStyle: ViewStyleProp, +unmountOnBlur: boolean, - +headerShown: boolean, +lazy: boolean, + ...HeaderCommonOptions< + HeaderProps, BottomTabOptions>, + HeaderLeftButtonProps, + HeaderButtonProps, + >, |}>; /** @@ -2002,7 +2049,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 @@ -1310,6 +1310,73 @@ +headerStyleInterpolator: StackHeaderStyleInterpolator, |}; + /** + * Header common options + */ + + declare export type SceneProgress = {| + +current: AnimatedInterpolation, + +next?: AnimatedInterpolation, + +previous?: AnimatedInterpolation, + |}; + + declare export type HeaderProps = {| + +navigation: NavProp, + +route: RouteProp<>, + +options: ScreenOptions, + +layout: {| +width: number, +height: number |}, + |}; + + declare export type HeaderButtonProps = $Partial<{| + +tintColor: string, + +pressColor: string, + +pressOpacity: number, + |}>; + + declare export type HeaderLeftButtonProps = $Partial<{| + ...HeaderButtonProps, + +labelVisible: boolean, + |}>; + + declare type HeaderTitleInputBase = { + +onLayout: LayoutEvent => void, + +children: string, + +allowFontScaling: ?boolean, + +tintColor: ?string, + +style: ?AnimatedTextStyleProp, + ... + }; + + 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: AnimatedViewStyleProp, + +headerTintColor: string, + +headerTitleAllowFontScaling: boolean, + +headerLeft: NavHeaderLeftProps => React$Node, + +headerLeftContainerStyle: AnimatedViewStyleProp, + +headerRight: NavHeaderRightProps => React$Node, + +headerRightContainerStyle: AnimatedViewStyleProp, + +headerBackground: ({| style: AnimatedViewStyleProp |}) => React$Node, + +headerStyle: AnimatedViewStyleProp, + +headerTransparent: boolean, + +headerStatusBarHeight: number, + +headerShadowVisible: boolean, + +headerBackgroundContainerStyle: AnimatedViewStyleProp, + +headerPressColor: string, + +headerPressOpacity: number, + |}>; + /** * Stack options */ @@ -1322,28 +1389,25 @@ declare type Scene = {| +route: T, +descriptor: StackDescriptor, - +progress: {| - +current: AnimatedInterpolation, - +next?: AnimatedInterpolation, - +previous?: AnimatedInterpolation, - |}, + +progress: SceneProgress, |}; declare export type StackHeaderProps = {| - +navigation: StackNavigationHelpers<>, - +route: RouteProp<>, - +options: StackOptions, - +layout: {| +width: number, +height: number |}, - +progress: AnimatedInterpolation, + ...HeaderProps, StackOptions>, + +progress: SceneProgress, +back?: {| +title: string |}, +styleInterpolator: StackHeaderStyleInterpolator, |}; + 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,21 +1416,11 @@ +onLabelLayout: LayoutEvent => void, +screenLayout: {| +width: number, +height: number |}, +titleLayout: {| +width: number, +height: number |}, - +canGoBack: boolean, + +disabled: boolean, + +accessibilityLabel: string, + +style: ViewStyleProp, |}>; - declare type StackHeaderTitleInputBase = { - +onLayout: LayoutEvent => void, - +children: string, - +allowFontScaling: ?boolean, - +tintColor: ?string, - +style: ?AnimatedTextStyleProp, - ... - }; - - declare export type StackHeaderTitleInputProps = - $Exact; - declare export type StackOptions = $Partial<{| +title: string, +cardShadowEnabled: boolean, @@ -1384,30 +1438,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 +1596,12 @@ +tabBarLabelPosition: 'beside-icon' | 'below-icon', +tabBarStyle: ViewStyleProp, +unmountOnBlur: boolean, - +headerShown: boolean, +lazy: boolean, + ...HeaderCommonOptions< + HeaderProps, BottomTabOptions>, + HeaderLeftButtonProps, + HeaderButtonProps, + >, |}>; /** @@ -2002,7 +2049,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 @@ -1307,6 +1307,73 @@ +headerStyleInterpolator: StackHeaderStyleInterpolator, |}; + /** + * Header common options + */ + + declare export type SceneProgress = {| + +current: AnimatedInterpolation, + +next?: AnimatedInterpolation, + +previous?: AnimatedInterpolation, + |}; + + declare export type HeaderProps = {| + +navigation: NavProp, + +route: RouteProp<>, + +options: ScreenOptions, + +layout: {| +width: number, +height: number |}, + |}; + + declare export type HeaderButtonProps = $Partial<{| + +tintColor: string, + +pressColor: string, + +pressOpacity: number, + |}>; + + declare export type HeaderLeftButtonProps = $Partial<{| + ...HeaderButtonProps, + +labelVisible: boolean, + |}>; + + declare type HeaderTitleInputBase = { + +onLayout: LayoutEvent => void, + +children: string, + +allowFontScaling: ?boolean, + +tintColor: ?string, + +style: ?AnimatedTextStyleProp, + ... + }; + + 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: AnimatedViewStyleProp, + +headerTintColor: string, + +headerTitleAllowFontScaling: boolean, + +headerLeft: NavHeaderLeftProps => React$Node, + +headerLeftContainerStyle: AnimatedViewStyleProp, + +headerRight: NavHeaderRightProps => React$Node, + +headerRightContainerStyle: AnimatedViewStyleProp, + +headerBackground: ({| style: AnimatedViewStyleProp |}) => React$Node, + +headerStyle: AnimatedViewStyleProp, + +headerTransparent: boolean, + +headerStatusBarHeight: number, + +headerShadowVisible: boolean, + +headerBackgroundContainerStyle: AnimatedViewStyleProp, + +headerPressColor: string, + +headerPressOpacity: number, + |}>; + /** * Stack options */ @@ -1319,28 +1386,25 @@ declare type Scene = {| +route: T, +descriptor: StackDescriptor, - +progress: {| - +current: AnimatedInterpolation, - +next?: AnimatedInterpolation, - +previous?: AnimatedInterpolation, - |}, + +progress: SceneProgress, |}; declare export type StackHeaderProps = {| - +navigation: StackNavigationHelpers<>, - +route: RouteProp<>, - +options: StackOptions, - +layout: {| +width: number, +height: number |}, - +progress: AnimatedInterpolation, + ...HeaderProps, StackOptions>, + +progress: SceneProgress, +back?: {| +title: string |}, +styleInterpolator: StackHeaderStyleInterpolator, |}; + 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,21 +1413,11 @@ +onLabelLayout: LayoutEvent => void, +screenLayout: {| +width: number, +height: number |}, +titleLayout: {| +width: number, +height: number |}, - +canGoBack: boolean, + +disabled: boolean, + +accessibilityLabel: string, + +style: ViewStyleProp, |}>; - declare type StackHeaderTitleInputBase = { - +onLayout: LayoutEvent => void, - +children: string, - +allowFontScaling: ?boolean, - +tintColor: ?string, - +style: ?AnimatedTextStyleProp, - ... - }; - - declare export type StackHeaderTitleInputProps = - $Exact; - declare export type StackOptions = $Partial<{| +title: string, +cardShadowEnabled: boolean, @@ -1381,30 +1435,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 +1593,12 @@ +tabBarLabelPosition: 'beside-icon' | 'below-icon', +tabBarStyle: ViewStyleProp, +unmountOnBlur: boolean, - +headerShown: boolean, +lazy: boolean, + ...HeaderCommonOptions< + HeaderProps, BottomTabOptions>, + HeaderLeftButtonProps, + HeaderButtonProps, + >, |}>; /** @@ -1999,7 +2046,11 @@ +swipeMinDistance: number, +keyboardDismissMode: 'on-drag' | 'none', +unmountOnBlur: boolean, - +headerShown: boolean, + ...HeaderCommonOptions< + HeaderProps, DrawerOptions>, + HeaderLeftButtonProps, + HeaderButtonProps, + >, |}>; /** @@ -2217,7 +2268,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 @@ -1310,6 +1310,73 @@ +headerStyleInterpolator: StackHeaderStyleInterpolator, |}; + /** + * Header common options + */ + + declare export type SceneProgress = {| + +current: AnimatedInterpolation, + +next?: AnimatedInterpolation, + +previous?: AnimatedInterpolation, + |}; + + declare export type HeaderProps = {| + +navigation: NavProp, + +route: RouteProp<>, + +options: ScreenOptions, + +layout: {| +width: number, +height: number |}, + |}; + + declare export type HeaderButtonProps = $Partial<{| + +tintColor: string, + +pressColor: string, + +pressOpacity: number, + |}>; + + declare export type HeaderLeftButtonProps = $Partial<{| + ...HeaderButtonProps, + +labelVisible: boolean, + |}>; + + declare type HeaderTitleInputBase = { + +onLayout: LayoutEvent => void, + +children: string, + +allowFontScaling: ?boolean, + +tintColor: ?string, + +style: ?AnimatedTextStyleProp, + ... + }; + + 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: AnimatedViewStyleProp, + +headerTintColor: string, + +headerTitleAllowFontScaling: boolean, + +headerLeft: NavHeaderLeftProps => React$Node, + +headerLeftContainerStyle: AnimatedViewStyleProp, + +headerRight: NavHeaderRightProps => React$Node, + +headerRightContainerStyle: AnimatedViewStyleProp, + +headerBackground: ({| style: AnimatedViewStyleProp |}) => React$Node, + +headerStyle: AnimatedViewStyleProp, + +headerTransparent: boolean, + +headerStatusBarHeight: number, + +headerShadowVisible: boolean, + +headerBackgroundContainerStyle: AnimatedViewStyleProp, + +headerPressColor: string, + +headerPressOpacity: number, + |}>; + /** * Stack options */ @@ -1322,28 +1389,25 @@ declare type Scene = {| +route: T, +descriptor: StackDescriptor, - +progress: {| - +current: AnimatedInterpolation, - +next?: AnimatedInterpolation, - +previous?: AnimatedInterpolation, - |}, + +progress: SceneProgress, |}; declare export type StackHeaderProps = {| - +navigation: StackNavigationHelpers<>, - +route: RouteProp<>, - +options: StackOptions, - +layout: {| +width: number, +height: number |}, - +progress: AnimatedInterpolation, + ...HeaderProps, StackOptions>, + +progress: SceneProgress, +back?: {| +title: string |}, +styleInterpolator: StackHeaderStyleInterpolator, |}; + 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,21 +1416,11 @@ +onLabelLayout: LayoutEvent => void, +screenLayout: {| +width: number, +height: number |}, +titleLayout: {| +width: number, +height: number |}, - +canGoBack: boolean, + +disabled: boolean, + +accessibilityLabel: string, + +style: ViewStyleProp, |}>; - declare type StackHeaderTitleInputBase = { - +onLayout: LayoutEvent => void, - +children: string, - +allowFontScaling: ?boolean, - +tintColor: ?string, - +style: ?AnimatedTextStyleProp, - ... - }; - - declare export type StackHeaderTitleInputProps = - $Exact; - declare export type StackOptions = $Partial<{| +title: string, +cardShadowEnabled: boolean, @@ -1384,30 +1438,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 +1596,12 @@ +tabBarLabelPosition: 'beside-icon' | 'below-icon', +tabBarStyle: ViewStyleProp, +unmountOnBlur: boolean, - +headerShown: boolean, +lazy: boolean, + ...HeaderCommonOptions< + HeaderProps, BottomTabOptions>, + HeaderLeftButtonProps, + HeaderButtonProps, + >, |}>; /** @@ -2002,7 +2049,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 @@ -1310,6 +1310,73 @@ +headerStyleInterpolator: StackHeaderStyleInterpolator, |}; + /** + * Header common options + */ + + declare export type SceneProgress = {| + +current: AnimatedInterpolation, + +next?: AnimatedInterpolation, + +previous?: AnimatedInterpolation, + |}; + + declare export type HeaderProps = {| + +navigation: NavProp, + +route: RouteProp<>, + +options: ScreenOptions, + +layout: {| +width: number, +height: number |}, + |}; + + declare export type HeaderButtonProps = $Partial<{| + +tintColor: string, + +pressColor: string, + +pressOpacity: number, + |}>; + + declare export type HeaderLeftButtonProps = $Partial<{| + ...HeaderButtonProps, + +labelVisible: boolean, + |}>; + + declare type HeaderTitleInputBase = { + +onLayout: LayoutEvent => void, + +children: string, + +allowFontScaling: ?boolean, + +tintColor: ?string, + +style: ?AnimatedTextStyleProp, + ... + }; + + 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: AnimatedViewStyleProp, + +headerTintColor: string, + +headerTitleAllowFontScaling: boolean, + +headerLeft: NavHeaderLeftProps => React$Node, + +headerLeftContainerStyle: AnimatedViewStyleProp, + +headerRight: NavHeaderRightProps => React$Node, + +headerRightContainerStyle: AnimatedViewStyleProp, + +headerBackground: ({| style: AnimatedViewStyleProp |}) => React$Node, + +headerStyle: AnimatedViewStyleProp, + +headerTransparent: boolean, + +headerStatusBarHeight: number, + +headerShadowVisible: boolean, + +headerBackgroundContainerStyle: AnimatedViewStyleProp, + +headerPressColor: string, + +headerPressOpacity: number, + |}>; + /** * Stack options */ @@ -1322,28 +1389,25 @@ declare type Scene = {| +route: T, +descriptor: StackDescriptor, - +progress: {| - +current: AnimatedInterpolation, - +next?: AnimatedInterpolation, - +previous?: AnimatedInterpolation, - |}, + +progress: SceneProgress, |}; declare export type StackHeaderProps = {| - +navigation: StackNavigationHelpers<>, - +route: RouteProp<>, - +options: StackOptions, - +layout: {| +width: number, +height: number |}, - +progress: AnimatedInterpolation, + ...HeaderProps, StackOptions>, + +progress: SceneProgress, +back?: {| +title: string |}, +styleInterpolator: StackHeaderStyleInterpolator, |}; + 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,21 +1416,11 @@ +onLabelLayout: LayoutEvent => void, +screenLayout: {| +width: number, +height: number |}, +titleLayout: {| +width: number, +height: number |}, - +canGoBack: boolean, + +disabled: boolean, + +accessibilityLabel: string, + +style: ViewStyleProp, |}>; - declare type StackHeaderTitleInputBase = { - +onLayout: LayoutEvent => void, - +children: string, - +allowFontScaling: ?boolean, - +tintColor: ?string, - +style: ?AnimatedTextStyleProp, - ... - }; - - declare export type StackHeaderTitleInputProps = - $Exact; - declare export type StackOptions = $Partial<{| +title: string, +cardShadowEnabled: boolean, @@ -1384,30 +1438,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 +1596,12 @@ +tabBarLabelPosition: 'beside-icon' | 'below-icon', +tabBarStyle: ViewStyleProp, +unmountOnBlur: boolean, - +headerShown: boolean, +lazy: boolean, + ...HeaderCommonOptions< + HeaderProps, BottomTabOptions>, + HeaderLeftButtonProps, + HeaderButtonProps, + >, |}>; /** @@ -2002,7 +2049,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 @@ -1310,6 +1310,73 @@ +headerStyleInterpolator: StackHeaderStyleInterpolator, |}; + /** + * Header common options + */ + + declare export type SceneProgress = {| + +current: AnimatedInterpolation, + +next?: AnimatedInterpolation, + +previous?: AnimatedInterpolation, + |}; + + declare export type HeaderProps = {| + +navigation: NavProp, + +route: RouteProp<>, + +options: ScreenOptions, + +layout: {| +width: number, +height: number |}, + |}; + + declare export type HeaderButtonProps = $Partial<{| + +tintColor: string, + +pressColor: string, + +pressOpacity: number, + |}>; + + declare export type HeaderLeftButtonProps = $Partial<{| + ...HeaderButtonProps, + +labelVisible: boolean, + |}>; + + declare type HeaderTitleInputBase = { + +onLayout: LayoutEvent => void, + +children: string, + +allowFontScaling: ?boolean, + +tintColor: ?string, + +style: ?AnimatedTextStyleProp, + ... + }; + + 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: AnimatedViewStyleProp, + +headerTintColor: string, + +headerTitleAllowFontScaling: boolean, + +headerLeft: NavHeaderLeftProps => React$Node, + +headerLeftContainerStyle: AnimatedViewStyleProp, + +headerRight: NavHeaderRightProps => React$Node, + +headerRightContainerStyle: AnimatedViewStyleProp, + +headerBackground: ({| style: AnimatedViewStyleProp |}) => React$Node, + +headerStyle: AnimatedViewStyleProp, + +headerTransparent: boolean, + +headerStatusBarHeight: number, + +headerShadowVisible: boolean, + +headerBackgroundContainerStyle: AnimatedViewStyleProp, + +headerPressColor: string, + +headerPressOpacity: number, + |}>; + /** * Stack options */ @@ -1322,28 +1389,25 @@ declare type Scene = {| +route: T, +descriptor: StackDescriptor, - +progress: {| - +current: AnimatedInterpolation, - +next?: AnimatedInterpolation, - +previous?: AnimatedInterpolation, - |}, + +progress: SceneProgress, |}; declare export type StackHeaderProps = {| - +navigation: StackNavigationHelpers<>, - +route: RouteProp<>, - +options: StackOptions, - +layout: {| +width: number, +height: number |}, - +progress: AnimatedInterpolation, + ...HeaderProps, StackOptions>, + +progress: SceneProgress, +back?: {| +title: string |}, +styleInterpolator: StackHeaderStyleInterpolator, |}; + 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,21 +1416,11 @@ +onLabelLayout: LayoutEvent => void, +screenLayout: {| +width: number, +height: number |}, +titleLayout: {| +width: number, +height: number |}, - +canGoBack: boolean, + +disabled: boolean, + +accessibilityLabel: string, + +style: ViewStyleProp, |}>; - declare type StackHeaderTitleInputBase = { - +onLayout: LayoutEvent => void, - +children: string, - +allowFontScaling: ?boolean, - +tintColor: ?string, - +style: ?AnimatedTextStyleProp, - ... - }; - - declare export type StackHeaderTitleInputProps = - $Exact; - declare export type StackOptions = $Partial<{| +title: string, +cardShadowEnabled: boolean, @@ -1384,30 +1438,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 +1596,12 @@ +tabBarLabelPosition: 'beside-icon' | 'below-icon', +tabBarStyle: ViewStyleProp, +unmountOnBlur: boolean, - +headerShown: boolean, +lazy: boolean, + ...HeaderCommonOptions< + HeaderProps, BottomTabOptions>, + HeaderLeftButtonProps, + HeaderButtonProps, + >, |}>; /** @@ -2002,7 +2049,11 @@ +swipeMinDistance: number, +keyboardDismissMode: 'on-drag' | 'none', +unmountOnBlur: boolean, - +headerShown: boolean, + ...HeaderCommonOptions< + HeaderProps, DrawerOptions>, + HeaderLeftButtonProps, + HeaderButtonProps, + >, |}>; /** @@ -2236,7 +2287,9 @@ * Header components */ - declare export var Header: React$ComponentType; + declare export var Header: React$ComponentType< + StackHeaderProps + >; /** * Style/animation options