Tests
Some checks failed
Lint / lint (push) Failing after 11s

This commit is contained in:
Julien Valverdé
2024-07-27 02:59:51 +02:00
parent 7e90178126
commit 1f8a92bc66
2 changed files with 12 additions and 9 deletions

View File

@@ -39,17 +39,18 @@ extends Omit<
}
type MutableInput<
interface MutableInput<
Self,
Fields extends Schema.Struct.Fields,
I, R, C,
Inherited,
Proto
> = Omit<Schema.Class<Self, Fields, I, R, C, Inherited, Proto>,
| "extend"
| "transformOrFail"
| "transformOrFailFrom"
>
> extends StaticType<Schema.Class<Self, Fields, I, R, C, Inherited, Proto>> {
new(
props: any,
options?: any,
): Schema.Struct.Type<Fields> & Omit<Inherited, keyof Fields> & Proto
}
export const Mutable = <
Self,

View File

@@ -12,12 +12,14 @@ import { Mutable } from "./class/Mutable"
// MobXObservable
// ) {}
class User extends Class<User>("User")({
const UserProto = Class<User>("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({