mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-06-02 06:29:40 +08:00
Merge pull request #16517 from MugeSo/sequelize-fix-parent-of-unique-constraint-error
sequelize: fix inheritance of UniqueConstraintError class.
This commit is contained in:
6
types/sequelize/index.d.ts
vendored
6
types/sequelize/index.d.ts
vendored
@@ -2097,7 +2097,7 @@ declare namespace sequelize {
|
||||
|
||||
}
|
||||
|
||||
interface UniqueConstraintError extends DatabaseError {
|
||||
interface UniqueConstraintError extends ValidationError {
|
||||
|
||||
/**
|
||||
* Thrown when a unique constraint is violated in the database
|
||||
@@ -3247,8 +3247,8 @@ declare namespace sequelize {
|
||||
* https://github.com/sequelize/sequelize/blob/master/docs/docs/models-usage.md#user-content-manipulating-the-dataset-with-limit-offset-order-and-group
|
||||
*/
|
||||
group?: string | string[] | Object;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Apply DISTINCT(col) for FindAndCount(all)
|
||||
*/
|
||||
|
||||
@@ -630,6 +630,8 @@ new s.HostNotReachableError( new Error( 'original connection error message' ) );
|
||||
new s.InvalidConnectionError( new Error( 'original connection error message' ) );
|
||||
new s.ConnectionTimedOutError( new Error( 'original connection error message' ) );
|
||||
|
||||
const uniqueConstraintError: Sequelize.ValidationError = new s.UniqueConstraintError({});
|
||||
|
||||
//
|
||||
// Hooks
|
||||
// ~~~~~~~
|
||||
|
||||
2
types/sequelize/v3/index.d.ts
vendored
2
types/sequelize/v3/index.d.ts
vendored
@@ -2096,7 +2096,7 @@ declare namespace sequelize {
|
||||
|
||||
}
|
||||
|
||||
interface UniqueConstraintError extends DatabaseError {
|
||||
interface UniqueConstraintError extends ValidationError {
|
||||
|
||||
/**
|
||||
* Thrown when a unique constraint is violated in the database
|
||||
|
||||
@@ -628,6 +628,7 @@ new s.HostNotReachableError( new Error( 'original connection error message' ) );
|
||||
new s.InvalidConnectionError( new Error( 'original connection error message' ) );
|
||||
new s.ConnectionTimedOutError( new Error( 'original connection error message' ) );
|
||||
|
||||
const uniqueConstraintError: Sequelize.ValidationError = new s.UniqueConstraintError({});
|
||||
//
|
||||
// Hooks
|
||||
// ~~~~~~~
|
||||
|
||||
Reference in New Issue
Block a user