import { Schema as S } from "@effect/schema" import type { Annotations, Struct } from "@effect/schema/Schema" import type { TMutableClass } from "./TMutableClass" import type { HasFields, MissingSelfGeneric } from "./util" export const MutableClass = (identifier: string) => ( ( fieldsOr: Fields | HasFields, annotations?: Annotations.Schema, ): ( [Self] extends [never] ? MissingSelfGeneric<"Class"> : TMutableClass< Self, Fields, Struct.Encoded, Struct.Context, Struct.Constructor, {}, {} > ) => S.Class(identifier)(fieldsOr, annotations) )