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