File tree 2 files changed +16
-4
lines changed 2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ ' astro ' : patch
3
+ ---
4
+
5
+ Fixes typechecking for content config schema
Original file line number Diff line number Diff line change @@ -45,11 +45,18 @@ declare module 'astro:content' {
45
45
has : ( key : string ) => boolean ;
46
46
}
47
47
48
+ type BaseAtomicSchema = import ( 'astro/zod' ) . AnyZodObject ;
49
+
50
+ type BaseCompositeSchema =
51
+ | import ( 'astro/zod' ) . ZodUnion < [ BaseAtomicSchema , ...BaseAtomicSchema [ ] ] >
52
+ | import ( 'astro/zod' ) . ZodDiscriminatedUnion < string , BaseAtomicSchema [ ] >
53
+ // If we have a union of unions, give up on trying to type-check it all. You're on your own.
54
+ | import ( 'astro/zod' ) . ZodUnion < [ import ( 'astro/zod' ) . ZodUnion < z . any > , ...z . any [ ] ] >
55
+
48
56
type BaseSchemaWithoutEffects =
49
- | import ( 'astro/zod' ) . AnyZodObject
50
- | import ( 'astro/zod' ) . ZodUnion < [ BaseSchemaWithoutEffects , ...BaseSchemaWithoutEffects [ ] ] >
51
- | import ( 'astro/zod' ) . ZodDiscriminatedUnion < string , import ( 'astro/zod' ) . AnyZodObject [ ] >
52
- | import ( 'astro/zod' ) . ZodIntersection < BaseSchemaWithoutEffects , BaseSchemaWithoutEffects > ;
57
+ | BaseAtomicSchema
58
+ | BaseCompositeSchema
59
+ | import ( 'astro/zod' ) . ZodIntersection < BaseAtomicSchema , BaseAtomicSchema | BaseCompositeSchema > ;
53
60
54
61
export type BaseSchema =
55
62
| BaseSchemaWithoutEffects
You can’t perform that action at this time.
0 commit comments