mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 23:07:06 +00:00
fix(sequelize): BelongsToCreateAssociationMixin interfacee
This commit is contained in:
Vendored
+2
-2
@@ -139,7 +139,7 @@ declare namespace sequelize {
|
||||
* @see http://docs.sequelizejs.com/en/latest/api/associations/belongs-to/
|
||||
* @see Instance
|
||||
*/
|
||||
interface BelongsToCreateAssociationMixin<TAttributes> {
|
||||
interface BelongsToCreateAssociationMixin<TAttributes, TInstance> {
|
||||
/**
|
||||
* 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<void>;
|
||||
): Promise<TInstance>;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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<ProductAttributes>, Product
|
||||
// belongsTo association mixins:
|
||||
getWarehouse: Sequelize.BelongsToGetAssociationMixin<WarehouseInstance>;
|
||||
setWarehouse: Sequelize.BelongsToSetAssociationMixin<WarehouseInstance, number>;
|
||||
createWarehouse: Sequelize.BelongsToCreateAssociationMixin<WarehouseAttributes>;
|
||||
createWarehouse: Sequelize.BelongsToCreateAssociationMixin<WarehouseAttributes, WarehouseInstance>;
|
||||
};
|
||||
|
||||
interface BarcodeAttributes {
|
||||
@@ -378,7 +378,7 @@ interface BarcodeInstance extends Sequelize.Instance<BarcodeAttributes>, Barcode
|
||||
// belongsTo association mixins:
|
||||
getProduct: Sequelize.BelongsToGetAssociationMixin<ProductInstance>;
|
||||
setProduct: Sequelize.BelongsToSetAssociationMixin<ProductInstance, number>;
|
||||
createProduct: Sequelize.BelongsToCreateAssociationMixin<ProductAttributes>;
|
||||
createProduct: Sequelize.BelongsToCreateAssociationMixin<ProductAttributes, ProductInstance>;
|
||||
};
|
||||
|
||||
interface WarehouseAttributes {
|
||||
|
||||
Reference in New Issue
Block a user