diff --git a/.changeset/unlucky-cougars-heal.md b/.changeset/unlucky-cougars-heal.md new file mode 100644 index 000000000000..a6579499e917 --- /dev/null +++ b/.changeset/unlucky-cougars-heal.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Make typing of `defineCollection` more permissive to support advanced union and intersection types diff --git a/packages/astro/content-types.template.d.ts b/packages/astro/content-types.template.d.ts index edc50fcc9ff3..3f9529012651 100644 --- a/packages/astro/content-types.template.d.ts +++ b/packages/astro/content-types.template.d.ts @@ -53,12 +53,9 @@ declare module 'astro:content' { type BaseSchemaWithoutEffects = | import('astro/zod').AnyZodObject - | import('astro/zod').ZodUnion + | import('astro/zod').ZodUnion<[BaseSchemaWithoutEffects, ...BaseSchemaWithoutEffects[]]> | import('astro/zod').ZodDiscriminatedUnion - | import('astro/zod').ZodIntersection< - import('astro/zod').AnyZodObject, - import('astro/zod').AnyZodObject - >; + | import('astro/zod').ZodIntersection; type BaseSchema = | BaseSchemaWithoutEffects