-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
82 lines (82 loc) · 2.15 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
declare module '@rfcx/http-utils' {
class Conversion {
src: any
target: any
property: string
value: any
conversions: any[]
required: boolean
defaultValue: any
execute(): void
default(def: any): this
optional(): this
throwError(message: string): void
toFloat(): this
minimum(a: number): this
maximum(b: number): this
minLength(a: string): this
maxLength(b: string): this
nonEmpty(): this
toUuid(): this
toLatitude(): this
toLongitude(): this
toMoment(tz: string): this
toMomentUtc(): this
toDateString(): this
toTimeInterval(): this
toAggregateFunction(): this
toInt(): this
toNonNegativeInt(): this
toString(): this
toLowerCase(): this
toUpperCase(): this
trim(): this
objToString(): this
toBoolean(): this
toArray(): this
toIntArray(): this
toFloatArray(): this
nonEmptyArrayItem(): this
isObject(): this
isValidTimezone(): this
isEqualToAny(values: any[]): this
isPassingRegExp(exp: RegExp, customErrMes?: string)
}
interface converterOptions {
camelize?: boolean
}
class Converter {
constructor(validatedObject: any, transformedObject: any, options?: converterOptions)
validatedObject: any
currentValue: any
currentProperty: string
transformedObject: any
conversions: any[]
options: converterOptions
convert(property: string): Conversion
validate(): any
}
function httpError (req: Object, res: Object, code: number, context: string, mes: string): void
function httpErrorHandler (req: Object, res: Object, fallbackMessage: string): (err: ForbiddenError | EmptyResultError | ValidationError | UnauthorizedError | Error) => {}
function mapAxiosErrorToCustom (err: any): never
class ForbiddenError {
constructor(message?: string)
message: string
name: string
}
class EmptyResultError {
constructor(message?: string)
message: string
name: string
}
class ValidationError {
constructor(message?: string)
message: string
name: string
}
class UnauthorizedError {
constructor(message?: string)
message: string
name: string
}
}