diff --git a/packages/vest/src/suiteResult/selectors/suiteSelectors.ts b/packages/vest/src/suiteResult/selectors/suiteSelectors.ts index dfc8585b9..8e6a082a5 100644 --- a/packages/vest/src/suiteResult/selectors/suiteSelectors.ts +++ b/packages/vest/src/suiteResult/selectors/suiteSelectors.ts @@ -140,6 +140,8 @@ export function suiteSelectors( return getFailures(summary, Severity.WARNINGS, fieldName); } + function getWarning(): Maybe>; + function getWarning(fieldName: F): Maybe; function getWarning(fieldName?: F): GetSingularResponse { return getFailure(Severity.WARNINGS, summary, fieldName as F); } @@ -150,6 +152,8 @@ export function suiteSelectors( return getFailures(summary, Severity.ERRORS, fieldName); } + function getError(): Maybe>; + function getError(fieldName: F): Maybe; function getError(fieldName?: F): GetSingularResponse { return getFailure(Severity.ERRORS, summary, fieldName as F); } @@ -177,16 +181,24 @@ export function suiteSelectors( } export interface SuiteSelectors { + getWarning(): Maybe>; + getWarning(fieldName: F): Maybe; getWarning(fieldName?: F): GetSingularResponse; + getError(): Maybe>; + getError(fieldName: F): Maybe; getError(fieldName?: F): GetSingularResponse; - getErrors(fieldName: F): string[]; getErrors(): FailureMessages; + getErrors(fieldName: F): string[]; + getErrors(fieldName?: F): string[] | FailureMessages; getWarnings(): FailureMessages; getWarnings(fieldName: F): string[]; - getErrorsByGroup(groupName: G, fieldName: F): string[]; + getWarnings(fieldName?: F): string[] | FailureMessages; getErrorsByGroup(groupName: G): FailureMessages; + getErrorsByGroup(groupName: G, fieldName: F): string[]; + getErrorsByGroup(groupName: G, fieldName?: F): string[] | FailureMessages; getWarningsByGroup(groupName: G): FailureMessages; getWarningsByGroup(groupName: G, fieldName: F): string[]; + getWarningsByGroup(groupName: G, fieldName?: F): string[] | FailureMessages; hasErrors(fieldName?: F): boolean; hasWarnings(fieldName?: F): boolean; hasErrorsByGroup(groupName: G, fieldName?: F): boolean;