Skip to content

Commit f83ed90

Browse files
authored
Merge pull request #3 from AnechaS/refactor/dts
Update index.d.ts
2 parents 5f01e64 + 6ca936a commit f83ed90

File tree

1 file changed

+29
-24
lines changed

1 file changed

+29
-24
lines changed

index.d.ts

Lines changed: 29 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,35 @@
11
type ValidatorMessages = {
2-
base: String,
3-
required: String,
4-
enum: String,
5-
validate: String,
6-
unique: String,
7-
buffer: String,
8-
boolean: String,
9-
objectId: String,
10-
map: String,
11-
string: String,
12-
maxlength: String,
13-
minlength: String,
14-
regexp: String,
15-
number: String,
16-
'number.max': String,
17-
'number.min': String,
18-
date: String,
19-
'date.max': String,
20-
'date.min': String,
21-
}
2+
base: string;
3+
required: string;
4+
enum: string;
5+
validate: string;
6+
unique: string;
7+
buffer: string;
8+
boolean: string;
9+
objectId: string;
10+
map: string;
11+
string: string;
12+
maxlength: string;
13+
minlength: string;
14+
regexp: string;
15+
number: string;
16+
'number.max': string;
17+
'number.min': string;
18+
date: string;
19+
'date.max': string;
20+
'date.min': string;
21+
};
2222

2323
type Paths = {
24-
[path: string]: { origin: Boolean, kind: String, message: String }
25-
}
24+
[path: string]: { origin: Boolean; kind: string; message: string };
25+
};
2626

27-
declare function mongooseValidationErrorHandler(error: Error, options?: { messages?: ValidatorMessages, paths?: Paths }): Error;
27+
type Options = {
28+
messages?: ValidatorMessages;
29+
paths?: Paths;
30+
};
31+
32+
declare function mongooseValidationErrorHandler(error: Error, options?: Options): Error;
2833
declare namespace mongooseValidationErrorHandler {}
2934

30-
export = mongooseValidationErrorHandler;
35+
export = mongooseValidationErrorHandler;

0 commit comments

Comments
 (0)