diff --git a/native/flow-typed/npm/@react-navigation/bottom-tabs_v5.x.x.js b/native/flow-typed/npm/@react-navigation/bottom-tabs_v5.x.x.js --- a/native/flow-typed/npm/@react-navigation/bottom-tabs_v5.x.x.js +++ b/native/flow-typed/npm/@react-navigation/bottom-tabs_v5.x.x.js @@ -941,6 +941,13 @@ +path?: string, |}; + declare type ScreenOptionsProp< + ScreenOptions: {...}, + RouteParam, + NavHelpers, + > = + | ScreenOptions + | ({| +route: RouteParam, +navigation: NavHelpers |}) => ScreenOptions; declare export type ScreenListeners< State: NavigationState = NavigationState, EventMap: EventMapBase = EventMapCore, @@ -948,6 +955,13 @@ {| [name: $Keys]: empty |}, >(K, empty) => EventListenerCallback, >; + declare type ScreenListenersProp< + ScreenListenersParam: {...}, + RouteParam, + NavHelpers, + > = + | ScreenListenersParam + | ({| +route: RouteParam, +navigation: NavHelpers |}) => ScreenListenersParam; declare type BaseScreenProps< ParamList: ParamListBase, @@ -958,18 +972,16 @@ EventMap: EventMapBase = EventMapCore, > = {| +name: RouteName, - +options?: - | ScreenOptions - | ({| - +route: RouteProp, - +navigation: NavProp, - |}) => ScreenOptions, - +listeners?: - | ScreenListeners - | ({| - +route: RouteProp, - +navigation: NavProp, - |}) => ScreenListeners, + +options?: ScreenOptionsProp< + ScreenOptions, + RouteProp, + NavProp, + >, + +listeners?: ScreenListenersProp< + ScreenListeners, + RouteProp, + NavProp, + >, +initialParams?: $Partial<$ElementType>, +getId?: ({ +params: $ElementType, @@ -1052,26 +1064,23 @@ EventMap, >) => React$Node; - declare type ScreenOptionsProp< + declare type ScreenOptionsProps< ScreenOptions: {...}, RouteParam, NavHelpers, > = {| - +screenOptions?: - | ScreenOptions - | ({| +route: RouteParam, +navigation: NavHelpers |}) => ScreenOptions, + +screenOptions?: ScreenOptionsProp, |}; - declare type ScreenListenersProp< + declare type ScreenListenersProps< ScreenListenersParam: {...}, RouteParam, NavHelpers, > = {| - +screenListeners?: - | ScreenListenersParam - | ({| - +route: RouteParam, - +navigation: NavHelpers, - |}) => ScreenListenersParam, + +screenListeners?: ScreenListenersProp< + ScreenListenersParam, + RouteParam, + NavHelpers, + >, |}; declare export type ExtraNavigatorPropsBase = { ...$Exact, @@ -1087,8 +1096,8 @@ ExtraNavigatorProps: ExtraNavigatorPropsBase, > = { ...$Exact, - ...ScreenOptionsProp, - ...ScreenListenersProp, + ...ScreenOptionsProps, + ...ScreenListenersProps, ... }; declare export type NavigatorPropsBase< @@ -1132,7 +1141,7 @@ ExtraNavigatorProps, >>>, +Group: React$ComponentType<{| - ...ScreenOptionsProp, NavHelpers>, + ...ScreenOptionsProps, NavHelpers>, +children: React$Node, +navigationKey?: string, |}>, @@ -1182,7 +1191,7 @@ routerFactory: RouterFactory, options: {| ...$Exact, - ...ScreenOptionsProp, NavHelpers>, + ...ScreenOptionsProps, NavHelpers>, +children?: React$Node, |}, ) => {| diff --git a/native/flow-typed/npm/@react-navigation/devtools_v5.x.x.js b/native/flow-typed/npm/@react-navigation/devtools_v5.x.x.js --- a/native/flow-typed/npm/@react-navigation/devtools_v5.x.x.js +++ b/native/flow-typed/npm/@react-navigation/devtools_v5.x.x.js @@ -941,6 +941,13 @@ +path?: string, |}; + declare type ScreenOptionsProp< + ScreenOptions: {...}, + RouteParam, + NavHelpers, + > = + | ScreenOptions + | ({| +route: RouteParam, +navigation: NavHelpers |}) => ScreenOptions; declare export type ScreenListeners< State: NavigationState = NavigationState, EventMap: EventMapBase = EventMapCore, @@ -948,6 +955,13 @@ {| [name: $Keys]: empty |}, >(K, empty) => EventListenerCallback, >; + declare type ScreenListenersProp< + ScreenListenersParam: {...}, + RouteParam, + NavHelpers, + > = + | ScreenListenersParam + | ({| +route: RouteParam, +navigation: NavHelpers |}) => ScreenListenersParam; declare type BaseScreenProps< ParamList: ParamListBase, @@ -958,18 +972,16 @@ EventMap: EventMapBase = EventMapCore, > = {| +name: RouteName, - +options?: - | ScreenOptions - | ({| - +route: RouteProp, - +navigation: NavProp, - |}) => ScreenOptions, - +listeners?: - | ScreenListeners - | ({| - +route: RouteProp, - +navigation: NavProp, - |}) => ScreenListeners, + +options?: ScreenOptionsProp< + ScreenOptions, + RouteProp, + NavProp, + >, + +listeners?: ScreenListenersProp< + ScreenListeners, + RouteProp, + NavProp, + >, +initialParams?: $Partial<$ElementType>, +getId?: ({ +params: $ElementType, @@ -1052,26 +1064,23 @@ EventMap, >) => React$Node; - declare type ScreenOptionsProp< + declare type ScreenOptionsProps< ScreenOptions: {...}, RouteParam, NavHelpers, > = {| - +screenOptions?: - | ScreenOptions - | ({| +route: RouteParam, +navigation: NavHelpers |}) => ScreenOptions, + +screenOptions?: ScreenOptionsProp, |}; - declare type ScreenListenersProp< + declare type ScreenListenersProps< ScreenListenersParam: {...}, RouteParam, NavHelpers, > = {| - +screenListeners?: - | ScreenListenersParam - | ({| - +route: RouteParam, - +navigation: NavHelpers, - |}) => ScreenListenersParam, + +screenListeners?: ScreenListenersProp< + ScreenListenersParam, + RouteParam, + NavHelpers, + >, |}; declare export type ExtraNavigatorPropsBase = { ...$Exact, @@ -1087,8 +1096,8 @@ ExtraNavigatorProps: ExtraNavigatorPropsBase, > = { ...$Exact, - ...ScreenOptionsProp, - ...ScreenListenersProp, + ...ScreenOptionsProps, + ...ScreenListenersProps, ... }; declare export type NavigatorPropsBase< @@ -1132,7 +1141,7 @@ ExtraNavigatorProps, >>>, +Group: React$ComponentType<{| - ...ScreenOptionsProp, NavHelpers>, + ...ScreenOptionsProps, NavHelpers>, +children: React$Node, +navigationKey?: string, |}>, @@ -1182,7 +1191,7 @@ routerFactory: RouterFactory, options: {| ...$Exact, - ...ScreenOptionsProp, NavHelpers>, + ...ScreenOptionsProps, NavHelpers>, +children?: React$Node, |}, ) => {| diff --git a/native/flow-typed/npm/@react-navigation/material-top-tabs_v5.x.x.js b/native/flow-typed/npm/@react-navigation/material-top-tabs_v5.x.x.js --- a/native/flow-typed/npm/@react-navigation/material-top-tabs_v5.x.x.js +++ b/native/flow-typed/npm/@react-navigation/material-top-tabs_v5.x.x.js @@ -941,6 +941,13 @@ +path?: string, |}; + declare type ScreenOptionsProp< + ScreenOptions: {...}, + RouteParam, + NavHelpers, + > = + | ScreenOptions + | ({| +route: RouteParam, +navigation: NavHelpers |}) => ScreenOptions; declare export type ScreenListeners< State: NavigationState = NavigationState, EventMap: EventMapBase = EventMapCore, @@ -948,6 +955,13 @@ {| [name: $Keys]: empty |}, >(K, empty) => EventListenerCallback, >; + declare type ScreenListenersProp< + ScreenListenersParam: {...}, + RouteParam, + NavHelpers, + > = + | ScreenListenersParam + | ({| +route: RouteParam, +navigation: NavHelpers |}) => ScreenListenersParam; declare type BaseScreenProps< ParamList: ParamListBase, @@ -958,18 +972,16 @@ EventMap: EventMapBase = EventMapCore, > = {| +name: RouteName, - +options?: - | ScreenOptions - | ({| - +route: RouteProp, - +navigation: NavProp, - |}) => ScreenOptions, - +listeners?: - | ScreenListeners - | ({| - +route: RouteProp, - +navigation: NavProp, - |}) => ScreenListeners, + +options?: ScreenOptionsProp< + ScreenOptions, + RouteProp, + NavProp, + >, + +listeners?: ScreenListenersProp< + ScreenListeners, + RouteProp, + NavProp, + >, +initialParams?: $Partial<$ElementType>, +getId?: ({ +params: $ElementType, @@ -1052,26 +1064,23 @@ EventMap, >) => React$Node; - declare type ScreenOptionsProp< + declare type ScreenOptionsProps< ScreenOptions: {...}, RouteParam, NavHelpers, > = {| - +screenOptions?: - | ScreenOptions - | ({| +route: RouteParam, +navigation: NavHelpers |}) => ScreenOptions, + +screenOptions?: ScreenOptionsProp, |}; - declare type ScreenListenersProp< + declare type ScreenListenersProps< ScreenListenersParam: {...}, RouteParam, NavHelpers, > = {| - +screenListeners?: - | ScreenListenersParam - | ({| - +route: RouteParam, - +navigation: NavHelpers, - |}) => ScreenListenersParam, + +screenListeners?: ScreenListenersProp< + ScreenListenersParam, + RouteParam, + NavHelpers, + >, |}; declare export type ExtraNavigatorPropsBase = { ...$Exact, @@ -1087,8 +1096,8 @@ ExtraNavigatorProps: ExtraNavigatorPropsBase, > = { ...$Exact, - ...ScreenOptionsProp, - ...ScreenListenersProp, + ...ScreenOptionsProps, + ...ScreenListenersProps, ... }; declare export type NavigatorPropsBase< @@ -1132,7 +1141,7 @@ ExtraNavigatorProps, >>>, +Group: React$ComponentType<{| - ...ScreenOptionsProp, NavHelpers>, + ...ScreenOptionsProps, NavHelpers>, +children: React$Node, +navigationKey?: string, |}>, @@ -1182,7 +1191,7 @@ routerFactory: RouterFactory, options: {| ...$Exact, - ...ScreenOptionsProp, NavHelpers>, + ...ScreenOptionsProps, NavHelpers>, +children?: React$Node, |}, ) => {| diff --git a/native/flow-typed/npm/@react-navigation/native_v5.x.x.js b/native/flow-typed/npm/@react-navigation/native_v5.x.x.js --- a/native/flow-typed/npm/@react-navigation/native_v5.x.x.js +++ b/native/flow-typed/npm/@react-navigation/native_v5.x.x.js @@ -941,6 +941,13 @@ +path?: string, |}; + declare type ScreenOptionsProp< + ScreenOptions: {...}, + RouteParam, + NavHelpers, + > = + | ScreenOptions + | ({| +route: RouteParam, +navigation: NavHelpers |}) => ScreenOptions; declare export type ScreenListeners< State: NavigationState = NavigationState, EventMap: EventMapBase = EventMapCore, @@ -948,6 +955,13 @@ {| [name: $Keys]: empty |}, >(K, empty) => EventListenerCallback, >; + declare type ScreenListenersProp< + ScreenListenersParam: {...}, + RouteParam, + NavHelpers, + > = + | ScreenListenersParam + | ({| +route: RouteParam, +navigation: NavHelpers |}) => ScreenListenersParam; declare type BaseScreenProps< ParamList: ParamListBase, @@ -958,18 +972,16 @@ EventMap: EventMapBase = EventMapCore, > = {| +name: RouteName, - +options?: - | ScreenOptions - | ({| - +route: RouteProp, - +navigation: NavProp, - |}) => ScreenOptions, - +listeners?: - | ScreenListeners - | ({| - +route: RouteProp, - +navigation: NavProp, - |}) => ScreenListeners, + +options?: ScreenOptionsProp< + ScreenOptions, + RouteProp, + NavProp, + >, + +listeners?: ScreenListenersProp< + ScreenListeners, + RouteProp, + NavProp, + >, +initialParams?: $Partial<$ElementType>, +getId?: ({ +params: $ElementType, @@ -1052,26 +1064,23 @@ EventMap, >) => React$Node; - declare type ScreenOptionsProp< + declare type ScreenOptionsProps< ScreenOptions: {...}, RouteParam, NavHelpers, > = {| - +screenOptions?: - | ScreenOptions - | ({| +route: RouteParam, +navigation: NavHelpers |}) => ScreenOptions, + +screenOptions?: ScreenOptionsProp, |}; - declare type ScreenListenersProp< + declare type ScreenListenersProps< ScreenListenersParam: {...}, RouteParam, NavHelpers, > = {| - +screenListeners?: - | ScreenListenersParam - | ({| - +route: RouteParam, - +navigation: NavHelpers, - |}) => ScreenListenersParam, + +screenListeners?: ScreenListenersProp< + ScreenListenersParam, + RouteParam, + NavHelpers, + >, |}; declare export type ExtraNavigatorPropsBase = { ...$Exact, @@ -1087,8 +1096,8 @@ ExtraNavigatorProps: ExtraNavigatorPropsBase, > = { ...$Exact, - ...ScreenOptionsProp, - ...ScreenListenersProp, + ...ScreenOptionsProps, + ...ScreenListenersProps, ... }; declare export type NavigatorPropsBase< @@ -1132,7 +1141,7 @@ ExtraNavigatorProps, >>>, +Group: React$ComponentType<{| - ...ScreenOptionsProp, NavHelpers>, + ...ScreenOptionsProps, NavHelpers>, +children: React$Node, +navigationKey?: string, |}>, @@ -1182,7 +1191,7 @@ routerFactory: RouterFactory, options: {| ...$Exact, - ...ScreenOptionsProp, NavHelpers>, + ...ScreenOptionsProps, NavHelpers>, +children?: React$Node, |}, ) => {| diff --git a/native/flow-typed/npm/@react-navigation/stack_v5.x.x.js b/native/flow-typed/npm/@react-navigation/stack_v5.x.x.js --- a/native/flow-typed/npm/@react-navigation/stack_v5.x.x.js +++ b/native/flow-typed/npm/@react-navigation/stack_v5.x.x.js @@ -941,6 +941,13 @@ +path?: string, |}; + declare type ScreenOptionsProp< + ScreenOptions: {...}, + RouteParam, + NavHelpers, + > = + | ScreenOptions + | ({| +route: RouteParam, +navigation: NavHelpers |}) => ScreenOptions; declare export type ScreenListeners< State: NavigationState = NavigationState, EventMap: EventMapBase = EventMapCore, @@ -948,6 +955,13 @@ {| [name: $Keys]: empty |}, >(K, empty) => EventListenerCallback, >; + declare type ScreenListenersProp< + ScreenListenersParam: {...}, + RouteParam, + NavHelpers, + > = + | ScreenListenersParam + | ({| +route: RouteParam, +navigation: NavHelpers |}) => ScreenListenersParam; declare type BaseScreenProps< ParamList: ParamListBase, @@ -958,18 +972,16 @@ EventMap: EventMapBase = EventMapCore, > = {| +name: RouteName, - +options?: - | ScreenOptions - | ({| - +route: RouteProp, - +navigation: NavProp, - |}) => ScreenOptions, - +listeners?: - | ScreenListeners - | ({| - +route: RouteProp, - +navigation: NavProp, - |}) => ScreenListeners, + +options?: ScreenOptionsProp< + ScreenOptions, + RouteProp, + NavProp, + >, + +listeners?: ScreenListenersProp< + ScreenListeners, + RouteProp, + NavProp, + >, +initialParams?: $Partial<$ElementType>, +getId?: ({ +params: $ElementType, @@ -1052,26 +1064,23 @@ EventMap, >) => React$Node; - declare type ScreenOptionsProp< + declare type ScreenOptionsProps< ScreenOptions: {...}, RouteParam, NavHelpers, > = {| - +screenOptions?: - | ScreenOptions - | ({| +route: RouteParam, +navigation: NavHelpers |}) => ScreenOptions, + +screenOptions?: ScreenOptionsProp, |}; - declare type ScreenListenersProp< + declare type ScreenListenersProps< ScreenListenersParam: {...}, RouteParam, NavHelpers, > = {| - +screenListeners?: - | ScreenListenersParam - | ({| - +route: RouteParam, - +navigation: NavHelpers, - |}) => ScreenListenersParam, + +screenListeners?: ScreenListenersProp< + ScreenListenersParam, + RouteParam, + NavHelpers, + >, |}; declare export type ExtraNavigatorPropsBase = { ...$Exact, @@ -1087,8 +1096,8 @@ ExtraNavigatorProps: ExtraNavigatorPropsBase, > = { ...$Exact, - ...ScreenOptionsProp, - ...ScreenListenersProp, + ...ScreenOptionsProps, + ...ScreenListenersProps, ... }; declare export type NavigatorPropsBase< @@ -1132,7 +1141,7 @@ ExtraNavigatorProps, >>>, +Group: React$ComponentType<{| - ...ScreenOptionsProp, NavHelpers>, + ...ScreenOptionsProps, NavHelpers>, +children: React$Node, +navigationKey?: string, |}>, @@ -1182,7 +1191,7 @@ routerFactory: RouterFactory, options: {| ...$Exact, - ...ScreenOptionsProp, NavHelpers>, + ...ScreenOptionsProps, NavHelpers>, +children?: React$Node, |}, ) => {|