diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index ed29038337..c0ca165987 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -890,7 +890,7 @@ export interface TextProperties extends TextPropertiesIOS, TextPropertiesAndroid /** * @see https://facebook.github.io/react-native/docs/text.html#style */ - style?: TextStyle | Array + style?: StyleProp /** * Used to locate this view in end-to-end tests. @@ -1219,7 +1219,7 @@ export interface TextInputProperties extends ViewProperties, TextInputIOSPropert /** * Styles */ - style?: TextStyle | Array + style?: StyleProp /** * Used to locate this view in end-to-end tests @@ -1657,7 +1657,7 @@ export interface ViewPropertiesAndroid { } -export type ViewStyleProp = ViewStyle | Array; +export type StyleProp = T | Array /** * @see https://facebook.github.io/react-native/docs/view.html#props @@ -1738,7 +1738,7 @@ export interface ViewProperties extends ViewPropertiesAndroid, ViewPropertiesIOS */ removeClippedSubviews?: boolean - style?: ViewStyleProp; + style?: StyleProp /** * Used to locate this view in end-to-end tests. @@ -1886,7 +1886,7 @@ export interface KeyboardAvoidingViewProps extends ViewProperties { /** * The style of the content container(View) when behavior is 'position'. */ - contentContainerStyle?: ViewStyle + contentContainerStyle?: StyleProp /** * This is the distance between the top of the user screen and the react native view, @@ -2108,7 +2108,7 @@ export interface WebViewProperties extends ViewProperties, WebViewPropertiesAndr */ startInLoadingState?: boolean - style?: ViewStyle + style?: StyleProp // Deprecated: Use the `source` prop instead. url?: string @@ -2255,7 +2255,7 @@ export interface NavigatorIOSProperties { * The default wrapper style for components in the navigator. * A common use case is to set the backgroundColor for every page */ - itemWrapperStyle?: ViewStyle + itemWrapperStyle?: StyleProp /** * Boolean value that indicates whether the interactive pop gesture is @@ -2298,7 +2298,7 @@ export interface NavigatorIOSProperties { /** * NOT IN THE DOC BUT IN THE EXAMPLES */ - style?: ViewStyle + style?: StyleProp } /** @@ -2388,7 +2388,7 @@ export interface ActivityIndicatorProperties extends ViewProperties { */ size?: number | 'small' | 'large' - style?: ViewStyle + style?: StyleProp } export interface ActivityIndicatorStatic extends NativeMethodsMixin, React.ClassicComponentClass { @@ -2428,7 +2428,7 @@ export interface ActivityIndicatorIOSProperties extends ViewProperties { */ size?: 'small' | 'large' - style?: ViewStyle + style?: StyleProp } /** @@ -2642,7 +2642,7 @@ export interface PickerPropertiesIOS extends ViewProperties { * Style to apply to each of the item labels. * @platform ios */ - itemStyle?: ViewStyle, + itemStyle?: StyleProp, } export interface PickerPropertiesAndroid extends ViewProperties { @@ -2693,7 +2693,7 @@ export interface PickerProperties extends PickerPropertiesIOS, PickerPropertiesA */ selectedValue?: any - style?: ViewStyle + style?: StyleProp /** * Used to locate this view in end-to-end tests. @@ -2725,7 +2725,7 @@ export interface PickerStatic extends React.ComponentClass { */ export interface PickerIOSProperties extends ViewProperties { - itemStyle?: TextStyle + itemStyle?: StyleProp onValueChange?: ( value: string | number ) => void selectedValue?: string | number } @@ -3025,7 +3025,7 @@ export interface SliderProperties extends SliderPropertiesIOS, SliderPropertiesA /** * Used to style and layout the Slider. See StyleSheet.js and ViewStylePropTypes.js for more info. */ - style?: ViewStyle + style?: StyleProp /** * Used to locate this view in UI automation tests. @@ -3390,7 +3390,7 @@ export interface ImageProperties extends ImagePropertiesIOS, ImagePropertiesAndr * * Style */ - style?: ImageStyle | Array; + style?: StyleProp; /** * A unique identifier for this element to be used in UI Automation testing scripts. @@ -3472,7 +3472,7 @@ export interface FlatListProperties extends ScrollViewProperties { /** * Optional custom style for multi-item rows generated when numColumns > 1 */ - columnWrapperStyle?: ViewStyle + columnWrapperStyle?: StyleProp /** * When false tapping outside of the focused text input when the keyboard @@ -4082,7 +4082,7 @@ export interface MapViewProperties extends ViewProperties { * Used to style and layout the MapView. * See StyleSheet.js and ViewStylePropTypes.js for more info. */ - style?: ViewStyle + style?: StyleProp /** * If false the user won't be able to pinch/zoom the map. @@ -4317,7 +4317,7 @@ export interface TouchableWithoutFeedbackProperties extends TouchableWithoutFeed /** * //FIXME: not in doc but available in examples */ - style?: ViewStyleProp + style?: StyleProp /** * When the scroll view is disabled, this defines how far your @@ -4375,7 +4375,7 @@ export interface TouchableHighlightProperties extends TouchableWithoutFeedbackPr /** * @see https://facebook.github.io/react-native/docs/view.html#style */ - style?: ViewStyleProp + style?: StyleProp /** * The color of the underlay that will show through when the touch is active. @@ -4653,7 +4653,7 @@ export interface NavigatorProperties { /** * Styles to apply to the container of each scene */ - sceneStyle?: ViewStyle + sceneStyle?: StyleProp } @@ -4850,7 +4850,7 @@ export namespace NavigatorStatic { routeMapper?: NavigationBarRouteMapper navState?: NavState navigationStyles?: NavigationBarStyle - style?: ViewStyle + style?: StyleProp } export interface NavigationBarStatic extends React.ComponentClass { @@ -4888,7 +4888,7 @@ export namespace NavigatorStatic { navigator?: Navigator routeMapper?: BreadcrumbNavigationBarRouteMapper navState?: NavState - style?: ViewStyle + style?: StyleProp } export interface BreadcrumbNavigationBarStatic extends React.ComponentClass { @@ -5240,7 +5240,7 @@ export interface TabBarItemProperties extends ViewProperties { /** * React style object. */ - style?: ViewStyle + style?: StyleProp /** * Items comes with a few predefined system icons. @@ -5965,7 +5965,7 @@ export interface ScrollViewProperties extends ViewProperties, ScrollViewProperti * } * }); */ - contentContainerStyle?: ViewStyle + contentContainerStyle?: StyleProp /** * When true the scroll view's children are arranged horizontally in a row @@ -7659,7 +7659,7 @@ export interface SwitchProperties extends SwitchPropertiesIOS { * Default value is false. */ value?: boolean - style?: ViewStyle + style?: StyleProp } /** @@ -8232,7 +8232,7 @@ export interface NavigationHeaderProps extends NavigationSceneRendererProps { renderLeftComponent?: SubViewRenderer, renderRightComponent?: SubViewRenderer, renderTitleComponent?: SubViewRenderer, - style?: ViewStyle, + style?: StyleProp, viewProps?: any, statusBarHeight?: number | NavigationAnimatedValue } @@ -8244,8 +8244,8 @@ export interface NavigationHeaderStatic extends React.ComponentClass, + textStyle?: StyleProp, viewProps?: any } @@ -8256,11 +8256,11 @@ export interface NavigationCardStackProps { /** * Custom style applied to the card. */ - cardStyle?: ViewStyle + cardStyle?: StyleProp /** * Custom style interpolator for the card. */ - cardStyleInterpolator?: (props: NavigationSceneRendererProps) => ViewStyle; + cardStyleInterpolator?: (props: NavigationSceneRendererProps) => StyleProp /** * Direction of the cards movement. Value could be `horizontal` or * `vertical`. Default value is `horizontal`. @@ -8307,7 +8307,7 @@ export interface NavigationCardStackProps { /** * Custom style applied to the cards stack. */ - style?: ViewStyle, + style?: StyleProp, } // Object Instances @@ -8377,7 +8377,7 @@ export interface NavigationCardProps extends React.ComponentClass, } export interface NavigationCardStackStatic extends React.ComponentClass { @@ -8563,7 +8563,7 @@ export interface ARTShapeProps { } export interface ARTSurfaceProps { - style: ViewStyle, + style: StyleProp, width: number, height: number }