|
| 1 | +// flow-typed signature: 2cf86c1d5289a8ee234774a4d54dca33 |
| 2 | +// flow-typed version: 536c492332/@react-navigation/core_v3.x.x/flow_>=v0.104.x |
| 3 | + |
1 | 4 | // @flow |
2 | 5 |
|
3 | | -declare module 'react-navigation' { |
| 6 | +declare module '@react-navigation/core' { |
4 | 7 |
|
5 | 8 | //--------------------------------------------------------------------------- |
6 | 9 | // SECTION 1: IDENTICAL TYPE DEFINITIONS |
@@ -216,7 +219,7 @@ declare module 'react-navigation' { |
216 | 219 |
|
217 | 220 | declare export type NavigationScreenOptionsGetter<Options: {...}> = ( |
218 | 221 | navigation: NavigationScreenProp<NavigationRoute>, |
219 | | - ncreenProps: ?NavigationScreenProps, |
| 222 | + screenProps: ?NavigationScreenProps, |
220 | 223 | theme: SupportedThemes, |
221 | 224 | ) => Options; |
222 | 225 |
|
@@ -606,16 +609,39 @@ declare module 'react-navigation' { |
606 | 609 | ... |
607 | 610 | }; |
608 | 611 |
|
| 612 | + declare type _HeaderBackButtonProps = {| |
| 613 | + disabled?: boolean, |
| 614 | + onPress: () => void, |
| 615 | + pressColorAndroid?: string, |
| 616 | + tintColor?: ?string, |
| 617 | + backImage?: React$ComponentType<{ |
| 618 | + tintColor: string, |
| 619 | + title?: ?string, |
| 620 | + ... |
| 621 | + }>, |
| 622 | + title?: ?string, |
| 623 | + truncatedTitle?: ?string, |
| 624 | + backTitleVisible?: boolean, |
| 625 | + allowFontScaling?: boolean, |
| 626 | + titleStyle?: ?TextStyleProp, |
| 627 | + headerLayoutPreset: 'left' | 'center', |
| 628 | + width?: ?number, |
| 629 | + scene: NavigationStackScene, |
| 630 | + |}; |
| 631 | + |
609 | 632 | declare export type NavigationStackScreenOptions = NavigationScreenOptions & { |
610 | 633 | header?: ?(React$Node | (HeaderProps => React$Node)), |
611 | 634 | headerTransparent?: boolean, |
612 | | - headerTitle?: string | React$Node | React$ElementType, |
| 635 | + headerTitle?: (props: { children: ?string, ... }) => React$Node | React$Node, |
613 | 636 | headerTitleStyle?: AnimatedTextStyleProp, |
614 | 637 | headerTitleAllowFontScaling?: boolean, |
615 | 638 | headerTintColor?: string, |
616 | | - headerLeft?: React$Node | React$ElementType, |
| 639 | + headerLeft?: ((props: _HeaderBackButtonProps) => React$Node) | React$Node, |
617 | 640 | headerBackTitle?: string, |
618 | | - headerBackImage?: React$Node | React$ElementType, |
| 641 | + headerBackImage?: (props: {| |
| 642 | + tintColor?: string, |
| 643 | + title?: ?string, |
| 644 | + |}) => React$Node, |
619 | 645 | headerTruncatedBackTitle?: string, |
620 | 646 | headerBackTitleStyle?: TextStyleProp, |
621 | 647 | headerPressColorAndroid?: string, |
@@ -918,37 +944,4 @@ declare module 'react-navigation' { |
918 | 944 | Component: ComponentType |
919 | 945 | ): React$ComponentType<$Diff<React$ElementConfig<ComponentType>, {| isFocused: ?boolean |}>>; |
920 | 946 |
|
921 | | - declare export function createAppContainer<S: NavigationState, O: {...}>( |
922 | | - Component: NavigationNavigator<S, O, *> |
923 | | - ): NavigationContainer<S, O, *>; |
924 | | - |
925 | | - declare export function createKeyboardAwareNavigator<Props: {...}>( |
926 | | - Comp: React$ComponentType<Props>, |
927 | | - stackConfig: {...} |
928 | | - ): React$ComponentType<Props>; |
929 | | - |
930 | | - declare export function withOrientation<Props: {...}, ComponentType: React$ComponentType<Props>>( |
931 | | - Component: ComponentType |
932 | | - ): React$ComponentType<$Diff<React$ElementConfig<ComponentType>, {| isLandscape: boolean |}>>; |
933 | | - |
934 | | - declare type _SafeAreaViewProps = { |
935 | | - forceInset?: _SafeAreaViewInsets, |
936 | | - children?: React$Node, |
937 | | - style?: AnimatedViewStyleProp, |
938 | | - ... |
939 | | - }; |
940 | | - declare export var SafeAreaView: React$ComponentType<_SafeAreaViewProps>; |
941 | | - |
942 | | - // These components take the same props that their React Native primitives do |
943 | | - // Typing them correctly would be extremely brittle |
944 | | - // We await the day we can import types from libraries in flow-typed libdefs |
945 | | - declare export var ScrollView: React$ComponentType<{...}>; |
946 | | - declare export var FlatList: React$ComponentType<{...}>; |
947 | | - declare export var SectionList: React$ComponentType<{...}>; |
948 | | - declare export var Themed: {| |
949 | | - StatusBar: React$ComponentType<{...}>, |
950 | | - Text: React$ComponentType<{...}>, |
951 | | - TextInput: React$ComponentType<{...}>, |
952 | | - |}; |
953 | | - |
954 | 947 | } |
0 commit comments