0.1.2 #3
@@ -2,16 +2,11 @@ import { Effect, pipe } from "effect"
|
|||||||
import { AbstractClass, Class as ConcreteClass, Opaque } from "type-fest"
|
import { AbstractClass, Class as ConcreteClass, Opaque } from "type-fest"
|
||||||
import { z } from "zod"
|
import { z } from "zod"
|
||||||
import { DefinedDefaultValuesTag, NewZodSchemaInstanceArgs, NewZodSchemaInstanceInput, TZodSchemaClass } from "."
|
import { DefinedDefaultValuesTag, NewZodSchemaInstanceArgs, NewZodSchemaInstanceInput, TZodSchemaClass } from "."
|
||||||
import { Class, GetClassType, StaticMembers, parseZodTypeEffect } from "./util"
|
import { Class, GetClassType, MergeInheritanceTree, MergeInheritanceTreeWithoutOverriding, StaticMembers, parseZodTypeEffect } from "./util"
|
||||||
|
|
||||||
|
|
||||||
type ExtendableClass = AbstractClass<any, []> & {
|
|
||||||
schema?: never
|
|
||||||
defaultValues?: never
|
|
||||||
}
|
|
||||||
|
|
||||||
export function ZodSchemaClassOf<
|
export function ZodSchemaClassOf<
|
||||||
Parent extends ExtendableClass,
|
Parent extends AbstractClass<any, []>,
|
||||||
|
|
||||||
SchemaT extends z.ZodRawShape,
|
SchemaT extends z.ZodRawShape,
|
||||||
SchemaUnknownKeys extends z.UnknownKeysParam,
|
SchemaUnknownKeys extends z.UnknownKeysParam,
|
||||||
@@ -114,14 +109,18 @@ export function ZodSchemaClassOf<
|
|||||||
Class<
|
Class<
|
||||||
GetClassType<Parent>,
|
GetClassType<Parent>,
|
||||||
|
|
||||||
InstanceType<Parent> &
|
MergeInheritanceTreeWithoutOverriding<[
|
||||||
|
InstanceType<Parent>,
|
||||||
InstanceType<TZodSchemaClassImpl>,
|
InstanceType<TZodSchemaClassImpl>,
|
||||||
|
]> &
|
||||||
|
|
||||||
ConstructorParameters<TZodSchemaClassImpl>
|
ConstructorParameters<TZodSchemaClassImpl>
|
||||||
> &
|
> &
|
||||||
|
|
||||||
StaticMembers<Parent> &
|
MergeInheritanceTree<[
|
||||||
StaticMembers<TZodSchemaClassImpl>
|
StaticMembers<Parent>,
|
||||||
|
StaticMembers<TZodSchemaClassImpl>,
|
||||||
|
]>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user