import * as ReactNative from 'react-native'; import * as React from 'react'; export { css, DefaultTheme, isStyledComponent, ThemeConsumer, ThemeContext, ThemeProps, ThemeProvider, withTheme, } from './index'; import { AnyStyledComponent, DefaultTheme, isStyledComponent, StyledComponentInnerAttrs, StyledComponentInnerComponent, StyledComponentInnerOtherProps, ThemedCssFunction, ThemedStyledFunction, ThemedStyledInterface, ThemeProviderComponent, WithThemeFnInterface } from './index'; type AnyIfEmpty = keyof T extends never ? any : T; export type ReactNativeThemedStyledFunction< C extends React.ComponentType, T extends object, > = ThemedStyledFunction; // Copied over from "ThemedBaseStyledInterface" in index.d.ts in order to remove DOM element typings interface ReactNativeThemedBaseStyledInterface { (component: C): ThemedStyledFunction< StyledComponentInnerComponent, T, StyledComponentInnerOtherProps, StyledComponentInnerAttrs >; >( // unfortunately using a conditional type to validate that it can receive a `theme?: Theme` // causes tests to fail in TS 3.1 component: C ): ThemedStyledFunction; } type ReactNativeThemedStyledInterface = ReactNativeThemedBaseStyledInterface< AnyIfEmpty >; export interface ReactNativeStyledInterface extends ReactNativeThemedStyledInterface { ActivityIndicator: ReactNativeThemedStyledFunction< typeof ReactNative.ActivityIndicator, T >; ActivityIndicatorIOS: ReactNativeThemedStyledFunction< typeof ReactNative.ActivityIndicator, T >; Button: ReactNativeThemedStyledFunction< typeof ReactNative.Button, T >; DatePickerIOS: ReactNativeThemedStyledFunction< typeof ReactNative.DatePickerIOS, T >; DrawerLayoutAndroid: ReactNativeThemedStyledFunction< typeof ReactNative.DrawerLayoutAndroid, T >; Image: ReactNativeThemedStyledFunction< typeof ReactNative.Image, T >; ImageBackground: ReactNativeThemedStyledFunction< typeof ReactNative.ImageBackground, T >; KeyboardAvoidingView: ReactNativeThemedStyledFunction< typeof ReactNative.KeyboardAvoidingView, T >; ListView: ReactNativeThemedStyledFunction< typeof ReactNative.ListView, T >; Modal: ReactNativeThemedStyledFunction< typeof ReactNative.Modal, T >; NavigatorIOS: ReactNativeThemedStyledFunction< typeof ReactNative.NavigatorIOS, T >; Picker: ReactNativeThemedStyledFunction< typeof ReactNative.Picker, T >; PickerIOS: ReactNativeThemedStyledFunction< typeof ReactNative.PickerIOS, T >; ProgressBarAndroid: ReactNativeThemedStyledFunction< typeof ReactNative.ProgressBarAndroid, T >; ProgressViewIOS: ReactNativeThemedStyledFunction< typeof ReactNative.ProgressViewIOS, T >; ScrollView: ReactNativeThemedStyledFunction< typeof ReactNative.ScrollView, T >; SegmentedControlIOS: ReactNativeThemedStyledFunction< typeof ReactNative.SegmentedControlIOS, T >; Slider: ReactNativeThemedStyledFunction< typeof ReactNative.Slider, T >; SliderIOS: ReactNativeThemedStyledFunction< typeof ReactNative.Slider, T >; SnapshotViewIOS: ReactNativeThemedStyledFunction< typeof ReactNative.SnapshotViewIOS, T >; Switch: ReactNativeThemedStyledFunction< typeof ReactNative.Switch, T >; RecyclerViewBackedScrollView: ReactNativeThemedStyledFunction< typeof ReactNative.RecyclerViewBackedScrollView, T >; RefreshControl: ReactNativeThemedStyledFunction< typeof ReactNative.RefreshControl, T >; SafeAreaView: ReactNativeThemedStyledFunction< typeof ReactNative.SafeAreaView, T >; StatusBar: ReactNativeThemedStyledFunction< typeof ReactNative.StatusBar, T >; SwipeableListView: ReactNativeThemedStyledFunction< typeof ReactNative.SwipeableListView, T >; SwitchAndroid: ReactNativeThemedStyledFunction< typeof ReactNative.Switch, T >; SwitchIOS: ReactNativeThemedStyledFunction< typeof ReactNative.SwitchIOS, T >; TabBarIOS: ReactNativeThemedStyledFunction< typeof ReactNative.TabBarIOS, T >; Text: ReactNativeThemedStyledFunction< typeof ReactNative.Text, T >; TextInput: ReactNativeThemedStyledFunction< typeof ReactNative.TextInput, T >; ToolbarAndroid: ReactNativeThemedStyledFunction< typeof ReactNative.ToolbarAndroid, T >; TouchableHighlight: ReactNativeThemedStyledFunction< typeof ReactNative.TouchableHighlight, T >; TouchableNativeFeedback: ReactNativeThemedStyledFunction< typeof ReactNative.TouchableNativeFeedback, T >; TouchableOpacity: ReactNativeThemedStyledFunction< typeof ReactNative.TouchableOpacity, T >; TouchableWithoutFeedback: ReactNativeThemedStyledFunction< typeof ReactNative.TouchableWithoutFeedback, T >; View: ReactNativeThemedStyledFunction< typeof ReactNative.View, T >; ViewPagerAndroid: ReactNativeThemedStyledFunction< typeof ReactNative.ViewPagerAndroid, T >; } export interface ReactNativeThemedStyledComponentsModule< T extends object, U extends object = T > { default: ReactNativeStyledInterface; css: ThemedCssFunction; withTheme: WithThemeFnInterface; ThemeProvider: ThemeProviderComponent; ThemeConsumer: React.Consumer; ThemeContext: React.Context; // This could be made to assert `target is StyledComponent` instead, but that feels not type safe isStyledComponent: typeof isStyledComponent; } declare const styled: ReactNativeStyledInterface; export default styled;