-
Notifications
You must be signed in to change notification settings - Fork 8
/
index.d.ts
176 lines (134 loc) · 3.94 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
import type { Component, ReactNode, Context, Provider, Consumer } from 'react';
import type { ImageStyle, TextStyle, ViewStyle } from 'react-native';
export type Theme = 'light' | 'dark' | 'midnight';
export interface ColorPalette {
background: string,
section: string,
separator: string,
header: string,
footer: string,
accessory: string,
title: string,
subtitle: string,
disabled: string,
progress: string,
underlay: string,
ripple: string,
}
export interface TableProps {
accentColor?: string,
theme?: Theme,
blendAccent?: boolean,
colorPalette?: (ColorPalette) | ((colorPalette: ColorPalette) => ColorPalette),
style?: ViewStyle,
scrollViewStyle?: ViewStyle,
children: ReactNode,
scrollable?: boolean,
disabled?: boolean,
mode?: 'grouped' | 'inset-grouped',
}
export interface SectionProps {
disabled?: boolean,
mode?: 'grouped' | 'inset-grouped',
children: ReactNode,
style?: ViewStyle,
header?: string,
headerCapitalized?: boolean,
headerStyle?: TextStyle,
headerComponent?: ReactNode,
footer?: string,
footerCapitalized?: boolean,
footerStyle?: TextStyle,
footerComponent?: ReactNode,
hideSeparators?: boolean,
separatorInsetLeft?: number,
separatorInsetRight?: number,
}
export interface CommonCellProps {
style?: ViewStyle,
disabled?: boolean,
onPress?: () => void,
onLongPress?: () => void,
customAction?: string,
customActionType?: 'call' | 'compose' | 'openUrl',
customActionTrigger?: 'onPress' | 'onLongPress',
}
export interface CellProps extends CommonCellProps {
children: ReactNode,
}
export interface AccessoryCellProps extends CommonCellProps {
accessory?: 'disclosure' | 'details' | 'checkmark',
accessoryComponent?: ReactNode,
hideAccessorySeparator?: boolean,
loading?: boolean,
onAccessoryPress?: () => void,
}
export interface IconCellProps extends AccessoryCellProps {
iconComponent?: ReactNode,
iconContainerStyle?: ViewStyle,
children?: ReactNode,
contentComponent?: ReactNode,
contentContainerStyle?: ViewStyle,
}
export interface StaticCellProps extends IconCellProps {
title: string,
titleStyle?: TextStyle,
titleNumberOfLines?: number,
titleEllipsizeMode?: 'head' | 'middle' | 'tail' | 'clip',
subtitle?: string,
subtitleStyle?: TextStyle,
subtitleNumberOfLines?: number,
subtitleEllipsizeMode?: 'head' | 'middle' | 'tail' | 'clip',
}
export interface KeyValueCellProps extends IconCellProps {
title: string,
titleStyle?: TextStyle,
value?: string,
valueStyle?: TextStyle,
}
export interface SwitchCellProps extends IconCellProps {
title: string,
titleStyle?: TextStyle,
switchOnCell?: boolean,
value?: boolean,
onSwitch?: (value: boolean) => void,
}
export interface BioCellProps extends StaticCellProps {
avatarName?: string,
avatarSize?: string | number,
photoComponent?: ReactNode,
photoSource?: object,
photoStyle?: ImageStyle,
}
export interface TouchableCellProps extends AccessoryCellProps {
title: string,
titleStyle?: TextStyle,
}
export default class Table extends Component<TableProps> {
}
export { Table };
export class Section extends Component<SectionProps> {
}
export class Cell extends Component<CellProps> {
}
export class AccessoryCell extends Component<AccessoryCellProps> {
}
export class IconCell extends Component<IconCellProps> {
}
export class StaticCell extends Component<StaticCellProps> {
}
export class KeyValueCell extends Component<KeyValueCellProps> {
}
export class SwitchCell extends Component<SwitchCellProps> {
}
export class BioCell extends Component<BioCellProps> {
}
export class TouchableCell extends Component<TouchableCellProps> {
}
declare const ThemeContext: Context<Theme>;
declare const ThemeProvider: Provider<Theme>;
declare const ThemeConsumer: Consumer<Theme>;
export { ThemeContext, ThemeProvider, ThemeConsumer };
declare function blendColors(theme: Theme, color: string, accent: string): string;
declare function getColorPalette(theme: Theme, blend: boolean, accent: string): ColorPalette;
export { blendColors, getColorPalette };