0.1.0 #1
@@ -1,3 +1,4 @@
|
||||
import { Effect } from "effect"
|
||||
import { Class } from "type-fest"
|
||||
import { JsonifiableObject } from "type-fest/source/jsonifiable"
|
||||
import { z } from "zod"
|
||||
@@ -58,4 +59,8 @@ export type JsonifiableSchemableObject<
|
||||
readonly $jsonifiableSchemableConfig: $Config
|
||||
readonly jsonifySchema: $Config["jsonifySchema"]
|
||||
readonly dejsonifySchema: $Config["dejsonifySchema"]
|
||||
|
||||
jsonify(): $Config["jsonifiedValues"]
|
||||
jsonifyPromise(): Promise<$Config["jsonifiedValues"]>
|
||||
jsonifyEffect(): Effect.Effect<never, z.ZodError<$Config["$schemableConfig"]["values"]>, $Config["jsonifiedValues"]>
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Class } from "type-fest"
|
||||
import { JsonifiableObject } from "type-fest/source/jsonifiable"
|
||||
import { z } from "zod"
|
||||
import { JsonifiableSchemableConfig } from "."
|
||||
import { JsonifiableSchemableClass, JsonifiableSchemableConfig, JsonifiableSchemableObject } from "."
|
||||
import { SchemableClass, SchemableConfig } from ".."
|
||||
import { StaticMembers, parseZodTypeEffect } from "../util"
|
||||
|
||||
@@ -84,15 +84,15 @@ export function makeJsonifiableSchemableClass<
|
||||
jsonifyEffect() {
|
||||
return parseZodTypeEffect(this.jsonifySchema, this)
|
||||
}
|
||||
}
|
||||
} satisfies JsonifiableSchemableClass<typeof $jsonifiableSchemableConfig>
|
||||
|
||||
return jsonifiableClass as (
|
||||
Class<
|
||||
InstanceType<C> & InstanceType<typeof jsonifiableClass>,
|
||||
InstanceType<C> & JsonifiableSchemableObject<typeof $jsonifiableSchemableConfig>,
|
||||
ConstructorParameters<C>
|
||||
> &
|
||||
StaticMembers<C> &
|
||||
StaticMembers<typeof jsonifiableClass>
|
||||
StaticMembers<JsonifiableSchemableClass<typeof $jsonifiableSchemableConfig>>
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user