MutableClass work

This commit is contained in:
Julien Valverdé
2024-06-13 21:42:45 +02:00
parent 4b7c9acfdf
commit c3f2ddee5d

View File

@@ -1,9 +1,26 @@
import { Schema as S } from "@effect/schema" import { Schema as S } from "@effect/schema"
import type { Annotations, Struct } from "@effect/schema/Schema" import type { Annotations, Class, Struct } from "@effect/schema/Schema"
import type { StaticType } from "../../../StaticType"
import type { TMutableClass } from "./TMutableClass" import type { TMutableClass } from "./TMutableClass"
import type { HasFields } from "./util" import type { HasFields } from "./util"
export interface IMutableClass<
Self,
Fields extends Struct.Fields,
I, R, C,
Inherited,
Proto,
>
extends Omit<
StaticType<Class<Self, Fields, I, R, C, Inherited, Proto>>,
"extend"
>
{
}
export function MutableClass<Self>(identifier: string) { export function MutableClass<Self>(identifier: string) {
return <Fields extends Struct.Fields>( return <Fields extends Struct.Fields>(
fieldsOr: Fields | HasFields<Fields>, fieldsOr: Fields | HasFields<Fields>,