1 | import * as React from 'react';
|
2 | import {
|
3 | TextStyle,
|
4 | ViewStyle,
|
5 | TextProps,
|
6 | TouchableHighlightProps,
|
7 | TouchableNativeFeedbackProps,
|
8 | TabBarIOSItemProps,
|
9 | ToolbarAndroidProps as ReactNativeToolbarAndroidProps
|
10 | } from 'react-native';
|
11 |
|
12 | export interface IconProps extends TextProps {
|
13 | |
14 |
|
15 |
|
16 |
|
17 |
|
18 | size?: number;
|
19 |
|
20 | |
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 | name: string;
|
27 |
|
28 | |
29 |
|
30 |
|
31 |
|
32 | color?: string;
|
33 | }
|
34 |
|
35 | export interface IconButtonProps extends IconProps, TouchableHighlightProps, TouchableNativeFeedbackProps {
|
36 | |
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 | color?: string;
|
43 |
|
44 | |
45 |
|
46 |
|
47 |
|
48 |
|
49 |
|
50 | borderRadius?: number;
|
51 |
|
52 | |
53 |
|
54 |
|
55 |
|
56 |
|
57 |
|
58 | iconStyle?: TextStyle;
|
59 |
|
60 | |
61 |
|
62 |
|
63 |
|
64 |
|
65 | style?: ViewStyle | TextStyle;
|
66 |
|
67 | |
68 |
|
69 |
|
70 |
|
71 |
|
72 | backgroundColor?: string;
|
73 | }
|
74 |
|
75 | export type ImageSource = any;
|
76 |
|
77 | export interface ToolbarAndroidProps extends ReactNativeToolbarAndroidProps {
|
78 | |
79 |
|
80 |
|
81 |
|
82 |
|
83 | logoName: string;
|
84 |
|
85 | |
86 |
|
87 |
|
88 |
|
89 |
|
90 | navIconName: string;
|
91 |
|
92 | |
93 |
|
94 |
|
95 |
|
96 |
|
97 | overflowIconName: string;
|
98 |
|
99 | |
100 |
|
101 |
|
102 |
|
103 |
|
104 | iconSize: number;
|
105 |
|
106 | |
107 |
|
108 |
|
109 |
|
110 |
|
111 | iconColor: string;
|
112 | }
|
113 |
|
114 | export interface TabBarItemIOSProps extends TabBarIOSItemProps {
|
115 | |
116 |
|
117 |
|
118 |
|
119 | iconName: string;
|
120 |
|
121 | |
122 |
|
123 |
|
124 |
|
125 |
|
126 |
|
127 | selectedIconName?: string;
|
128 |
|
129 | |
130 |
|
131 |
|
132 |
|
133 |
|
134 | iconSize?: number;
|
135 |
|
136 | |
137 |
|
138 |
|
139 |
|
140 | iconColor?: string;
|
141 |
|
142 | |
143 |
|
144 |
|
145 |
|
146 |
|
147 |
|
148 | selectedIconColor?: string;
|
149 | }
|
150 |
|
151 | export class Icon extends React.Component<IconProps, any> {
|
152 | static getImageSource(
|
153 | name: string,
|
154 | size?: number,
|
155 | color?: string,
|
156 | ): Promise<ImageSource>;
|
157 | static getImageSourceSync(
|
158 | name: string,
|
159 | size?: number,
|
160 | color?: string,
|
161 | ): ImageSource;
|
162 | static getRawGlyphMap(): { [name: string]: number };
|
163 | static loadFont(
|
164 | file?: string
|
165 | ): Promise<void>;
|
166 | static hasIcon(
|
167 | name: string,
|
168 | ): boolean;
|
169 | }
|
170 |
|
171 | export namespace Icon {
|
172 | class ToolbarAndroid extends React.Component<ToolbarAndroidProps, any> {}
|
173 | class TabBarItem extends React.Component<TabBarItemIOSProps, any> {}
|
174 | class TabBarItemIOS extends React.Component<TabBarItemIOSProps, any> {}
|
175 | class Button extends React.Component<IconButtonProps, any> {}
|
176 | }
|