File tree 3 files changed +13
-3
lines changed
packages/enhanced-img/types
3 files changed +13
-3
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ ' @sveltejs/enhanced-img ' : patch
3
+ ---
4
+
5
+ fix: use correct type for ` *?enhanced ` imports
Original file line number Diff line number Diff line change
1
+ import type { Picture } from 'vite-imagetools' ;
2
+
1
3
declare module '*?enhanced' {
2
- const value : string ;
4
+ const value : Picture ;
3
5
export default value ;
4
6
}
Original file line number Diff line number Diff line change
1
+ import type { HTMLImgAttributes } from 'svelte/elements' ;
1
2
import type { Plugin } from 'vite' ;
3
+ import type { Picture } from 'vite-imagetools' ;
2
4
import './ambient.js' ;
3
- import { HTMLImgAttributes } from 'svelte/elements' ;
5
+
6
+ type EnhancedImgAttributes = Omit < HTMLImgAttributes , 'src' > & { src : string | Picture } ;
4
7
5
8
// https://svelte.dev/docs/typescript#enhancing-built-in-dom-types
6
9
declare module 'svelte/elements' {
7
10
export interface SvelteHTMLElements {
8
- 'enhanced:img' : HTMLImgAttributes ;
11
+ 'enhanced:img' : EnhancedImgAttributes ;
9
12
}
10
13
}
11
14
You can’t perform that action at this time.
0 commit comments