This repository has been archived by the owner on Sep 15, 2023. It is now read-only.
forked from oblador/react-native-vector-icons
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js.flow
116 lines (97 loc) · 2.59 KB
/
index.js.flow
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
/**
* @flow strict
*/
import { PureComponent } from 'react';
export type Color = number | string;
export type IconButtonProps<Glyphs: string> = {
backgroundColor?: Color,
borderRadius?: number,
color?: Color,
name: Glyphs,
size?: number,
};
declare class IconButton<Glyphs: string> extends PureComponent<
IconButtonProps<Glyphs>
> {}
export type IconToolbarAndroidActions<Glyphs: string> = {
iconColor?: Color,
iconName?: Glyphs,
iconSize?: number,
show?: 'always' | 'ifRoom' | 'never',
showWithText?: boolean,
title: string,
};
export type IconToolbarAndroidProps<Glyphs: string> = {
actions: IconToolbarAndroidActions<Glyphs>[],
iconColor?: Color,
iconSize?: number,
logoName?: Glyphs,
navIconName?: Glyphs,
overflowIconName?: Glyphs,
titleColor?: Color,
};
declare class IconToolbarAndroid<Glyphs: string> extends PureComponent<
IconToolbarAndroidProps<Glyphs>
> {}
export type TabBarItemIOSProps<Glyphs: string> = {
iconColor?: Color,
iconName: Glyphs,
iconSize?: number,
selectedIconColor?: Color,
selectedIconName?: Glyphs,
};
declare class TabBarItemIOS<Glyphs: string> extends PureComponent<
TabBarItemIOSProps<Glyphs>
> {}
export type IconProps<Glyphs: string> = {
allowFontScaling?: boolean,
color?: Color,
name: Glyphs,
size?: number,
};
export type ImageSource = {|
uri: string,
scale: number,
|};
declare class Icon<Glyphs: string> extends PureComponent<IconProps<Glyphs>> {
static Button: Class<IconButton<Glyphs>>;
static TabBarItem: Class<TabBarItemIOS<Glyphs>>;
static TabBarItemIOS: Class<TabBarItemIOS<Glyphs>>;
static ToolbarAndroid: Class<IconToolbarAndroid<Glyphs>>;
static getFontFamily(): string;
static getImageSource(
name: Glyphs,
size?: number,
color?: Color
): Promise<ImageSource>;
static getRawGlyphMap(): { [name: Glyphs]: number };
static hasIcon(name: string): boolean;
static loadFont(file?: string): Promise<void>;
}
export type { Icon };
declare export function createIconSet<GlyphMap: { [key: string]: number }>(
glyphMap: GlyphMap,
fontFamily: string,
fontFile?: string
): Class<Icon<$Keys<GlyphMap>>>;
export type FontelloConfig = {
glyphs: Array<{
css: string,
code: number,
}>,
};
declare export function createIconSetFromFontello(
config: FontelloConfig,
fontFamily?: string,
fontFile?: string
): Class<Icon<string>>;
export type IcoMoonConfig = {
icons: Array<{
properties: { name: string, code: number },
}>,
};
declare export function createIconSetFromIcoMoon(
config: IcoMoonConfig,
fontFamily?: string,
fontFile?: string
): Class<Icon<string>>;