import { CommonErrorProperties, ErrorOptions } from '../base-error'; import ValidationError, { ValidationErrorItem } from '../validation-error'; interface UniqueConstraintErrorParent extends Error, Pick { } export interface UniqueConstraintErrorOptions extends ErrorOptions { parent?: UniqueConstraintErrorParent; original?: UniqueConstraintErrorParent; errors?: ValidationErrorItem[]; fields?: Record; message?: string; } /** * Thrown when a unique constraint is violated in the database */ declare class UniqueConstraintError extends ValidationError implements CommonErrorProperties { readonly parent: UniqueConstraintErrorParent; readonly original: UniqueConstraintErrorParent; readonly fields: Record; readonly sql: string; constructor(options: UniqueConstraintErrorOptions); } export default UniqueConstraintError;