11<script lang =" ts" >
22import Picture from ' ./Picture.svelte'
33import { len , lqipToBackground } from ' ./utils.js'
4- import type { HTMLButtonAttributes } from ' svelte/elements'
4+ import type { HTMLImgAttributes } from ' svelte/elements'
55import type { Picture as PictureType } from ' vite-imagetools'
66
7- interface $$Props extends HTMLButtonAttributes {
7+ interface $$Props extends Omit < HTMLImgAttributes , ' src ' > {
88 /** imagetools import */
9- src: PictureType | undefined
9+ src: PictureType
1010
1111 /** img tag `sizes` attr */
1212 sizes? : string
@@ -27,7 +27,7 @@ interface $$Props extends HTMLButtonAttributes {
2727 ref? : HTMLImageElement
2828}
2929
30- export let src: $$Props [' src' ] = undefined
30+ export let src: $$Props [' src' ]
3131export let sizes: $$Props [' sizes' ] = undefined
3232export let width: $$Props [' width' ] = undefined
3333export let height: $$Props [' height' ] = undefined
@@ -74,11 +74,11 @@ $: if (len(img)) {
7474 ```
7575
7676 ## Props
77- - `src? : PictureType` - imagetools import
77+ - `src: PictureType` - imagetools import
7878 - `sizes?: string` - img tag `sizes` attr
79- - `width?: number` - img width override
80- - `height?: number` - img height override
81- - `loading: 'lazy' | 'eager'` - img tag `loading` attr
82- - `decoding: 'async' | 'auto' | 'sync'` - img tag `decoding` attr
79+ - `width?: number` - img ` width` override
80+ - `height?: number` - img ` height` override
81+ - `loading? : 'lazy' | 'eager'` - img tag `loading` attr
82+ - `decoding? : 'async' | 'auto' | 'sync'` - img tag `decoding` attr
8383 - `ref?: HTMLImageElement` - bindable reference to `<img>` element
8484 -->
0 commit comments