2022-07-27 10:39:05 -05:00
/// <reference types="astro/astro-jsx" />
2022-07-01 10:47:48 -05:00
export { default as Image } from './Image.astro' ;
2022-07-08 16:37:55 -05:00
export { default as Picture } from './Picture.astro' ;
2022-07-27 10:39:05 -05:00
// TODO: should these directives be removed from astroHTML.JSX?
2022-07-27 10:41:22 -05: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 16:24:07 -05:00
let altWarningShown = false ;
export function warnForMissingAlt() {
2022-09-01 16:26:15 -05:00
if ( altWarningShown === true ) {
return ;
}
2022-09-01 16:24:07 -05: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 ` );
}