import { Schema } from "@effect/schema" import type { Mutable } from "effect/Types" import type { StaticType } from "../Types" import type { HasFields } from "./util" export interface IMutableClass< Self, Fields extends Schema.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?: Schema.Annotations.Schema, ) => IMutableClass< Extended, Fields & newFields, I & Schema.Struct.Encoded, R | Schema.Struct.Context, C & Schema.Struct.Constructor, Self, Proto > } export const MutableClass = Schema.Class as (identifier: string) => ( fieldsOr: Fields | HasFields, annotations?: Schema.Annotations.Schema, ) => IMutableClass< Self, Fields, Schema.Struct.Encoded, Schema.Struct.Context, Schema.Struct.Constructor, {}, {} >