diff --git a/types/sequelize/index.d.ts b/types/sequelize/index.d.ts index 8c6622c1ab..0625a6406a 100644 --- a/types/sequelize/index.d.ts +++ b/types/sequelize/index.d.ts @@ -2890,9 +2890,12 @@ declare namespace sequelize { changed(): boolean | string[]; /** - * Returns the previous value for key from `_previousDataValues`. + * If previous is called with a string, it will return the previous value for the key from `_previousDataValues`. + * + * If previous is called without an argument, it will return an object containing the previous keys and values that have changed. */ previous(key: keyof TAttributes): any; + previous(): object; /** * Validate this instance, and if the validation passes, persist it to the database. diff --git a/types/sequelize/sequelize-tests.ts b/types/sequelize/sequelize-tests.ts index 702821ae25..0592a36df4 100644 --- a/types/sequelize/sequelize-tests.ts +++ b/types/sequelize/sequelize-tests.ts @@ -833,6 +833,7 @@ user.changed( 'name' ); user.changed(); user.previous( 'name' ); +user.previous(); user.save().then( ( p ) => p ); user.save( { fields : ['a'] } ).then( ( p ) => p );