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