@@ -6,11 +6,11 @@ export type ValidationErrors = Record<string, Array<string>>
66
77export type SimpleValidationErrors = Record < string , string >
88
9- export type Config = AxiosRequestConfig & {
9+ export type Config = AxiosRequestConfig & {
1010 precognitive ?: boolean ,
11- validate ?: Iterable < string > | ArrayLike < string > ,
12- fingerprint ?: string | null ,
13- onBefore ?: ( ) => boolean | undefined ,
11+ validate ?: Iterable < string > | ArrayLike < string > ,
12+ fingerprint ?: string | null ,
13+ onBefore ?: ( ) => boolean | undefined ,
1414 onStart ?: ( ) => void ,
1515 onSuccess ?: ( response : AxiosResponse ) => unknown ,
1616 onPrecognitionSuccess ?: ( response : AxiosResponse ) => unknown ,
@@ -24,15 +24,15 @@ export type Config = AxiosRequestConfig&{
2424}
2525
2626interface RevalidatePayload {
27- data : Record < string , unknown > | null ,
27+ data : Record < string , unknown > | null ,
2828 touched : Array < string > ,
2929}
3030
31- export type ValidationConfig = Config & {
32- onBeforeValidation ?: ( newRequest : RevalidatePayload , oldRequest : RevalidatePayload ) => boolean | undefined ,
31+ export type ValidationConfig = Config & {
32+ onBeforeValidation ?: ( newRequest : RevalidatePayload , oldRequest : RevalidatePayload ) => boolean | undefined ,
3333}
3434
35- export type RequestFingerprintResolver = ( config : Config , axios : AxiosInstance ) => string | null
35+ export type RequestFingerprintResolver = ( config : Config , axios : AxiosInstance ) => string | null
3636
3737export type SuccessResolver = ( response : AxiosResponse ) => boolean
3838
@@ -43,21 +43,21 @@ export interface Client {
4343 put ( url : string , data ?: Record < string , unknown > , config ?: Config ) : Promise < unknown > ,
4444 delete ( url : string , data ?: Record < string , unknown > , config ?: Config ) : Promise < unknown > ,
4545 use ( axios : AxiosInstance ) : Client ,
46- fingerprintRequestsUsing ( callback : RequestFingerprintResolver | null ) : Client ,
46+ fingerprintRequestsUsing ( callback : RequestFingerprintResolver | null ) : Client ,
4747 determineSuccessUsing ( callback : SuccessResolver ) : Client ,
4848 axios ( ) : AxiosInstance ,
4949}
5050
5151export interface Validator {
5252 touched ( ) : Array < string > ,
53- validate ( input ?: string | NamedInputEvent | ValidationConfig , value ?: unknown , config ?: ValidationConfig ) : Validator ,
54- touch ( input : string | NamedInputEvent | Array < string > ) : Validator ,
53+ validate ( input ?: string | NamedInputEvent | ValidationConfig , value ?: unknown , config ?: ValidationConfig ) : Validator ,
54+ touch ( input : string | NamedInputEvent | Array < string > ) : Validator ,
5555 validating ( ) : boolean ,
5656 valid ( ) : Array < string > ,
5757 errors ( ) : ValidationErrors ,
58- setErrors ( errors : ValidationErrors | SimpleValidationErrors ) : Validator ,
58+ setErrors ( errors : ValidationErrors | SimpleValidationErrors ) : Validator ,
5959 hasErrors ( ) : boolean ,
60- forgetError ( error : string | NamedInputEvent ) : Validator ,
60+ forgetError ( error : string | NamedInputEvent ) : Validator ,
6161 reset ( ...names : string [ ] ) : Validator ,
6262 setTimeout ( duration : number ) : Validator ,
6363 on ( event : keyof ValidatorListeners , callback : ( ) => void ) : Validator ,
@@ -71,7 +71,7 @@ export interface ValidatorListeners {
7171 validatedChanged : Array < ( ) => void > ,
7272}
7373
74- export type RequestMethod = 'get' | 'post' | 'patch' | 'put' | 'delete'
74+ export type RequestMethod = 'get' | 'post' | 'patch' | 'put' | 'delete'
7575
7676export type ValidationCallback = ( client : {
7777 get ( url : string , data ?: Record < string , unknown > , config ?: ValidationConfig ) : Promise < unknown > ,
0 commit comments