/** * TyIcon Web Component — SVG icon with size variants and animations. */ import type { IconSize, IconTempo, TyIconElement } from '../types/common.js'; import { TyComponent } from '../base/ty-component.js'; import type { PropertyChange } from '../utils/property-manager.js'; import * as IconRegistry from '../utils/icon-registry.js'; /** * Component internal state (for typing TyComponent) */ interface IconState { name: string; size: string; spin: boolean; pulse: boolean; tempo: string; } /** * Ty Icon Component */ export declare class TyIcon extends TyComponent implements TyIconElement { static formAssociated: boolean; protected static properties: { name: { type: "string"; visual: boolean; default: string; }; size: { type: "string"; visual: boolean; default: string; }; spin: { type: "boolean"; visual: boolean; default: boolean; }; pulse: { type: "boolean"; visual: boolean; default: boolean; }; tempo: { type: "string"; visual: boolean; default: string; }; }; private _watchId; /** Track currently rendered SVG to avoid unnecessary re-renders */ private _currentSvg; /** * Single shadow-DOM that holds either: * - light-DOM children supplied by the user (server-side path: pasted SVG), or * - fallback content driven by the registry (`name=`) or NOT_FOUND_ICON. * * Browser slot semantics handle precedence: when the host has assigned nodes, * the slot's fallback content is hidden automatically — no detection logic needed. */ private _slot; constructor(); protected onConnect(): void; protected onDisconnect(): void; /** * Handle property changes - called BEFORE render * Detects name changes to update icon registry watcher */ protected onPropertiesChanged(changes: PropertyChange[]): void; get name(): string; set name(value: string); get size(): IconSize | undefined; set size(value: IconSize | undefined); get spin(): boolean; set spin(value: boolean); get pulse(): boolean; set pulse(value: boolean); get tempo(): IconTempo | undefined; set tempo(value: IconTempo | undefined); /** Build CSS classes for the host element */ private buildClasses; /** Update host element classes */ private updateClasses; /** * Render the icon SVG. Unknown/unset names fall back to NOT_FOUND_ICON * immediately rather than rendering nothing (prevents layout shift). */ protected render(): void; /** * Update the slot's fallback content. * If the user has slotted light-DOM children (e.g., raw ), the browser * shows those instead and the fallback stays hidden — but we still keep it * up to date so removing the children reveals the right registry/fallback SVG. */ private renderSvg; } export { IconRegistry };