2022-07-27 15:39:05 +00:00
/// <reference types="astro/astro-jsx" />
2022-07-01 15:47:48 +00:00
export { default as Image } from './Image.astro' ;
2022-07-08 21:37:55 +00:00
export { default as Picture } from './Picture.astro' ;
2022-07-27 15:39:05 +00:00
// TODO: should these directives be removed from astroHTML.JSX?
2022-07-27 15:41:22 +00:00
export type ImgHTMLAttributes = Omit <
astroHTML . JSX . ImgHTMLAttributes ,
'client:list' | 'set:text' | 'set:html' | 'is:raw'
> ;
export type HTMLAttributes = Omit <
astroHTML . JSX . HTMLAttributes ,
'client:list' | 'set:text' | 'set:html' | 'is:raw'
> ;
2022-09-01 21:24:07 +00:00
let altWarningShown = false ;
export function warnForMissingAlt() {
2022-09-01 21:26:15 +00:00
if ( altWarningShown === true ) {
return ;
}
2022-09-01 21:24:07 +00:00
altWarningShown = true ;
console . warn ( ` \ n[@astrojs/image] "alt" text was not provided for an <Image> or <Picture> component.
A future release of @astrojs / image may throw a build error when "alt" text is missing .
The "alt" attribute holds a text description of the image , which isn 't mandatory but is incredibly useful for accessibility. Set to an empty string (alt="") if the image is not a key part of the content (it' s decoration or a tracking pixel ) . \ n ` );
}