import { LitElement } from 'lit'; /** * Source configuration for responsive images using element */ export interface AgImageSource { /** Required srcset attribute for this source */ srcset: string; /** MIME type (e.g., "image/webp") */ type?: string; /** Media query (e.g., "(min-width: 768px)") */ media?: string; /** Sizes attribute for responsive sizing */ sizes?: string; } /** * Props interface for AgImage component */ export interface AgImageProps { /** Image source URL */ src: string; /** Alternative text for accessibility (required) */ alt: string; /** Array of source configurations for element */ sources?: AgImageSource[]; /** Intrinsic width in pixels */ width?: number; /** Intrinsic height in pixels */ height?: number; /** Aspect ratio in format "16/9" or auto-calculated from width/height */ aspectRatio?: string; /** CSS object-fit value */ fit?: 'cover' | 'contain' | 'fill' | 'none' | 'scale-down'; /** CSS object-position value */ position?: string; /** Native browser lazy loading */ loading?: 'lazy' | 'eager'; /** Enable simple opacity fade transition */ fade?: boolean; /** Fade transition duration in milliseconds */ duration?: number; /** Backup image source if primary fails to load */ fallbackSrc?: string; } /** * AgImage - A lightweight, performant image component with responsive sources, * lazy loading, error recovery, and CLS prevention. * * @element ag-image * * @fires ag-load - Dispatched when image successfully loads * @fires ag-error - Dispatched when image fails to load * * @slot - Default slot for caption content * @slot placeholder - Custom placeholder content during loading * @slot error - Custom error content when image fails to load * * @csspart ag-img - The img element * @csspart ag-placeholder - The placeholder overlay * @csspart ag-error - The error overlay * * @cssprop --ag-image-transition-duration - Fade transition duration (default: var(--ag-motion-medium)) * @cssprop --ag-image-bg-color - Background color during loading (default: var(--ag-background-secondary)) * @cssprop --ag-image-fit - Default object-fit value (default: cover) */ /** * Custom event types */ export type ImageLoadEvent = CustomEvent; export type ImageErrorEvent = CustomEvent; /** Alias required for SDUI codegen discovery (glob: Image/core/_*.ts → looks for ImageProps) */ export interface ImageProps extends AgImageProps { } export declare class AgImage extends LitElement implements AgImageProps { src: string; alt: string; sources: AgImageSource[]; width?: number; height?: number; aspectRatio?: string; fit: 'cover' | 'contain' | 'fill' | 'none' | 'scale-down'; position: string; loading: 'lazy' | 'eager'; fade: boolean; duration: number; fallbackSrc?: string; private _loaded; private _errored; private _currentSrc; constructor(); static styles: import('lit').CSSResult; willUpdate(changed: Map): void; private _handleLoad; private _handleError; private _renderImage; private _renderPicture; private _renderOverlay; render(): import('lit').TemplateResult<1>; } //# sourceMappingURL=_Image.d.ts.map