diff --git a/src/effect/schema/class/MutableTaggedClass.ts b/src/effect/schema/class/MutableTaggedClass.ts index b4c3e0e..201441f 100644 --- a/src/effect/schema/class/MutableTaggedClass.ts +++ b/src/effect/schema/class/MutableTaggedClass.ts @@ -1,21 +1,25 @@ import { Schema as S } from "@effect/schema" -import type { Annotations, Struct } from "@effect/schema/Schema" -import type { TMutableClass } from "./TMutableClass" +import type { Annotations, PropertySignature, Struct } from "@effect/schema/Schema" import type { HasFields } from "./util" -export function MutableClass(identifier: string) { - return ( +export function MutableTaggedClass(identifier?: string) { + return < + Tag extends string, + Fields extends Struct.Fields, + >( + tag: Tag, fieldsOr: Fields | HasFields, annotations?: Annotations.Schema, ) => - S.Class(identifier)(fieldsOr, annotations) as TMutableClass< + // S.TaggedClass(identifier)(tag, fieldsOr, annotations) as S.TaggedClass< + // Self, + // Tag, + // { readonly _tag: PropertySignature<":", Tag, never, ":", Tag, true, never> } & Fields + // > + S.TaggedClass(identifier)(tag, fieldsOr, annotations) as S.TaggedClass< Self, - Fields, - Struct.Encoded, - Struct.Context, - Struct.Constructor, - {}, - {} + Tag, + { readonly _tag: PropertySignature<":", Tag, never, ":", Tag, true, never> } & Fields > }