1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-10-29 23:12:39 +01:00

Properly type validation errors/warnings

This commit is contained in:
Mark McDowall 2024-03-02 14:00:58 -08:00 committed by Mark McDowall
parent e5f19f01fa
commit 20273b07ad

View File

@ -1,7 +1,21 @@
export interface ValidationFailure {
propertyName: string;
errorMessage: string;
severity: 'error' | 'warning';
}
export interface ValidationError extends ValidationFailure {
isWarning: false;
}
export interface ValidationWarning extends ValidationFailure {
isWarning: true;
}
export interface Pending<T> {
value: T;
errors: any[];
warnings: any[];
errors: ValidationError[];
warnings: ValidationWarning[];
}
export type PendingSection<T> = {