UNPKG

1.27 kBTypeScriptView Raw
1import { Component } from "react";
2import { Icon, IconProps, ImageSource } from "./Icon";
3
4export const FA5Style: {
5 regular: 0;
6 light: 1;
7 solid: 2;
8 brand: 3;
9};
10
11export type ValueOf<T> = T[keyof T];
12
13// borrowed from
14// https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-8.html
15export type Omit<T, K> = Pick<T, Exclude<keyof T, K>>;
16
17export type FontAwesome5IconVariants = keyof Omit<typeof FA5Style, "regular">;
18
19export type FontAwesome5IconProps = { [K in FontAwesome5IconVariants]?: boolean } & IconProps;
20
21export default class FontAwesome5Icon extends Component<
22 FontAwesome5IconProps,
23 any
24> {
25 static getImageSource(
26 name: string,
27 size?: number,
28 color?: string,
29 fa5Style?: ValueOf<typeof FA5Style>
30 ): Promise<ImageSource>;
31 static getImageSourceSync(
32 name: string,
33 size?: number,
34 color?: string,
35 fa5Style?: ValueOf<typeof FA5Style>
36 ): ImageSource;
37 static loadFont(file?: string): Promise<void>;
38 static hasIcon(name: string): boolean;
39 static ToolbarAndroid: typeof Icon.ToolbarAndroid;
40 static TabBarItem: typeof Icon.TabBarItem;
41 static TabBarItemIOS: typeof Icon.TabBarItemIOS;
42 static Button: typeof Icon.Button;
43}