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