import { JSXInterface } from '../jsx'; import { BasicElement, CSSResultGroup, PropertyValues, TemplateResult } from '@refinitiv-ui/core'; import type { Config } from '../configuration/index.js'; export declare class Icon extends BasicElement { /** * Element version number * @returns version number */ static get version(): string; /** * Icon map from ef-configuration * @ignore */ config?: Config; /** * A `CSSResultGroup` that will be used * to style the host, slotted children * and the internal template of the element. * @return CSS template */ static get styles(): CSSResultGroup; private _icon; /** * Name of a known icon to render or URL of SVG icon. * @example heart | https://cdn.io/icons/heart.svg * @default null */ get icon(): string | null; set icon(value: string | null); private _template; /** * The icon template to render */ private get template(); private set template(value); /** * A deferred promise representing icon ready. * It would be resolved when the icon svg has been fetched and parsed, or * when the icon svg is unavailable/invalid. */ private iconReady; constructor(); /** * Check if the icon map configuration has content * @returns icon map if exists */ private get iconMap(); /** * Called after the component is first rendered * @param changedProperties Properties which have changed * @returns {void} */ protected firstUpdated(changedProperties: PropertyValues): void; protected getUpdateComplete(): Promise; /** * instantiate a new deferred promise for icon ready if it's not pending already * @returns {void} */ private deferIconReady; /** * Check if the icon is valid to render * @returns false if icon value or icon map value is invalid */ private isIconValid; /** * Update the icon renderer * @returns {void} */ private updateRenderer; /** * Tries to load an icon from the url provided * and the renders this into the icon template. * @param src Source location of the svg icon. * @returns {void} */ private loadAndRenderIcon; /** * Tries to load get an icon from the sprite url provided * and the renders this into the icon template. * @param iconName Name of the svg icon. * @returns {void} */ private loadAndRenderSpriteIcon; /** * Get and cache CDN prefix * This is a private URL which is set in the theme * and should not be configured again via the variable. * @returns {void} */ private setPrefix; /** * Clears SVG body from the icon template * @returns {void} */ private clearIcon; /** * A `TemplateResult` that will be used * to render the updated internal template. * @return Render template */ protected render(): TemplateResult; } declare global { interface HTMLElementTagNameMap { 'ef-icon': Icon; } } declare global { interface HTMLElementTagNameMap { 'ef-icon': Icon; } namespace JSX { interface IntrinsicElements { 'ef-icon': Partial | JSXInterface.HTMLAttributes; } } } export {};