From fa00e46e93d532c2c08f8e9d0faca320da65eb7d Mon Sep 17 00:00:00 2001 From: Tim Wang Date: Tue, 15 Aug 2017 23:37:34 +0800 Subject: [PATCH] Use TextStyle for navigation text related style properties --- types/react-navigation/index.d.ts | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/types/react-navigation/index.d.ts b/types/react-navigation/index.d.ts index e0f74b1c2d..5ab4cc05a4 100644 --- a/types/react-navigation/index.d.ts +++ b/types/react-navigation/index.d.ts @@ -8,6 +8,7 @@ // Kyle Roach // phanalpha // charlesfamu +// Tim Wang // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -44,7 +45,7 @@ export type HeaderProps = NavigationSceneRendererProps & { getScreenDetails: (navigationScene: NavigationScene) => NavigationScreenDetails< NavigationStackScreenOptions >, - style: Style, + style: ViewStyle, }; /** @@ -148,8 +149,6 @@ export type NavigationScreenOption = config: T ) => T); -export type Style = ViewStyle; - export type NavigationScreenDetails = { options: T, state: NavigationRoute, @@ -253,7 +252,7 @@ export interface NavigationUriAction extends NavigationUriActionPayload { export interface NavigationStackViewConfig { mode?: 'card' | 'modal', headerMode?: HeaderMode, - cardStyle?: Style, + cardStyle?: ViewStyle, transitionConfig?: () => TransitionConfig, onTransitionStart?: () => void, onTransitionEnd?: () => void, @@ -262,15 +261,15 @@ export interface NavigationStackViewConfig { export type NavigationStackScreenOptions = NavigationScreenOptions & { header?: (React.ReactElement | ((headerProps: HeaderProps) => React.ReactElement)) | null, headerTitle?: string | React.ReactElement, - headerTitleStyle?: Style, + headerTitleStyle?: TextStyle, headerTintColor?: string, headerLeft?: React.ReactElement, headerBackTitle?: string | null, headerTruncatedBackTitle?: string, - headerBackTitleStyle?: Style, + headerBackTitleStyle?: TextStyle, headerPressColorAndroid?: string, headerRight?: React.ReactElement, - headerStyle?: Style, + headerStyle?: ViewStyle, gesturesEnabled?: boolean, }; @@ -469,7 +468,7 @@ export type NavigationSceneRenderer = () => (React.ReactElement | null); export type NavigationStyleInterpolator = ( props: NavigationSceneRendererProps -) => Style; +) => ViewStyle; export type LayoutEvent = { nativeEvent: {