import { RealModel } from '../custom/TransformModel'; import { CreateOptions } from './CreateOptions'; import { JoinTableAttributes } from './JoinTableAttributes'; import { Model } from './Model'; /** * The createAssociation 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... * // setRoles... * // addRoles... * // addRole... * createRole: Sequelize.BelongsToManyCreateAssociationMixin; * // removeRole... * // removeRoles... * // hasRole... * // hasRoles... * // countRoles... * } * ``` * * @see https://sequelize.org/master/class/lib/associations/belongs-to-many.js~BelongsToMany.html * @see Instance */ export type BelongsToManyCreateAssociationMixin = ( values?: { [attribute: string]: unknown }, options?: BelongsToManyCreateAssociationMixinOptions, ) => Promise>; /** * The options for the createAssociation mixin of the belongsToMany association. * @see BelongsToManyCreateAssociationMixin */ export interface BelongsToManyCreateAssociationMixinOptions extends CreateOptions { through?: JoinTableAttributes; }