import { IconName } from '@fortawesome/fontawesome-svg-core'; import { FontAwesomeIconProps } from '@fortawesome/react-fontawesome'; import { HoistProps, Intent, Thunkable } from '@xh/hoist/core'; import { ReactElement } from 'react'; import { SetRequired } from 'type-fest'; import './Icon.scss'; export interface IconProps extends HoistProps, Partial> { /** Name of the icon in FontAwesome. */ iconName?: IconName; /** Weight / family style of the icon. */ prefix?: HoistIconPrefix; intent?: Intent; /** Optional tooltip string. */ title?: string; /** Size of the icon, as specified by the FontAwesome API. */ size?: '2xs' | 'xs' | 'sm' | 'lg' | 'xl' | '2xl' | '1x' | '2x' | '3x' | '4x' | '5x' | '6x' | '7x' | '8x' | '9x' | '10x'; /** Set to true to return the output as a string containing the raw tag.*/ asHtml?: boolean; /** True to skip rendering this Icon. */ omit?: Thunkable; } /** * Icon props after defaults applied by Hoist factory methods. * @internal */ export interface ResolvedIconProps extends IconProps { iconName: IconName; prefix: HoistIconPrefix; } /** Supported FA prefixes, used to request a family-specific variant of an icon. */ export type HoistIconPrefix = 'far' | 'fas' | 'fal' | 'fat' | 'fab'; /** * Singleton class to provide factories for creating standard FontAwesome-based icons. * * Hoist imports the licensed "pro" library with additional icons - note this requires fetching the * FA npm package via a registry URL w/license token. * * See https://fontawesome.com/pro#license. */ export declare const Icon: { /** * Return a Hoist element wrapper around a FontAwesome-based icon. * * Note that for an app to use an icon with this factory, its definition must have been already * imported and registered with FontAwesome. Apps will find many/most of the icons they need * pre-registered and enumerated by the Hoist factories below. Favor those ready-made factories * wherever possible for consistency across and within apps. * * If the FA icon of your dreams is not available, however, you can do a one-time import within * your app bootstrap code, eg: * ``` * import {library} from '@fortawesome/fontawesome-svg-core'; * import {faDreamIcon} from '@fortawesome/pro-regular-svg-icons'; * library.add(faDreamIcon); * ``` * and then pass its string name to this factory: `icon({iconName: 'dream-icon'})` */ icon(opts: SetRequired): any; addressCard(p?: IconProps): any; angleDoubleDown(p?: IconProps): any; angleDoubleLeft(p?: IconProps): any; angleDoubleRight(p?: IconProps): any; angleDoubleUp(p?: IconProps): any; angleDown(p?: IconProps): any; angleLeft(p?: IconProps): any; angleRight(p?: IconProps): any; angleUp(p?: IconProps): any; arrowDown(p?: IconProps): any; arrowDownToBracket(p?: IconProps): any; arrowLeft(p?: IconProps): any; arrowRight(p?: IconProps): any; arrowRightArrowLeft(p?: IconProps): any; arrowToBottom(p?: IconProps): any; arrowToLeft(p?: IconProps): any; arrowToRight(p?: IconProps): any; arrowToTop(p?: IconProps): any; arrowUp(p?: IconProps): any; arrowUpFromBracket(p?: IconProps): any; arrowsLeftRight(p?: IconProps): any; arrowsRotate(p?: IconProps): any; arrowsUpDown(p?: IconProps): any; balanceScale(p?: IconProps): any; balanceScaleLeft(p?: IconProps): any; balanceScaleRight(p?: IconProps): any; bars(p?: IconProps): any; bolt(p?: IconProps): any; book(p?: IconProps): any; bookmark(p?: IconProps): any; books(p?: IconProps): any; box(p?: IconProps): any; boxFull(p?: IconProps): any; browser(p?: IconProps): any; bullhorn(p?: IconProps): any; calculator(p?: IconProps): any; calendar(p?: IconProps): any; camera(p?: IconProps): any; caretLeft(p?: IconProps): any; caretRight(p?: IconProps): any; chartArea(p?: IconProps): any; chartBar(p?: IconProps): any; chartLine(p?: IconProps): any; chartPie(p?: IconProps): any; check(p?: IconProps): any; checkCircle(p?: IconProps): any; checkSquare(p?: IconProps): any; chess(p?: IconProps): any; chessKnight(p?: IconProps): any; chevronDown(p?: IconProps): any; chevronLeft(p?: IconProps): any; chevronRight(p?: IconProps): any; chevronUp(p?: IconProps): any; circle(p?: IconProps): any; circleNotch(p?: IconProps): any; clipboard(p?: IconProps): any; clock(p?: IconProps): any; cloudDownload(p?: IconProps): any; cloudUpload(p?: IconProps): any; code(p?: IconProps): any; collapse(p?: IconProps): any; comment(p?: IconProps): any; contact(p?: IconProps): any; copy(p?: IconProps): any; cross(p?: IconProps): any; crosshairs(p?: IconProps): any; cube(p?: IconProps): any; database(p?: IconProps): any; desktop(p?: IconProps): any; dollarSign(p?: IconProps): any; dollarSignCircle(p?: IconProps): any; ellipsisHorizontal(p?: IconProps): any; ellipsisVertical(p?: IconProps): any; envelope(p?: IconProps): any; equals(p?: IconProps): any; euroSign(p?: IconProps): any; expand(p?: IconProps): any; experiment(p?: IconProps): any; eye(p?: IconProps): any; eyeSlash(p?: IconProps): any; factory(p?: IconProps): any; file(p?: IconProps): any; fileArchive(p?: IconProps): any; fileCertificate(p?: IconProps): any; fileChart(p?: IconProps): any; fileCsv(p?: IconProps): any; fileExcel(p?: IconProps): any; fileImage(p?: IconProps): any; filePdf(p?: IconProps): any; filePowerpoint(p?: IconProps): any; fileText(p?: IconProps): any; fileWord(p?: IconProps): any; fileXml(p?: IconProps): any; flag(p?: IconProps): any; floppyDisk(p?: IconProps): any; folder(p?: IconProps): any; folderOpen(p?: IconProps): any; func(p?: IconProps): any; fund(p?: IconProps): any; funnel(p?: IconProps): any; funnelSlash(p?: IconProps): any; gauge(p?: IconProps): any; gear(p?: IconProps): any; gears(p?: IconProps): any; gift(p?: IconProps): any; globe(p?: IconProps): any; globeAmericas(p?: IconProps): any; greaterThan(p?: IconProps): any; greaterThanEqual(p?: IconProps): any; grid(p?: IconProps): any; gridLarge(p?: IconProps): any; gridPanel(p?: IconProps): any; grip(p?: IconProps): any; hand(p?: IconProps): any; handshake(p?: IconProps): any; health(p?: IconProps): any; heartRate(p?: IconProps): any; history(p?: IconProps): any; home(p?: IconProps): any; impersonate(p?: IconProps): any; inbox(p?: IconProps): any; idBadge(p?: IconProps): any; infoCircle(p?: IconProps): any; institution(p?: IconProps): any; json(p?: IconProps): any; layout(p?: IconProps): any; learn(p?: IconProps): any; lessThan(p?: IconProps): any; lessThanEqual(p?: IconProps): any; link(p?: IconProps): any; list(p?: IconProps): any; location(p?: IconProps): any; lock(p?: IconProps): any; login(p?: IconProps): any; logout(p?: IconProps): any; magic(p?: IconProps): any; magnifyingGlass(p?: IconProps): any; mail(p?: IconProps): any; mapSigns(p?: IconProps): any; mask(p?: IconProps): any; memory(p?: IconProps): any; minusCircle(p?: IconProps): any; mixedChart(p?: IconProps): any; mobile(p?: IconProps): any; moon(p?: IconProps): any; news(p?: IconProps): any; notEquals(p?: IconProps): any; office(p?: IconProps): any; openExternal(p?: IconProps): any; options(p?: IconProps): any; paperclip(p?: IconProps): any; paste(p?: IconProps): any; pause(p?: IconProps): any; pauseCircle(p?: IconProps): any; penToSquare(p?: IconProps): any; phone(p?: IconProps): any; pin(p?: IconProps): any; play(p?: IconProps): any; playCircle(p?: IconProps): any; plus(p?: IconProps): any; plusCircle(p?: IconProps): any; pointerUp(p?: IconProps): any; portfolio(p?: IconProps): any; poundSign(p?: IconProps): any; print(p?: IconProps): any; question(p?: IconProps): any; questionCircle(p?: IconProps): any; random(p?: IconProps): any; receipt(p?: IconProps): any; redo(p?: IconProps): any; reset(p?: IconProps): any; rocket(p?: IconProps): any; roles(p?: IconProps): any; server(p?: IconProps): any; settings(p?: IconProps): any; shield(p?: IconProps): any; shieldCheck(p?: IconProps): any; shieldHalved(p?: IconProps): any; sigma(p?: IconProps): any; skull(p?: IconProps): any; slashedCircle(p?: IconProps): any; sparkles(p?: IconProps): any; spinner(p?: IconProps): any; spinnerScale(p?: IconProps): any; spinnerThird(p?: IconProps): any; square(p?: IconProps): any; squareMinus(p?: IconProps): any; star(p?: IconProps): any; stop(p?: IconProps): any; stopCircle(p?: IconProps): any; stopwatch(p?: IconProps): any; sun(p?: IconProps): any; tab(p?: IconProps): any; table(p?: IconProps): any; tag(p?: IconProps): any; tags(p?: IconProps): any; target(p?: IconProps): any; terminal(p?: IconProps): any; thumbsDown(p?: IconProps): any; thumbsUp(p?: IconProps): any; toast(p?: IconProps): any; toolbox(p?: IconProps): any; tools(p?: IconProps): any; trash(p?: IconProps): any; treeGraph(p?: IconProps): any; treeList(p?: IconProps): any; treeMap(p?: IconProps): any; undo(p?: IconProps): any; unlink(p?: IconProps): any; unlock(p?: IconProps): any; user(p?: IconProps): any; userCheck(p?: IconProps): any; userCircle(p?: IconProps): any; userClock(p?: IconProps): any; users(p?: IconProps): any; warning(p?: IconProps): any; warningCircle(p?: IconProps): any; warningSquare(p?: IconProps): any; window(p?: IconProps): any; wrench(p?: IconProps): any; x(p?: IconProps): any; xCircle(p?: IconProps): any; xHexagon(p?: IconProps): any; /** * Allows apps to override Hoist choices for given icons. */ accessDenied(p?: IconProps): any; add(p?: IconProps): any; ai(p?: IconProps): any; analytics(p?: IconProps): any; approve(p?: IconProps): any; attachment(p?: IconProps): any; close(p?: IconProps): any; columnMenu(p?: IconProps): any; danger(p?: IconProps): any; delete(p?: IconProps): any; detail(p?: IconProps): any; diff(p?: IconProps): any; disabled(p?: IconProps): any; download(p?: IconProps): any; edit(p?: IconProps): any; error(p?: IconProps): any; favorite(p?: IconProps): any; filter(p?: IconProps): any; filterSlash(p?: IconProps): any; groupRowCollapsed(p?: IconProps): any; groupRowExpanded(p?: IconProps): any; info(p?: IconProps): any; instrument(p?: IconProps): any; menu(p?: IconProps): any; panelCollapseToggleDown(p?: IconProps): any; panelCollapseToggleLeft(p?: IconProps): any; panelCollapseToggleRight(p?: IconProps): any; panelCollapseToggleUp(p?: IconProps): any; refresh(p?: IconProps): any; report(p?: IconProps): any; save(p?: IconProps): any; search(p?: IconProps): any; selectDropdown(p?: IconProps): any; sortAbsAsc(p?: IconProps): any; sortAbsDesc(p?: IconProps): any; sortAsc(p?: IconProps): any; sortDesc(p?: IconProps): any; success(p?: IconProps): any; sync(p?: IconProps): any; transaction(p?: IconProps): any; upload(p?: IconProps): any; /** * Create an Icon for a file with default styling appropriate for the file type. * * @param opts - Props to pass to Icon.icon(), along with an optional filename to be used to * create icon. Name will be parsed for an extension. If not provided or recognized, a * default icon will be returned. */ fileIcon(opts: IconProps & { filename: string; }): any; /** * Returns an empty div sized to occupy the width of a standard icon. Can be used to take up * room in a layout where an icon might otherwise go - e.g. to align a series of menu items, * where some items do not have an icon but others do. */ placeholder(opts?: IconProps): any; }; /** * Translate an icon into an HTML `` tag. * * Not typically used by applications. Applications that need HTML for an icon should use the * {@link IconProps.asHtml} flag on the Icon factory functions instead. * * @param iconElem - React element representing a Hoist Icon component. * Must be created by Hoist's built-in Icon factories. * @returns HTML string for the icon's `` tag. * @internal */ export declare function convertIconToHtml(iconElem: ReactElement): string;