diff options
-rw-r--r-- | .changeset/unlucky-cougars-heal.md | 5 | ||||
-rw-r--r-- | packages/astro/content-types.template.d.ts | 7 |
2 files changed, 7 insertions, 5 deletions
diff --git a/.changeset/unlucky-cougars-heal.md b/.changeset/unlucky-cougars-heal.md new file mode 100644 index 000000000..a6579499e --- /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 edc50fcc9..3f9529012 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').AnyZodObject[]> + | import('astro/zod').ZodUnion<[BaseSchemaWithoutEffects, ...BaseSchemaWithoutEffects[]]> | import('astro/zod').ZodDiscriminatedUnion<string, import('astro/zod').AnyZodObject[]> - | import('astro/zod').ZodIntersection< - import('astro/zod').AnyZodObject, - import('astro/zod').AnyZodObject - >; + | import('astro/zod').ZodIntersection<BaseSchemaWithoutEffects, BaseSchemaWithoutEffects>; type BaseSchema = | BaseSchemaWithoutEffects |