types/sequelize

Documentation for BelongsToSetAssociationMixin outdated?

Opened this issue · 1 comments

I tried using this syntax earlier today from here and it wasn't working:


interface UserInstance extends Sequelize.Instance<UserInstance, UserAttributes>, UserAttributes {
   // getRole...
   setRole: Sequelize.BelongsToSetAssociationMixin<RoleInstance, RoleId>;
   // createRole...
}

TypeScript (2.0.3 btw) complains that Generic type 'Instance<TAttributes>' requires 1 type argument(s). Replacing it with Sequelize.Instance<UserAttributes> seems to work.

Further, RoleId isn't described in the documentation; what is that value from? I supplied the type keyword for what that field is in my RoleAttributes interface and it seems to have worked.

Apologies if this is all working as it should and I'm just missing something obvious!

Yep, the docblocks are very outdated. The README and tests should be up to date though. Feel free to do a PR.