UNPKG

1.75 kBTypeScriptView Raw
1import React, { ComponentClass } from "react";
2import { TextProps, TouchableHighlightProps, ViewProps } from "react-native";
3export { DEFAULT_ICON_COLOR, DEFAULT_ICON_SIZE } from "./vendor/react-native-vector-icons/lib/create-icon-set";
4export interface IconButtonProps<GLYPHS extends string> extends ViewProps, TouchableHighlightProps {
5 /**
6 * Size of the icon, can also be passed as fontSize in the style object.
7 *
8 * @default 12
9 */
10 size?: number;
11 /**
12 * Name of the icon to show
13 *
14 * See Icon Explorer app
15 * {@link https://expo.github.io/vector-icons/}
16 */
17 name: GLYPHS;
18 /**
19 * Color of the icon
20 *
21 */
22 color?: string;
23}
24export interface IconProps<GLYPHS extends string> extends TextProps {
25 /**
26 * Size of the icon, can also be passed as fontSize in the style object.
27 *
28 * @default 12
29 */
30 size?: number;
31 /**
32 * Name of the icon to show
33 *
34 * See Icon Explorer app
35 * {@link https://expo.github.io/vector-icons/}
36 */
37 name: GLYPHS;
38 /**
39 * Color of the icon
40 *
41 */
42 color?: string;
43}
44export declare type GlyphMap<G extends string> = {
45 [K in G]: number;
46};
47export interface Icon<G extends string, FN extends string> {
48 propTypes: any;
49 defaultProps: any;
50 Button: ComponentClass<IconButtonProps<G>>;
51 glyphMap: GlyphMap<G>;
52 getRawGlyphMap: () => GlyphMap<G>;
53 getFontFamily: () => FN;
54 loadFont: () => Promise<void>;
55 font: {
56 [x: string]: any;
57 };
58 new (props: IconProps<G>): React.Component<IconProps<G>>;
59}
60export default function <G extends string, FN extends string>(glyphMap: GlyphMap<G>, fontName: FN, expoAssetId: any, fontStyle?: any): Icon<G, FN>;