From c576d06f3a3653def026d5983dcdf9bde03d0de5 Mon Sep 17 00:00:00 2001 From: Erik Kristensen Date: Mon, 29 Oct 2018 09:38:48 -0600 Subject: [PATCH] fix(sequelize): BelongsToCreateAssociationMixin interfacee --- types/sequelize/index.d.ts | 4 ++-- types/sequelize/sequelize-tests.ts | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/types/sequelize/index.d.ts b/types/sequelize/index.d.ts index b6871ca3c4..f80d5acc40 100644 --- a/types/sequelize/index.d.ts +++ b/types/sequelize/index.d.ts @@ -139,7 +139,7 @@ declare namespace sequelize { * @see http://docs.sequelizejs.com/en/latest/api/associations/belongs-to/ * @see Instance */ - interface BelongsToCreateAssociationMixin { + interface BelongsToCreateAssociationMixin { /** * Create a new instance of the associated model and associate it with this. * @param values The values used to create the association. @@ -148,7 +148,7 @@ declare namespace sequelize { ( values?: TAttributes, options?: BelongsToCreateAssociationMixinOptions | CreateOptions | BelongsToSetAssociationMixinOptions - ): Promise; + ): Promise; } /** diff --git a/types/sequelize/sequelize-tests.ts b/types/sequelize/sequelize-tests.ts index 0592a36df4..4e0aa9a73d 100644 --- a/types/sequelize/sequelize-tests.ts +++ b/types/sequelize/sequelize-tests.ts @@ -220,7 +220,7 @@ barcode.setProduct(product, { save: true }).then(() => { }); barcode.createProduct(); barcode.createProduct({ id: 1, name: 'Crowbar' }); -barcode.createProduct({ id: 1 }, { save: true, silent: true }).then((product) => { }); +barcode.createProduct({ id: 1 }, { save: true, silent: true }).then((product: ProductInstance) => { }); product.getWarehouse(); product.getWarehouse({ scope: null }).then(w => w.capacity); @@ -365,7 +365,7 @@ interface ProductInstance extends Sequelize.Instance, Product // belongsTo association mixins: getWarehouse: Sequelize.BelongsToGetAssociationMixin; setWarehouse: Sequelize.BelongsToSetAssociationMixin; - createWarehouse: Sequelize.BelongsToCreateAssociationMixin; + createWarehouse: Sequelize.BelongsToCreateAssociationMixin; }; interface BarcodeAttributes { @@ -378,7 +378,7 @@ interface BarcodeInstance extends Sequelize.Instance, Barcode // belongsTo association mixins: getProduct: Sequelize.BelongsToGetAssociationMixin; setProduct: Sequelize.BelongsToSetAssociationMixin; - createProduct: Sequelize.BelongsToCreateAssociationMixin; + createProduct: Sequelize.BelongsToCreateAssociationMixin; }; interface WarehouseAttributes {