Skip to content

Commit ede0382

Browse files
committed
Update index.d.ts
1 parent 757e553 commit ede0382

File tree

1 file changed

+25
-26
lines changed

1 file changed

+25
-26
lines changed

index.d.ts

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,34 @@
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;
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;
2121
};
2222

2323
type Paths = {
24-
[path: string]: { origin: Boolean; kind: string; message: string };
24+
[path: string]: {
25+
origin?: Boolean;
26+
kind?: string;
27+
message?: string;
28+
};
2529
};
2630

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

3534
export = mongooseValidationErrorHandler;

0 commit comments

Comments
 (0)