diff --git a/types/sequelize/index.d.ts b/types/sequelize/index.d.ts index f80d5acc40..88ed87efae 100644 --- a/types/sequelize/index.d.ts +++ b/types/sequelize/index.d.ts @@ -3908,6 +3908,7 @@ declare namespace sequelize { */ findById(identifier?: number | string | Buffer, options?: FindOptions): Promise; findByPrimary(identifier?: number | string | Buffer, options?: FindOptions): Promise; + findByPk(identifier?: number | string | Buffer, options?: FindOptions): Promise; /** * Search for a single instance. This applies LIMIT 1, so the listener will always be called with a single diff --git a/types/sequelize/sequelize-tests.ts b/types/sequelize/sequelize-tests.ts index 4e0aa9a73d..6b7ea6ea0a 100644 --- a/types/sequelize/sequelize-tests.ts +++ b/types/sequelize/sequelize-tests.ts @@ -981,6 +981,10 @@ User.findByPrimary( 'a string' ); User.findByPrimary( 42 ); User.findByPrimary( Buffer.from('a buffer') ); +User.findByPk( 'a string' ); +User.findByPk( 42 ); +User.findByPk( Buffer.from('a buffer') ); + User.findOne( { where : { username : 'foo' } } ); User.findOne( { where : { id : 1 }, attributes : ['id', ['username', 'name']] } ); User.findOne( { where : { id : 1 }, attributes : ['id'] } );