43 lines
1.2 KiB
TypeScript
43 lines
1.2 KiB
TypeScript
import type { Annotations, Class, Struct } from "@effect/schema/Schema"
|
|
import type { Mutable } from "effect/Types"
|
|
import type { Constructor } from "type-fest"
|
|
import type { StaticType } from "../../.."
|
|
import type { HasFields } from "./util"
|
|
|
|
|
|
export type TMutableClass<
|
|
Self,
|
|
Fields extends Struct.Fields,
|
|
I, R, C,
|
|
Inherited,
|
|
Proto,
|
|
> = (
|
|
Constructor<
|
|
Omit<
|
|
InstanceType<Class<Self, Fields, I, R, C, Inherited, Proto>>,
|
|
keyof Fields
|
|
> &
|
|
Mutable<Struct.Type<Fields>>,
|
|
|
|
ConstructorParameters<Class<Self, Fields, I, R, C, Inherited, Proto>>
|
|
> &
|
|
|
|
Omit<
|
|
StaticType<Class<Self, Fields, I, R, C, Inherited, Proto>>,
|
|
"extend"
|
|
> & {
|
|
extend<Extended>(identifier: string): <newFields extends Struct.Fields>(
|
|
fields: newFields | HasFields<newFields>,
|
|
annotations?: Annotations.Schema<Extended>,
|
|
) => TMutableClass<
|
|
Extended,
|
|
Fields & newFields,
|
|
I & Struct.Encoded<newFields>,
|
|
R | Struct.Context<newFields>,
|
|
C & Struct.Constructor<newFields>,
|
|
Self,
|
|
Proto
|
|
>
|
|
}
|
|
)
|