File tree Expand file tree Collapse file tree 1 file changed +47
-0
lines changed Expand file tree Collapse file tree 1 file changed +47
-0
lines changed Original file line number Diff line number Diff line change 1+ declare module 'joi-password-complexity' {
2+ import { ValidationError } from '@hapi/joi' ;
3+
4+ export type ComplexityOptions = {
5+ min ?: number ,
6+ max ?: number ,
7+ lowerCase ?: number ,
8+ upperCase ?: number ,
9+ numeric ?: number ,
10+ symbol ?: number ,
11+ requirementCount ?: number ,
12+ } ;
13+
14+ interface ValidationErrorItem {
15+ message : string ;
16+ type : string ;
17+ path : string [ ] ;
18+ options ?: ValidationOptions ;
19+ context ?: Context ;
20+ }
21+
22+ interface ValidationError extends Error {
23+ details : ValidationErrorItem [ ] ;
24+ annotate ( ) : string ;
25+ _object : any ;
26+ }
27+
28+ export type ComplexityObject = {
29+ type : string ,
30+ base : string ,
31+ messages : {
32+ 'passwordComplexity.tooShort' : string ,
33+ 'passwordComplexity.tooLong' : string ,
34+ 'passwordComplexity.lowercase' : string ,
35+ 'passwordComplexity.uppercase' : string ,
36+ 'passwordComplexity.numeric' : string ,
37+ 'passwordComplexity.symbol' : string ,
38+ 'passwordComplexity.requirementCount' : string ,
39+ } ,
40+ validate : ( value : string ) => {
41+ value : string
42+ error ?: ValidationError ,
43+ } ;
44+ } ;
45+
46+ export default function ( options : ComplexityOptions , label ?: string ) : ComplexityObject ;
47+ }
You can’t perform that action at this time.
0 commit comments