()
| 27 | ); |
| 28 | |
| 29 | async function test() { |
| 30 | expectTypeOf<UserModel>().toMatchTypeOf(User.build()); |
| 31 | |
| 32 | const user = await User.findOne(); |
| 33 | expectTypeOf(user).toEqualTypeOf<UserModel | null>(); |
| 34 | |
| 35 | if (!user) return; |
| 36 | user.firstName = 'John'; |
| 37 | await user.save(); |
| 38 | } |
| 39 | |
| 40 | // The below doesn't define Attribute types, but should still work |
| 41 | interface UntypedUserModel extends Model, UserAttributes {} |