index.d.ts 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283
  1. import * as _angular_core from '@angular/core';
  2. import { OnInit } from '@angular/core';
  3. import * as _angular_platform_browser from '@angular/platform-browser';
  4. import { FlipProp, SizeProp, PullProp, RotateProp, IconName as IconName$1, IconPrefix as IconPrefix$1, FaSymbol, Transform, IconDefinition as IconDefinition$1, IconParams, TextParams, CounterParams } from '@fortawesome/fontawesome-svg-core';
  5. export { CounterParams, FaSymbol, FlipProp, IconParams, PullProp, RotateProp, SizeProp, TextParams, Transform } from '@fortawesome/fontawesome-svg-core';
  6. /**
  7. * Fontawesome props.
  8. */
  9. interface FaProps {
  10. className?: string;
  11. animation?: AnimationProp;
  12. border?: boolean;
  13. fixedWidth?: boolean;
  14. counter?: boolean;
  15. inverse?: boolean;
  16. flip?: FlipProp;
  17. size?: SizeProp;
  18. pull?: PullProp;
  19. rotate?: RotateProp | string;
  20. stackItemSize?: '1x' | '2x';
  21. }
  22. type AnimationProp = 'beat' | 'fade' | 'beat-fade' | 'bounce' | 'flip' | 'shake' | 'spin' | 'spin-reverse' | 'spin-pulse' | 'spin-pulse-reverse';
  23. type IconPrefix = IconPrefix$1 | (string & {});
  24. type IconName = IconName$1 | (string & {});
  25. interface IconLookup {
  26. prefix: IconPrefix;
  27. iconName: IconName;
  28. }
  29. interface IconDefinition {
  30. prefix: IconPrefix;
  31. iconName: IconName;
  32. icon: [
  33. number,
  34. number,
  35. string[],
  36. string,
  37. // unicode
  38. string | string[]
  39. ];
  40. }
  41. interface IconPack {
  42. [key: string]: IconDefinition;
  43. }
  44. type IconProp = IconName | [IconPrefix, IconName] | IconLookup;
  45. declare class FaIconComponent {
  46. readonly icon: _angular_core.ModelSignal<IconProp>;
  47. /**
  48. * Specify a title for the icon.
  49. *
  50. * This text will be displayed in a tooltip on hover and presented to the
  51. * screen readers.
  52. */
  53. readonly title: _angular_core.ModelSignal<string | undefined>;
  54. /**
  55. * Icon animation.
  56. *
  57. * Most of the animations are only available when using Font Awesome 6. With
  58. * Font Awesome 5, only 'spin' and 'spin-pulse' are supported.
  59. */
  60. readonly animation: _angular_core.ModelSignal<AnimationProp | undefined>;
  61. readonly mask: _angular_core.ModelSignal<IconProp | undefined>;
  62. readonly flip: _angular_core.ModelSignal<FlipProp | undefined>;
  63. readonly size: _angular_core.ModelSignal<SizeProp | undefined>;
  64. readonly pull: _angular_core.ModelSignal<PullProp | undefined>;
  65. readonly border: _angular_core.ModelSignal<boolean | undefined>;
  66. readonly inverse: _angular_core.ModelSignal<boolean | undefined>;
  67. readonly symbol: _angular_core.ModelSignal<FaSymbol | undefined>;
  68. readonly rotate: _angular_core.ModelSignal<string | RotateProp | undefined>;
  69. readonly fixedWidth: _angular_core.ModelSignal<boolean | undefined>;
  70. readonly transform: _angular_core.ModelSignal<string | Transform | undefined>;
  71. /**
  72. * Specify the `role` attribute for the rendered <svg> element.
  73. *
  74. * @default 'img'
  75. */
  76. readonly a11yRole: _angular_core.ModelSignal<string | undefined>;
  77. readonly renderedIconHTML: _angular_core.Signal<_angular_platform_browser.SafeHtml>;
  78. private readonly document;
  79. private readonly sanitizer;
  80. private readonly config;
  81. private readonly iconLibrary;
  82. private readonly stackItem;
  83. private readonly stack;
  84. constructor();
  85. protected findIconDefinition(i: IconProp | IconDefinition): IconDefinition$1 | null;
  86. protected buildParams(): IconParams;
  87. static ɵfac: _angular_core.ɵɵFactoryDeclaration<FaIconComponent, never>;
  88. static ɵcmp: _angular_core.ɵɵComponentDeclaration<FaIconComponent, "fa-icon", never, { "icon": { "alias": "icon"; "required": true; "isSignal": true; }; "title": { "alias": "title"; "required": false; "isSignal": true; }; "animation": { "alias": "animation"; "required": false; "isSignal": true; }; "mask": { "alias": "mask"; "required": false; "isSignal": true; }; "flip": { "alias": "flip"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "pull": { "alias": "pull"; "required": false; "isSignal": true; }; "border": { "alias": "border"; "required": false; "isSignal": true; }; "inverse": { "alias": "inverse"; "required": false; "isSignal": true; }; "symbol": { "alias": "symbol"; "required": false; "isSignal": true; }; "rotate": { "alias": "rotate"; "required": false; "isSignal": true; }; "fixedWidth": { "alias": "fixedWidth"; "required": false; "isSignal": true; }; "transform": { "alias": "transform"; "required": false; "isSignal": true; }; "a11yRole": { "alias": "a11yRole"; "required": false; "isSignal": true; }; }, { "icon": "iconChange"; "title": "titleChange"; "animation": "animationChange"; "mask": "maskChange"; "flip": "flipChange"; "size": "sizeChange"; "pull": "pullChange"; "border": "borderChange"; "inverse": "inverseChange"; "symbol": "symbolChange"; "rotate": "rotateChange"; "fixedWidth": "fixedWidthChange"; "transform": "transformChange"; "a11yRole": "a11yRoleChange"; }, never, never, true, never>;
  89. }
  90. declare class FaDuotoneIconComponent extends FaIconComponent {
  91. /**
  92. * Swap the default opacity of each duotone icon’s layers. This will make an
  93. * icon’s primary layer have the default opacity of 40% rather than its
  94. * secondary layer.
  95. *
  96. * @default false
  97. */
  98. readonly swapOpacity: _angular_core.InputSignal<boolean | "true" | "false" | undefined>;
  99. /**
  100. * Customize the opacity of the primary icon layer.
  101. * Valid values are in range [0, 1.0].
  102. *
  103. * @default 1.0
  104. */
  105. readonly primaryOpacity: _angular_core.InputSignal<string | number | undefined>;
  106. /**
  107. * Customize the opacity of the secondary icon layer.
  108. * Valid values are in range [0, 1.0].
  109. *
  110. * @default 0.4
  111. */
  112. readonly secondaryOpacity: _angular_core.InputSignal<string | number | undefined>;
  113. /**
  114. * Customize the color of the primary icon layer.
  115. * Accepts any valid CSS color value.
  116. *
  117. * @default CSS inherited color
  118. */
  119. readonly primaryColor: _angular_core.InputSignal<string | undefined>;
  120. /**
  121. * Customize the color of the secondary icon layer.
  122. * Accepts any valid CSS color value.
  123. *
  124. * @default CSS inherited color
  125. */
  126. readonly secondaryColor: _angular_core.InputSignal<string | undefined>;
  127. protected findIconDefinition(i: IconProp | IconDefinition): IconDefinition$1 | null;
  128. protected buildParams(): IconParams;
  129. static ɵfac: _angular_core.ɵɵFactoryDeclaration<FaDuotoneIconComponent, never>;
  130. static ɵcmp: _angular_core.ɵɵComponentDeclaration<FaDuotoneIconComponent, "fa-duotone-icon", never, { "swapOpacity": { "alias": "swapOpacity"; "required": false; "isSignal": true; }; "primaryOpacity": { "alias": "primaryOpacity"; "required": false; "isSignal": true; }; "secondaryOpacity": { "alias": "secondaryOpacity"; "required": false; "isSignal": true; }; "primaryColor": { "alias": "primaryColor"; "required": false; "isSignal": true; }; "secondaryColor": { "alias": "secondaryColor"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
  131. }
  132. /**
  133. * Fontawesome layers.
  134. */
  135. declare class FaLayersComponent implements OnInit {
  136. readonly size: _angular_core.InputSignal<SizeProp | undefined>;
  137. readonly fixedWidth: _angular_core.InputSignal<boolean | undefined>;
  138. readonly faFw: _angular_core.Signal<boolean | undefined>;
  139. readonly classes: _angular_core.Signal<{
  140. 'fa-fw': boolean | undefined;
  141. 'fa-layers': boolean;
  142. }>;
  143. private readonly document;
  144. private readonly config;
  145. ngOnInit(): void;
  146. static ɵfac: _angular_core.ɵɵFactoryDeclaration<FaLayersComponent, never>;
  147. static ɵcmp: _angular_core.ɵɵComponentDeclaration<FaLayersComponent, "fa-layers", never, { "size": { "alias": "size"; "required": false; "isSignal": true; }; "fixedWidth": { "alias": "fixedWidth"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
  148. }
  149. declare class FaLayersTextComponent {
  150. readonly content: _angular_core.InputSignal<string>;
  151. readonly title: _angular_core.InputSignal<string | undefined>;
  152. readonly flip: _angular_core.InputSignal<FlipProp | undefined>;
  153. readonly size: _angular_core.InputSignal<SizeProp | undefined>;
  154. readonly pull: _angular_core.InputSignal<PullProp | undefined>;
  155. readonly border: _angular_core.InputSignal<boolean | undefined>;
  156. readonly inverse: _angular_core.InputSignal<boolean | undefined>;
  157. readonly rotate: _angular_core.InputSignal<string | RotateProp | undefined>;
  158. readonly fixedWidth: _angular_core.InputSignal<boolean | undefined>;
  159. readonly transform: _angular_core.InputSignal<string | Transform | undefined>;
  160. readonly renderedHTML: _angular_core.Signal<_angular_platform_browser.SafeHtml>;
  161. private readonly document;
  162. private readonly config;
  163. private readonly parent;
  164. private readonly sanitizer;
  165. constructor();
  166. /**
  167. * Updating params by component props.
  168. */
  169. protected buildParams(): TextParams;
  170. private updateContent;
  171. static ɵfac: _angular_core.ɵɵFactoryDeclaration<FaLayersTextComponent, never>;
  172. static ɵcmp: _angular_core.ɵɵComponentDeclaration<FaLayersTextComponent, "fa-layers-text", never, { "content": { "alias": "content"; "required": true; "isSignal": true; }; "title": { "alias": "title"; "required": false; "isSignal": true; }; "flip": { "alias": "flip"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "pull": { "alias": "pull"; "required": false; "isSignal": true; }; "border": { "alias": "border"; "required": false; "isSignal": true; }; "inverse": { "alias": "inverse"; "required": false; "isSignal": true; }; "rotate": { "alias": "rotate"; "required": false; "isSignal": true; }; "fixedWidth": { "alias": "fixedWidth"; "required": false; "isSignal": true; }; "transform": { "alias": "transform"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
  173. }
  174. declare class FaLayersCounterComponent {
  175. readonly content: _angular_core.InputSignal<string>;
  176. readonly title: _angular_core.InputSignal<string | undefined>;
  177. readonly position: _angular_core.InputSignal<"bottom-right" | "bottom-left" | "top-right" | "top-left" | undefined>;
  178. readonly renderedHTML: _angular_core.Signal<_angular_platform_browser.SafeHtml>;
  179. private document;
  180. private config;
  181. private parent;
  182. private sanitizer;
  183. constructor();
  184. protected buildParams(): CounterParams;
  185. private updateContent;
  186. static ɵfac: _angular_core.ɵɵFactoryDeclaration<FaLayersCounterComponent, never>;
  187. static ɵcmp: _angular_core.ɵɵComponentDeclaration<FaLayersCounterComponent, "fa-layers-counter", never, { "content": { "alias": "content"; "required": true; "isSignal": true; }; "title": { "alias": "title"; "required": false; "isSignal": true; }; "position": { "alias": "position"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
  188. }
  189. declare class FaStackComponent {
  190. /**
  191. * Size of the stacked icon.
  192. * Note that stacked icon is by default 2 times bigger, than non-stacked icon.
  193. * You'll need to set size using custom CSS to align stacked icon with a
  194. * simple one. E.g. `fa-stack { font-size: 0.5em; }`.
  195. */
  196. readonly size: _angular_core.InputSignal<SizeProp | undefined>;
  197. readonly classes: _angular_core.Signal<{
  198. 'fa-stack': boolean;
  199. }>;
  200. static ɵfac: _angular_core.ɵɵFactoryDeclaration<FaStackComponent, never>;
  201. static ɵcmp: _angular_core.ɵɵComponentDeclaration<FaStackComponent, "fa-stack", never, { "size": { "alias": "size"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
  202. }
  203. declare class FaStackItemSizeDirective {
  204. /**
  205. * Specify whether icon inside {@link FaStackComponent} should be rendered in
  206. * regular size (1x) or as a larger icon (2x).
  207. */
  208. readonly stackItemSize: _angular_core.InputSignal<"1x" | "2x">;
  209. _effect: _angular_core.EffectRef;
  210. static ɵfac: _angular_core.ɵɵFactoryDeclaration<FaStackItemSizeDirective, never>;
  211. static ɵdir: _angular_core.ɵɵDirectiveDeclaration<FaStackItemSizeDirective, "fa-icon[stackItemSize],fa-duotone-icon[stackItemSize]", never, { "stackItemSize": { "alias": "stackItemSize"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
  212. }
  213. declare class FontAwesomeModule {
  214. static ɵfac: _angular_core.ɵɵFactoryDeclaration<FontAwesomeModule, never>;
  215. static ɵmod: _angular_core.ɵɵNgModuleDeclaration<FontAwesomeModule, never, [typeof FaIconComponent, typeof FaDuotoneIconComponent, typeof FaLayersComponent, typeof FaLayersTextComponent, typeof FaLayersCounterComponent, typeof FaStackComponent, typeof FaStackItemSizeDirective], [typeof FaIconComponent, typeof FaDuotoneIconComponent, typeof FaLayersComponent, typeof FaLayersTextComponent, typeof FaLayersCounterComponent, typeof FaStackComponent, typeof FaStackItemSizeDirective]>;
  216. static ɵinj: _angular_core.ɵɵInjectorDeclaration<FontAwesomeModule>;
  217. }
  218. declare class FaConfig {
  219. /**
  220. * Default prefix to use, when one is not provided with the icon name.
  221. *
  222. * @default 'fas'
  223. */
  224. defaultPrefix: IconPrefix;
  225. /**
  226. * Provides a fallback icon to use whilst main icon is being loaded asynchronously.
  227. * When value is null, then fa-icon component will throw an error if icon input is missing.
  228. * When value is not null, then the provided icon will be used as a fallback icon if icon input is missing.
  229. *
  230. * @default null
  231. */
  232. fallbackIcon: IconDefinition | null;
  233. /**
  234. * Set icons to the same fixed width.
  235. *
  236. * @see {@link: https://fontawesome.com/how-to-use/on-the-web/styling/fixed-width-icons}
  237. * @default false
  238. */
  239. fixedWidth?: boolean;
  240. /**
  241. * Automatically add Font Awesome styles to the document when icon is rendered.
  242. *
  243. * For the majority of the cases the automatically added CSS is sufficient,
  244. * please refer to the linked guide for more information on when to disable
  245. * this feature.
  246. *
  247. * @see {@link: https://github.com/FortAwesome/angular-fontawesome/blob/main/docs/guide/adding-css.md}
  248. * @default true
  249. */
  250. set autoAddCss(value: boolean);
  251. get autoAddCss(): boolean;
  252. private _autoAddCss;
  253. static ɵfac: _angular_core.ɵɵFactoryDeclaration<FaConfig, never>;
  254. static ɵprov: _angular_core.ɵɵInjectableDeclaration<FaConfig>;
  255. }
  256. interface FaIconLibraryInterface {
  257. addIcons(...icons: IconDefinition[]): void;
  258. addIconPacks(...packs: IconPack[]): void;
  259. getIconDefinition(prefix: IconPrefix, name: IconName): IconDefinition | null;
  260. }
  261. declare class FaIconLibrary implements FaIconLibraryInterface {
  262. private definitions;
  263. addIcons(...icons: IconDefinition[]): void;
  264. addIconPacks(...packs: IconPack[]): void;
  265. getIconDefinition(prefix: IconPrefix, name: IconName): IconDefinition | null;
  266. static ɵfac: _angular_core.ɵɵFactoryDeclaration<FaIconLibrary, never>;
  267. static ɵprov: _angular_core.ɵɵInjectableDeclaration<FaIconLibrary>;
  268. }
  269. export { FaConfig, FaDuotoneIconComponent, FaIconComponent, FaIconLibrary, FaLayersComponent, FaLayersCounterComponent, FaLayersTextComponent, FaStackComponent, FaStackItemSizeDirective, FontAwesomeModule };
  270. export type { AnimationProp, FaIconLibraryInterface, FaProps, IconDefinition, IconLookup, IconName, IconPack, IconPrefix };