MutableTaggedClass

This commit is contained in:
Julien Valverdé
2024-06-14 21:26:26 +02:00
parent dc5c56ddef
commit 27c80a7b1e
5 changed files with 16 additions and 106 deletions

View File

@@ -1,37 +0,0 @@
import type { Class, Struct } from "@effect/schema/Schema"
import type { Constructor } from "type-fest"
import type { StaticType } from "../../.."
import type { TMutableClass } from "./TMutableClass"
export function Mutable<
This extends Class<Self, Fields, I, R, C, Inherited, Proto>,
Self,
Fields extends Struct.Fields,
I, R, C,
Inherited,
Proto,
>(
class_:
| This
| Class<Self, Fields, I, R, C, Inherited, Proto>
) {
return class_ as (
Constructor<
Omit<
InstanceType<This>,
keyof InstanceType<Class<Self, Fields, I, R, C, Inherited, Proto>>
> &
InstanceType<TMutableClass<Self, Fields, I, R, C, Inherited, Proto>>,
ConstructorParameters<TMutableClass<Self, Fields, I, R, C, Inherited, Proto>>
> &
Omit<
StaticType<This>,
keyof StaticType<Class<Self, Fields, I, R, C, Inherited, Proto>>
> &
StaticType<TMutableClass<Self, Fields, I, R, C, Inherited, Proto>>
)
}