import { Schema as S } from "@effect/schema" import type { Mutable } from "effect/Types" import type { StaticType } from "../../../StaticType" import type { HasFields } from "./util" export interface IMutableClass< Self, Fields extends S.Struct.Fields, I, R, C, Inherited, Proto, > extends Omit< StaticType>, "extend" > { new( ...args: ConstructorParameters> ): Omit< InstanceType>, keyof Fields > & Mutable> extend(identifier: string): ( fields: newFields | HasFields, annotations?: S.Annotations.Schema, ) => IMutableClass< Extended, Fields & newFields, I & S.Struct.Encoded, R | S.Struct.Context, C & S.Struct.Constructor, Self, Proto > } export const MutableClass = S.Class as (identifier: string) => ( fieldsOr: Fields | HasFields, annotations?: S.Annotations.Schema, ) => IMutableClass< Self, Fields, S.Struct.Encoded, S.Struct.Context, S.Struct.Constructor, {}, {} >