1 | import {IconDefinition, IconLookup, IconName, IconPrefix, IconPack } from '@fortawesome/fontawesome-common-types';
|
2 | export {IconDefinition, IconLookup, IconName, IconPrefix, IconPack } from '@fortawesome/fontawesome-common-types';
|
3 | export const dom: DOM;
|
4 | export const library: Library;
|
5 | export const parse: { transform(transformString: string): Transform };
|
6 | export const config: Config;
|
7 | export function noAuto():void;
|
8 | export function findIconDefinition(iconLookup: IconLookup): IconDefinition;
|
9 | export function text(content: string, params?: TextParams): Text;
|
10 | export function counter(content: string | number, params?: CounterParams): Counter;
|
11 | export function toHtml(content: any): string;
|
12 | export function toHtml(abstractNodes: AbstractElement): string;
|
13 | export function layer(
|
14 | assembler: (
|
15 | addLayerCallback: (layerToAdd: IconOrText | IconOrText[]) => void
|
16 | ) => void
|
17 | ): Layer;
|
18 | export function icon(icon: IconName | IconLookup, params?: IconParams): Icon;
|
19 | export type IconProp = IconName | [IconPrefix, IconName] | IconLookup;
|
20 | export type FlipProp = "horizontal" | "vertical" | "both";
|
21 | export type SizeProp =
|
22 | | "xs"
|
23 | | "lg"
|
24 | | "sm"
|
25 | | "1x"
|
26 | | "2x"
|
27 | | "3x"
|
28 | | "4x"
|
29 | | "5x"
|
30 | | "6x"
|
31 | | "7x"
|
32 | | "8x"
|
33 | | "9x"
|
34 | | "10x";
|
35 | export type PullProp = "left" | "right";
|
36 | export type RotateProp = 90 | 180 | 270;
|
37 | export type FaSymbol = string | boolean;
|
38 | export interface Config {
|
39 | familyPrefix: IconPrefix;
|
40 | replacementClass: string;
|
41 | autoReplaceSvg: boolean | 'nest';
|
42 | autoAddCss: boolean;
|
43 | autoA11y: boolean;
|
44 | searchPseudoElements: boolean;
|
45 | observeMutations: boolean;
|
46 | keepOriginalSource: boolean;
|
47 | measurePerformance: boolean;
|
48 | showMissingIcons: boolean;
|
49 | }
|
50 | export interface AbstractElement {
|
51 | tag: string;
|
52 | attributes: any;
|
53 | children?: AbstractElement[];
|
54 | }
|
55 | export interface FontawesomeObject {
|
56 | readonly abstract: AbstractElement[];
|
57 | readonly html: string[];
|
58 | readonly node: HTMLCollection;
|
59 | }
|
60 | export interface Icon extends FontawesomeObject, IconDefinition {
|
61 | readonly type: "icon";
|
62 | }
|
63 | export interface Text extends FontawesomeObject {
|
64 | readonly type: "text";
|
65 | }
|
66 | export interface Counter extends FontawesomeObject {
|
67 | readonly type: "counter";
|
68 | }
|
69 | export interface Layer extends FontawesomeObject {
|
70 | readonly type: "layer";
|
71 | }
|
72 | type IconOrText = Icon | Text;
|
73 | export interface Attributes {
|
74 | [key: string]: number | string;
|
75 | }
|
76 | export interface Styles {
|
77 | [key: string]: string;
|
78 | }
|
79 | export interface Transform {
|
80 | size?: number;
|
81 | x?: number;
|
82 | y?: number;
|
83 | rotate?: number;
|
84 | flipX?: boolean;
|
85 | flipY?: boolean;
|
86 | }
|
87 | export interface Params {
|
88 | title?: string;
|
89 | classes?: string | string[];
|
90 | attributes?: Attributes;
|
91 | styles?: Styles;
|
92 | }
|
93 | export interface CounterParams extends Params {
|
94 | }
|
95 | export interface TextParams extends Params {
|
96 | transform?: Transform;
|
97 | }
|
98 | export interface IconParams extends Params {
|
99 | transform?: Transform;
|
100 | symbol?: FaSymbol;
|
101 | mask?: IconLookup;
|
102 | }
|
103 | export interface DOM {
|
104 | i2svg(params?: { node: Node; callback: () => void }): Promise<void>;
|
105 | css(): string;
|
106 | insertCss(): string;
|
107 | watch(): void;
|
108 | }
|
109 | type IconDefinitionOrPack = IconDefinition | IconPack;
|
110 | export interface Library {
|
111 | add(...definitions: IconDefinitionOrPack[]): void;
|
112 | reset(): void;
|
113 | }
|