types/sequelize

Cannot extend Model like in README.md

hartherbert opened this issue · 0 comments

Hey,

I am having trouble setting up a model like in the README.md of the repo.
If I try to setup a Model like this:

export class User extends Model {
    static associations: {
        group: BelongsTo
    }

    id: number
    username: string
    firstName: string
    lastName: string
    createdAt: Date
    updatedAt: Date

    // mixins for association (optional)
    groupId: number
    group: UserGroup
    getGroup: BelongsToGetAssociationMixin<UserGroup>
    setGroup: BelongsToSetAssociationMixin<UserGroup, number>
    createGroup: BelongsToCreateAssociationMixin<UserGroup>
}

I get an typescript error saying: Type 'Model<any, any>' is not a constructor function type.

In the types I can only find an Model Interface beeing exported and no class being exported.

I appreciate any help.