Fix image() type to be compatible with ImageMetadata (#6568)

* fix(assest): Fix `image()` type to be compatible with ImageMetadata

* chore: changeset
This commit is contained in:
Erika 2023-03-16 22:35:14 +01:00 committed by GitHub
parent b53e8b3fb1
commit f413446a85
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 1 deletions

View file

@ -0,0 +1,5 @@
---
'astro': patch
---
Fix image() type to be compatible with ImageMetadata

View file

@ -13,11 +13,22 @@ declare module 'astro:content' {
export type CollectionEntry<C extends keyof typeof entryMap> =
(typeof entryMap)[C][keyof (typeof entryMap)[C]];
// This needs to be in sync with ImageMetadata
export const image: () => import('astro/zod').ZodObject<{
src: import('astro/zod').ZodString;
width: import('astro/zod').ZodNumber;
height: import('astro/zod').ZodNumber;
format: import('astro/zod').ZodString;
format: import('astro/zod').ZodUnion<
[
import('astro/zod').ZodLiteral<'png'>,
import('astro/zod').ZodLiteral<'jpg'>,
import('astro/zod').ZodLiteral<'jpeg'>,
import('astro/zod').ZodLiteral<'tiff'>,
import('astro/zod').ZodLiteral<'webp'>,
import('astro/zod').ZodLiteral<'gif'>,
import('astro/zod').ZodLiteral<'svg'>
]
>;
}>;
type BaseSchemaWithoutEffects =