mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
[@types/braintree] Added validation error types. (#37148)
* Added validation error types. * Removed presumably private interfaces.
This commit is contained in:
parent
bb94c12b91
commit
e22df2fffe
19
types/braintree/index.d.ts
vendored
19
types/braintree/index.d.ts
vendored
@ -50,7 +50,7 @@ declare namespace braintree {
|
||||
|
||||
interface ValidatedResponse<T> {
|
||||
success: boolean;
|
||||
errors: () => string[];
|
||||
errors: ValidationErrorsCollection;
|
||||
message: string;
|
||||
params: Record<string, any>;
|
||||
address: T extends Address ? Address : never;
|
||||
@ -1685,4 +1685,21 @@ declare namespace braintree {
|
||||
export interface TooManyRequestsError extends Error {}
|
||||
export interface UnexpectedError extends Error {}
|
||||
export interface UpgradeRequired extends Error {}
|
||||
|
||||
/**
|
||||
* Validation errors
|
||||
*/
|
||||
|
||||
export interface ValidationError {
|
||||
attribute: string;
|
||||
code: string;
|
||||
message: string;
|
||||
}
|
||||
|
||||
export interface ValidationErrorsCollection {
|
||||
deepErrors(): ValidationError[];
|
||||
for(name: string): ValidationErrorsCollection;
|
||||
forIndex(index: number): ValidationErrorsCollection;
|
||||
on(name: string): ValidationError;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user