diff --git a/sequelize/index.d.ts b/sequelize/index.d.ts index fbbc02d0e1..fb4b878b57 100644 --- a/sequelize/index.d.ts +++ b/sequelize/index.d.ts @@ -481,7 +481,7 @@ declare namespace sequelize { * @see http://docs.sequelizejs.com/en/latest/api/associations/has-many/ * @see Instance */ - interface HasManyCreateAssociationMixin { + interface HasManyCreateAssociationMixin { /** * Create a new instance of the associated model and associate it with this. * @param values The values used to create the association. @@ -490,7 +490,7 @@ declare namespace sequelize { ( values?: TAttributes, options?: HasManyCreateAssociationMixinOptions | CreateOptions - ): Promise; + ): Promise; } /** @@ -944,7 +944,7 @@ declare namespace sequelize { * @see http://docs.sequelizejs.com/en/latest/api/associations/belongs-to-many/ * @see Instance */ - interface BelongsToManyCreateAssociationMixin { + interface BelongsToManyCreateAssociationMixin { /** * Create a new instance of the associated model and associate it with this. * @param values The values used to create the association. @@ -953,7 +953,7 @@ declare namespace sequelize { ( values?: TAttributes, options?: BelongsToManyCreateAssociationMixinOptions | CreateOptions | TJoinTableAttributes - ): Promise; + ): Promise; } /** diff --git a/sequelize/sequelize-tests.ts b/sequelize/sequelize-tests.ts index ceff709a6b..9425bd4f84 100644 --- a/sequelize/sequelize-tests.ts +++ b/sequelize/sequelize-tests.ts @@ -210,7 +210,7 @@ barcode.setProduct(product, { save: true }).then(() => { }); barcode.createProduct(); barcode.createProduct({ id: 1, name: 'Crowbar' }); -barcode.createProduct({ id: 1 }, { save: true, silent: true }).then(() => { }); +barcode.createProduct({ id: 1 }, { save: true, silent: true }).then((product) => { }); product.getWarehouse(); product.getWarehouse({ scope: null }).then(w => w.capacity); @@ -243,7 +243,7 @@ warehouse.addProduct(2, { validate: true }).then(() => { }); warehouse.createProduct(); warehouse.createProduct({ id: 1, name: 'baz' }); -warehouse.createProduct({ id: 1 }, { silent: true }).then(() => { }); +warehouse.createProduct({ id: 1 }, { silent: true }).then((product) => { }); warehouse.removeProducts(); warehouse.removeProducts([product]); @@ -281,7 +281,7 @@ warehouse.addBranch(2, { validate: true, distance: 1 }).then(() => { }); warehouse.createBranch(); warehouse.createBranch({ id: 1, address: 'baz' }); -warehouse.createBranch({ id: 1 }, { silent: true, distance: 1 }).then(() => { }); +warehouse.createBranch({ id: 1 }, { silent: true, distance: 1 }).then((branch) => { }); warehouse.removeBranches(); warehouse.removeBranches([branch]); @@ -319,7 +319,7 @@ customer.addBranch(2, { validate: true }).then(() => { }); customer.createBranch(); customer.createBranch({ id: 1, address: 'baz' }); -customer.createBranch({ id: 1 }, { silent: true }).then(() => { }); +customer.createBranch({ id: 1 }, { silent: true }).then((branch) => { }); customer.removeBranches(); customer.removeBranches([branch]); @@ -383,7 +383,7 @@ interface WarehouseInstance extends Sequelize.Instance, War setProducts: Sequelize.HasManySetAssociationsMixin; addProducts: Sequelize.HasManyAddAssociationsMixin; addProduct: Sequelize.HasManyAddAssociationMixin; - createProduct: Sequelize.HasManyCreateAssociationMixin; + createProduct: Sequelize.HasManyCreateAssociationMixin; removeProduct: Sequelize.HasManyRemoveAssociationMixin; removeProducts: Sequelize.HasManyRemoveAssociationsMixin; hasProduct: Sequelize.HasManyHasAssociationMixin; @@ -395,7 +395,7 @@ interface WarehouseInstance extends Sequelize.Instance, War setBranches: Sequelize.BelongsToManySetAssociationsMixin; addBranches: Sequelize.BelongsToManyAddAssociationsMixin; addBranch: Sequelize.BelongsToManyAddAssociationMixin; - createBranch: Sequelize.BelongsToManyCreateAssociationMixin; + createBranch: Sequelize.BelongsToManyCreateAssociationMixin; removeBranch: Sequelize.BelongsToManyRemoveAssociationMixin; removeBranches: Sequelize.BelongsToManyRemoveAssociationsMixin; hasBranch: Sequelize.BelongsToManyHasAssociationMixin; @@ -415,7 +415,7 @@ interface BranchInstance extends Sequelize.Instance, BranchAtt setWarehouses: Sequelize.BelongsToManySetAssociationsMixin; addWarehouses: Sequelize.BelongsToManyAddAssociationsMixin; addWarehouse: Sequelize.BelongsToManyAddAssociationMixin; - createWarehouse: Sequelize.BelongsToManyCreateAssociationMixin; + createWarehouse: Sequelize.BelongsToManyCreateAssociationMixin; removeWarehouse: Sequelize.BelongsToManyRemoveAssociationMixin; removeWarehouses: Sequelize.BelongsToManyRemoveAssociationsMixin; hasWarehouse: Sequelize.BelongsToManyHasAssociationMixin; @@ -427,7 +427,7 @@ interface BranchInstance extends Sequelize.Instance, BranchAtt setCustomers: Sequelize.BelongsToManySetAssociationsMixin; addCustomers: Sequelize.BelongsToManyAddAssociationsMixin; addCustomer: Sequelize.BelongsToManyAddAssociationMixin; - createCustomer: Sequelize.BelongsToManyCreateAssociationMixin; + createCustomer: Sequelize.BelongsToManyCreateAssociationMixin; removeCustomer: Sequelize.BelongsToManyRemoveAssociationMixin; removeCustomers: Sequelize.BelongsToManyRemoveAssociationsMixin; hasCustomer: Sequelize.BelongsToManyHasAssociationMixin; @@ -453,7 +453,7 @@ interface CustomerInstance extends Sequelize.Instance, Custo setBranches: Sequelize.BelongsToManySetAssociationsMixin; addBranches: Sequelize.BelongsToManyAddAssociationsMixin; addBranch: Sequelize.BelongsToManyAddAssociationMixin; - createBranch: Sequelize.BelongsToManyCreateAssociationMixin; + createBranch: Sequelize.BelongsToManyCreateAssociationMixin; removeBranch: Sequelize.BelongsToManyRemoveAssociationMixin; removeBranches: Sequelize.BelongsToManyRemoveAssociationsMixin; hasBranch: Sequelize.BelongsToManyHasAssociationMixin;