import { FindAttributeOptions } from './FindAttributeOptions'; import { FindOptions } from './FindOptions'; import { Model } from './Model'; /** * The getAssociations mixin applied to models with belongsToMany. * An example of usage is as follows: * * ```js * * User.belongsToMany(Role, { through: UserRole }); * * interface UserInstance extends Sequelize.Instance, UserAttributes { * getRoles: Sequelize.BelongsToManyGetAssociationsMixin; * // setRoles... * // addRoles... * // addRole... * // createRole... * // removeRole... * // removeRoles... * // hasRole... * // hasRoles... * // countRoles... * } * ``` * * @see https://sequelize.org/master/class/lib/associations/belongs-to-many.js~BelongsToMany.html * @see Instance */ export type BelongsToManyGetAssociationsMixin = ( options?: BelongsToManyGetAssociationsMixinOptions, ) => Promise; /** * The options for the getAssociations mixin of the belongsToMany association. * @see BelongsToManyGetAssociationsMixin */ export interface BelongsToManyGetAssociationsMixinOptions extends FindOptions { /** * A list of the attributes from the join table that you want to select. */ joinTableAttributes?: FindAttributeOptions; /** * Apply a scope on the related model, or remove its default scope by passing false. */ scope?: string | boolean; }