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:
parent
b53e8b3fb1
commit
f413446a85
2 changed files with 17 additions and 1 deletions
5
.changeset/perfect-humans-wink.md
Normal file
5
.changeset/perfect-humans-wink.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'astro': patch
|
||||
---
|
||||
|
||||
Fix image() type to be compatible with ImageMetadata
|
13
packages/astro/src/content/template/types.d.ts
vendored
13
packages/astro/src/content/template/types.d.ts
vendored
|
@ -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 =
|
||||
|
|
Loading…
Reference in a new issue