-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
Copy pathindex.d.ts
110 lines (101 loc) Β· 4.21 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
// Definitions by: Pat Sissons <https://github.com/patsissons>
// TypeScript Version: 4.1
import * as RN from 'react-native'
import { Theme } from '@emotion/react'
import {
CreateStyled as BaseCreateStyled,
CreateStyledComponent,
CSSInterpolation,
Interpolation,
ReactNativeStyle,
ReactNativeStyleType
} from './base'
export {
ArrayCSSInterpolation,
ArrayInterpolation,
CreateStyledComponent,
CSSInterpolation,
FilteringStyledOptions,
FunctionInterpolation,
Interpolation,
InterpolationPrimitive,
ObjectInterpolation,
ReactNativeStyle,
StyledComponent,
StyledOptions
} from './base'
type ReactNative = typeof RN
export function css<StyleType extends ReactNativeStyle = ReactNativeStyle>(
template: TemplateStringsArray,
...args: Array<Interpolation>
): StyleType
export function css<StyleType extends ReactNativeStyle = ReactNativeStyle>(
...args: Array<StyleType>
): StyleType
export function css<StyleType extends ReactNativeStyle = ReactNativeStyle>(
...args: Array<CSSInterpolation>
): StyleType
// those 2 are just copies of the `BaseCreateStyled` with supplied `C` type argument
type HostClassComponent<C extends React.ComponentClass<any>> =
CreateStyledComponent<
React.ComponentProps<C> & { theme?: Theme; as?: React.ElementType },
{},
{ ref?: React.Ref<InstanceType<C>> },
ReactNativeStyleType<React.ComponentProps<C>>
>
type HostFunctionComponent<C extends React.FunctionComponent<any>> =
CreateStyledComponent<
React.ComponentProps<C> & { theme?: Theme; as?: React.ElementType },
{},
{},
ReactNativeStyleType<React.ComponentProps<C>>
>
export interface StyledComponents {
ActivityIndicator: HostClassComponent<ReactNative['ActivityIndicator']>
Button: HostClassComponent<ReactNative['Button']>
DatePickerIOS: HostClassComponent<ReactNative['DatePickerIOS']>
DrawerLayoutAndroid: HostClassComponent<ReactNative['DrawerLayoutAndroid']>
FlatList: HostClassComponent<ReactNative['FlatList']>
Image: HostClassComponent<ReactNative['Image']>
ImageBackground: HostClassComponent<ReactNative['ImageBackground']>
KeyboardAvoidingView: HostClassComponent<ReactNative['KeyboardAvoidingView']>
ListView: HostClassComponent<ReactNative['ListView']>
Modal: HostClassComponent<ReactNative['Modal']>
NavigatorIOS: HostClassComponent<ReactNative['NavigatorIOS']>
Picker: HostClassComponent<ReactNative['Picker']>
PickerIOS: HostClassComponent<ReactNative['PickerIOS']>
Pressable: HostFunctionComponent<ReactNative['Pressable']>
ProgressBarAndroid: HostClassComponent<ReactNative['ProgressBarAndroid']>
ProgressViewIOS: HostClassComponent<ReactNative['ProgressViewIOS']>
RecyclerViewBackedScrollView: HostClassComponent<
ReactNative['RecyclerViewBackedScrollView']
>
RefreshControl: HostClassComponent<ReactNative['RefreshControl']>
SafeAreaView: HostClassComponent<ReactNative['SafeAreaView']>
ScrollView: HostClassComponent<ReactNative['ScrollView']>
SectionList: HostClassComponent<ReactNative['SectionList']>
SegmentedControlIOS: HostClassComponent<ReactNative['SegmentedControlIOS']>
Slider: HostClassComponent<ReactNative['Slider']>
SnapshotViewIOS: HostClassComponent<ReactNative['SnapshotViewIOS']>
StatusBar: HostClassComponent<ReactNative['StatusBar']>
SwipeableListView: HostClassComponent<ReactNative['SwipeableListView']>
Switch: HostClassComponent<ReactNative['Switch']>
SwitchIOS: HostClassComponent<ReactNative['SwitchIOS']>
TabBarIOS: HostClassComponent<ReactNative['TabBarIOS']>
Text: HostClassComponent<ReactNative['Text']>
TextInput: HostClassComponent<ReactNative['TextInput']>
ToolbarAndroid: HostClassComponent<ReactNative['ToolbarAndroid']>
TouchableHighlight: HostClassComponent<ReactNative['TouchableHighlight']>
TouchableNativeFeedback: HostClassComponent<
ReactNative['TouchableNativeFeedback']
>
TouchableOpacity: HostClassComponent<ReactNative['TouchableOpacity']>
TouchableWithoutFeedback: HostClassComponent<
ReactNative['TouchableWithoutFeedback']
>
View: HostClassComponent<ReactNative['View']>
ViewPagerAndroid: HostClassComponent<ReactNative['ViewPagerAndroid']>
}
export interface CreateStyled extends BaseCreateStyled, StyledComponents {}
declare const styled: CreateStyled
export default styled