1 | import { Component } from "react";
|
2 | import { Icon, IconProps, ImageSource } from "./Icon";
|
3 |
|
4 | export const FA5Style: {
|
5 | regular: 0;
|
6 | light: 1;
|
7 | solid: 2;
|
8 | brand: 3;
|
9 | };
|
10 |
|
11 | export type ValueOf<T> = T[keyof T];
|
12 |
|
13 |
|
14 |
|
15 | export type Omit<T, K> = Pick<T, Exclude<keyof T, K>>;
|
16 |
|
17 | export type FontAwesome5IconVariants = keyof Omit<typeof FA5Style, "regular">;
|
18 |
|
19 |
|
20 | export type AllowOnlyOne<T, Keys extends keyof T = keyof T> = Omit<T, Keys> &
|
21 | {
|
22 | [K in Keys]-?: Partial<Pick<T, K>> &
|
23 | Partial<Record<Exclude<Keys, K>, undefined>>
|
24 | }[Keys];
|
25 |
|
26 | export type FontAwesome5IconProps = AllowOnlyOne<
|
27 | { [K in FontAwesome5IconVariants]?: boolean } & IconProps,
|
28 | FontAwesome5IconVariants
|
29 | >;
|
30 |
|
31 | export default class FontAwesome5Icon extends Component<
|
32 | FontAwesome5IconProps,
|
33 | any
|
34 | > {
|
35 | static getImageSource(
|
36 | name: string,
|
37 | size?: number,
|
38 | color?: string,
|
39 | fa5Style?: ValueOf<typeof FA5Style>
|
40 | ): Promise<ImageSource>;
|
41 | static getImageSourceSync(
|
42 | name: string,
|
43 | size?: number,
|
44 | color?: string,
|
45 | fa5Style?: ValueOf<typeof FA5Style>
|
46 | ): ImageSource;
|
47 | static loadFont(file?: string): Promise<void>;
|
48 | static hasIcon(name: string): boolean;
|
49 | static ToolbarAndroid: typeof Icon.ToolbarAndroid;
|
50 | static TabBarItem: typeof Icon.TabBarItem;
|
51 | static TabBarItemIOS: typeof Icon.TabBarItemIOS;
|
52 | static Button: typeof Icon.Button;
|
53 | }
|