Skip to content

Commit

Permalink
fix(assest): Fix image() type to be compatible with ImageMetadata
Browse files Browse the repository at this point in the history
  • Loading branch information
Princesseuh committed Mar 16, 2023
1 parent b53e8b3 commit c49f703
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion packages/astro/src/content/template/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down

0 comments on commit c49f703

Please sign in to comment.