diff --git a/src/effect/schema/class/Mutable.ts b/src/effect/schema/class/Mutable.ts index 78bbe1e..78569eb 100644 --- a/src/effect/schema/class/Mutable.ts +++ b/src/effect/schema/class/Mutable.ts @@ -39,17 +39,18 @@ extends Omit< } -type MutableInput< +interface MutableInput< Self, Fields extends Schema.Struct.Fields, I, R, C, Inherited, Proto -> = Omit, - | "extend" - | "transformOrFail" - | "transformOrFailFrom" -> +> extends StaticType> { + new( + props: any, + options?: any, + ): Schema.Struct.Type & Omit & Proto +} export const Mutable = < Self, diff --git a/src/effect/schema/tests.ts b/src/effect/schema/tests.ts index d2fa624..86360b1 100644 --- a/src/effect/schema/tests.ts +++ b/src/effect/schema/tests.ts @@ -12,12 +12,14 @@ import { Mutable } from "./class/Mutable" // MobXObservable // ) {} -class User extends Class("User")({ +const UserProto = Class("User")({ id: S.BigIntFromSelf, role: S.Union(S.Literal("BasicUser"), S.Literal("Admin")), -}) {} +}) -const MutableUser = Mutable(User) +class User extends UserProto {} + +const MutableUser = Mutable(UserProto) const JsonifiableUser = User.pipe( Jsonifiable(S.Struct({