Add joi-password-complexity type definitions (#37724)

* Add joi-password-complexity type definitions

* Remove tslint rules
This commit is contained in:
Nico Flaig
2019-08-20 16:34:47 -07:00
committed by Sheetal Nandi
parent 70b782ba42
commit b4ee5a63aa
4 changed files with 63 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
// Type definitions for joi-password-complexity 3.1
// Project: https://github.com/kamronbatman/joi-password-complexity
// Definitions by: Nico Flaig <https://github.com/nflaig>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 3.5
// tslint:disable-next-line:no-unnecessary-class
declare class PasswordComplexity {
constructor(options?: PasswordComplexity.ComplexityOptions);
}
declare namespace PasswordComplexity {
interface ComplexityOptions {
min: number;
max: number;
lowerCase: number;
upperCase: number;
numeric: number;
symbol: number;
requirementCount: number;
}
}
export = PasswordComplexity;
@@ -0,0 +1,13 @@
import PasswordComplexity = require("joi-password-complexity");
const complexityOptions: PasswordComplexity.ComplexityOptions = {
min: 8,
max: 30,
lowerCase: 1,
upperCase: 1,
numeric: 1,
symbol: 1,
requirementCount: 3
};
const passwordComplexity = new PasswordComplexity(complexityOptions);
@@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictFunctionTypes": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"joi-password-complexity-tests.ts"
]
}
@@ -0,0 +1,3 @@
{
"extends": "dtslint/dt.json"
}