Skip to content

Commit 1d90dc0

Browse files
blt-relliott-with-the-longest-name-on-githubteemingc
authored
feat: export type Picture in enhanced-img (#15225)
* feat: export type Picture in enhanced-img This type is part of public api, so it should be reexported. Otherwise users have to explicitly add "vite-imagetools", or use hacks like `typeof import('fake.jpg?enhanced').default` This type is needed when using `import.meta.glob`, because by default it is getting typed as `unknown`. * Apply suggestion from @teemingc Co-authored-by: Tee Ming <[email protected]> * tweak --------- Co-authored-by: Elliott Johnson <[email protected]> Co-authored-by: Tee Ming <[email protected]>
1 parent dc629d5 commit 1d90dc0

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

.changeset/tired-papayas-cough.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@sveltejs/enhanced-img': minor
3+
---
4+
5+
feat: re-export the `Picture` type from `vite-imagetools`

packages/enhanced-img/types/index.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import type { Plugin } from 'vite';
33
import type { Picture } from 'vite-imagetools';
44
import './ambient.js';
55

6+
export { Picture };
7+
68
type EnhancedImgAttributes = Omit<HTMLImgAttributes, 'src'> & { src: string | Picture };
79

810
// https://svelte.dev/docs/svelte/typescript#enhancing-built-in-dom-types

0 commit comments

Comments
 (0)