0.1.2 #3

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

View File

@@ -1,14 +1,12 @@
import { abstract, trait } from "@thilawyn/traitify-ts"
import { trait } from "@thilawyn/traitify-ts"
import { AbstractClass } from "type-fest"
import { z } from "zod"
import { ZodSchemaAbstractClass } from "../shapes/ZodSchemaClass"
import { Extend, StaticMembers } from "../util"
export const ExtendableZodSchemaObject = trait(
abstract(),
Super => class ExtendableZodSchemaObject extends Super {
export const ExtendableZodSchemaObject = trait
.implement(Super => class ExtendableZodSchemaObject extends Super {
static extend<
Super extends ZodSchemaAbstractClass<SuperInstance, SuperSchemaT, SuperSchemaUnknownKeys, SuperSchemaCatchall, SuperValues, SuperDefaultValues>,
SuperInstance extends SuperValues,
@@ -56,5 +54,5 @@ export const ExtendableZodSchemaObject = trait(
static readonly defaultValues = defaultValues
} as any
}
},
)
})
.build()

View File

@@ -1,4 +1,4 @@
import { abstract, trait } from "@thilawyn/traitify-ts"
import { trait } from "@thilawyn/traitify-ts"
import { Effect, pipe } from "effect"
import { HasRequiredKeys } from "type-fest"
import { z } from "zod"
@@ -26,10 +26,8 @@ type NewZodSchemaInstanceArgs<Input extends object> = (
)
export const InstantiableZodSchemaObject = trait(
abstract(),
Super => class InstantiableZodSchemaObject extends Super {
export const InstantiableZodSchemaObject = trait
.implement(Super => class InstantiableZodSchemaObject extends Super {
static create<
Instance extends Values,
@@ -102,5 +100,5 @@ export const InstantiableZodSchemaObject = trait(
protected static initialize() {
}
},
)
})
.build()

View File

@@ -1,12 +1,10 @@
import { abstract, trait } from "@thilawyn/traitify-ts"
import { trait } from "@thilawyn/traitify-ts"
export const ObservableZodSchemaObject = trait(
abstract(),
Super => class ObservableZodSchemaObject extends Super {
export const ObservableZodSchemaObject = trait
.implement(Super => class ObservableZodSchemaObject extends Super {
constructor(...args: any[]) {
super(...args)
}
},
)
})
.build()