-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(image): Export more types and utilities for users to use #6739
Conversation
🦋 Changeset detectedLatest commit: d2058b1 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@@ -45,7 +38,7 @@ interface GetImageResult { | |||
* import { getImage } from 'astro:assets'; | |||
* import originalImage from '../assets/image.png'; | |||
* | |||
* const optimizedImage = await getImage({src: originalImage, width: 1280 }) | |||
* const optimizedImage = await getImage({src: originalImage, width: 1280 }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semi-colon here broke syntax highlighting in the hover because of withastro/language-tools#475
width?: number | undefined; | ||
height?: number | undefined; | ||
quality?: ImageQuality | undefined; | ||
format?: ImageOutputFormat | undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding undefined
here makes it compatible with exactOptionalPropertyTypes
. Otherwise, building a component is clumsy because you need to filter out every props manually
Scanned and didn't see any changes for Astro Docs Maintainers to review, so removed the review request! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine to me 👍
Changes
While porting my website to
astro:assets
this weekend and building my own Picture component, I noticed that a bunch of types are annoyingly not exported, this PR fixes thisTesting
Tested manually, types only
Docs
Some of those types were already referred to in the docs, but couldn't be exported. This PR fixes this