UNPKG

aia-tagging-react

Version:

TypeScript package for handling tagged images from AIA HANDICAP

48 lines (47 loc) 2.28 kB
import React from 'react'; interface TaggedImageProps { src: string; defaultAlt?: string; className?: string; style?: React.CSSProperties; width?: number; height?: number; alt?: string; fill?: boolean; sizes?: string; loading?: 'lazy' | 'eager'; onLoad?: (event: React.SyntheticEvent<HTMLImageElement, Event>) => void; onError?: (event: React.SyntheticEvent<HTMLImageElement, Event>) => void; overrideSrc?: string; crossOrigin?: 'anonymous' | 'use-credentials'; decoding?: 'sync' | 'async' | 'auto'; fetchPriority?: 'high' | 'low' | 'auto'; referrerPolicy?: 'no-referrer' | 'no-referrer-when-downgrade' | 'origin-when-cross-origin' | 'unsafe-url'; srcSet?: string; useMap?: string; } /** * TaggedImage component that dynamically sets the alt attribute. * @param {Object} props - The component props. * @param {string} props.src - The image source URL. * @param {string} [props.defaultAlt] - The default alt text if EXIF description is unavailable. * @param {string} [props.className] - Optional CSS classes for the image. * @param {Object} [props.style] - Inline styles for the image. * @param {number} [props.width] - The width of the image (in pixels). * @param {number} [props.height] - The height of the image (in pixels). * @param {string} [props.alt] - The alt text for the image. * @param {boolean} [props.fill] - Whether to fill the image container. * @param {string} [props.sizes] - The sizes attribute for responsive images. * @param {string} [props.loading] - The loading strategy ('lazy' or 'eager'). * @param {Function} [props.onLoad] - Function to call on image load. * @param {Function} [props.onError] - Function to call on image error. * @param {string} [props.overrideSrc] - Override the source URL. * @param {string} [props.crossOrigin] - Cross-origin setting. * @param {string} [props.decoding] - Decoding strategy. * @param {string} [props.fetchPriority] - The fetch priority. * @param {string} [props.referrerPolicy] - The referrer policy. * @param {string} [props.srcSet] - The srcset attribute for responsive images. * @param {string} [props.useMap] - The usemap attribute. */ declare const TaggedImage: React.FC<TaggedImageProps>; export default TaggedImage;