0.1.2 #3

Merged
Thilawyn merged 136 commits from next into master 2024-03-11 19:44:21 +01:00
2 changed files with 15 additions and 10 deletions
Showing only changes of commit a58b441094 - Show all commits

View File

@@ -48,8 +48,8 @@ extends TraitExpressionBuilder<Superclass, Traits> {
}
}
return this
.extends(Schemas as unknown as (
return new ZodSchemaClassBuilder(
Schemas as unknown as (
AbstractClass<
InstanceType<Superclass> &
Simplify<
@@ -64,11 +64,14 @@ extends TraitExpressionBuilder<Superclass, Traits> {
StaticMembers<typeof Schemas>,
]>
>
))
.expresses(
),
[
...this.expressionTraits,
InstantiableZodSchemaObject,
ExtendableZodSchemaObject,
)
],
)
}
jsonifiable() {

View File

@@ -7,13 +7,15 @@ import { ObservableZodSchemaObject } from "./traits/ObservableZodSchemaObject"
const newTestExp = new ZodSchemaClassBuilder(TraitExpression.NullSuperclass, [])
.schema(
z.object({
id: z.bigint()
/** Object ID */
id: z.bigint(),
name: z.string(),
}),
{ id: -1n },
)
.expressionSuperclass
.expresses(ObservableZodSchemaObject)
.build()
const TestExp = ZodSchemaClass({
schema: z.object({
@@ -27,8 +29,8 @@ const TestExp = ZodSchemaClass({
.expresses(ObservableZodSchemaObject)
.build()
@TestExp.staticImplements
class Test extends TestExp.extends implements Implements<typeof TestExp> {}
@newTestExp.staticImplements
class Test extends newTestExp.extends implements Implements<typeof newTestExp> {}
Test.schema
const inst = Test.create({ id: 1n, name: "" })