ZodSchemaClassExtender
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -18,7 +18,7 @@ extends TraitExpressionBuilder<Superclass, Traits> {
|
||||
declare ["constructor"]: typeof ZodSchemaClassBuilder
|
||||
|
||||
schema<
|
||||
Superclass extends AbstractClass<object, []> & { schema?: never, defaultValues?: never },
|
||||
Super extends AbstractClass<object, []> & { schema?: never, defaultValues?: never },
|
||||
|
||||
SchemaT extends z.ZodRawShape,
|
||||
SchemaUnknownKeys extends z.UnknownKeysParam,
|
||||
@@ -27,7 +27,7 @@ extends TraitExpressionBuilder<Superclass, Traits> {
|
||||
Values extends object,
|
||||
DefaultValues extends Partial<Values>,
|
||||
>(
|
||||
this: ZodSchemaClassBuilder<Superclass, Traits>,
|
||||
this: ZodSchemaClassBuilder<Super, Traits>,
|
||||
|
||||
{ schema, defaultValues }: {
|
||||
schema: z.ZodObject<SchemaT, SchemaUnknownKeys, SchemaCatchall, Values, Values>
|
||||
@@ -47,10 +47,10 @@ extends TraitExpressionBuilder<Superclass, Traits> {
|
||||
return new this.constructor(
|
||||
Schemas as unknown as (
|
||||
AbstractClass<
|
||||
InstanceType<Superclass> & Values,
|
||||
InstanceType<Super> & Values,
|
||||
ConstructorParameters<typeof Schemas>
|
||||
> &
|
||||
StaticMembers<Superclass> &
|
||||
StaticMembers<Super> &
|
||||
StaticMembers<typeof Schemas>
|
||||
),
|
||||
|
||||
@@ -63,7 +63,7 @@ extends TraitExpressionBuilder<Superclass, Traits> {
|
||||
}
|
||||
|
||||
jsonifiable<
|
||||
Superclass extends ZodSchemaAbstractClass<Instance, SchemaT, SchemaUnknownKeys, SchemaCatchall, Values, DefaultValues>
|
||||
Super extends ZodSchemaAbstractClass<Instance, SchemaT, SchemaUnknownKeys, SchemaCatchall, Values, DefaultValues>
|
||||
& { jsonifySchema?: never, dejsonifySchema?: never },
|
||||
Instance extends Values,
|
||||
|
||||
@@ -85,7 +85,7 @@ extends TraitExpressionBuilder<Superclass, Traits> {
|
||||
JsonifiedValues extends JsonifiableObject,
|
||||
>(
|
||||
this: ZodSchemaClassBuilder<
|
||||
Superclass | ZodSchemaAbstractClass<Instance, SchemaT, SchemaUnknownKeys, SchemaCatchall, Values, DefaultValues>,
|
||||
Super | ZodSchemaAbstractClass<Instance, SchemaT, SchemaUnknownKeys, SchemaCatchall, Values, DefaultValues>,
|
||||
Traits
|
||||
>,
|
||||
|
||||
@@ -112,12 +112,12 @@ extends TraitExpressionBuilder<Superclass, Traits> {
|
||||
return new this.constructor(
|
||||
JsonifiableSchemas as unknown as (
|
||||
AbstractClass<
|
||||
InstanceType<Superclass> & JsonifiableSchemas,
|
||||
Instance & JsonifiableSchemas,
|
||||
|
||||
// TODO: for some reason, ConstructorParameters<Superclass> does not work here. Maybe try to find a fix?
|
||||
// TODO: for some reason, ConstructorParameters<Super> does not work here. Maybe try to find a fix?
|
||||
ConstructorParameters<ZodSchemaAbstractClass<Instance, SchemaT, SchemaUnknownKeys, SchemaCatchall, Values, DefaultValues>>
|
||||
> &
|
||||
StaticMembers<Superclass> &
|
||||
StaticMembers<Super> &
|
||||
StaticMembers<typeof JsonifiableSchemas>
|
||||
),
|
||||
|
||||
|
||||
Reference in New Issue
Block a user