mirror of
https://github.com/withastro/astro.git
synced 2024-12-23 21:53:55 -05:00
Use more permissive type for defineCollection
schema option (#8163)
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
This commit is contained in:
parent
d08c83ee3f
commit
179796405e
2 changed files with 7 additions and 5 deletions
5
.changeset/unlucky-cougars-heal.md
Normal file
5
.changeset/unlucky-cougars-heal.md
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
'astro': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Make typing of `defineCollection` more permissive to support advanced union and intersection types
|
7
packages/astro/content-types.template.d.ts
vendored
7
packages/astro/content-types.template.d.ts
vendored
|
@ -53,12 +53,9 @@ declare module 'astro:content' {
|
||||||
|
|
||||||
type BaseSchemaWithoutEffects =
|
type BaseSchemaWithoutEffects =
|
||||||
| import('astro/zod').AnyZodObject
|
| 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').ZodDiscriminatedUnion<string, import('astro/zod').AnyZodObject[]>
|
||||||
| import('astro/zod').ZodIntersection<
|
| import('astro/zod').ZodIntersection<BaseSchemaWithoutEffects, BaseSchemaWithoutEffects>;
|
||||||
import('astro/zod').AnyZodObject,
|
|
||||||
import('astro/zod').AnyZodObject
|
|
||||||
>;
|
|
||||||
|
|
||||||
type BaseSchema =
|
type BaseSchema =
|
||||||
| BaseSchemaWithoutEffects
|
| BaseSchemaWithoutEffects
|
||||||
|
|
Loading…
Reference in a new issue