nowsecure / owasp-password-strength-test

OWASP Password Strength Test for Node.js
MIT License
241 stars 56 forks source link

typescript types #14

Open ehartford opened 7 years ago

ehartford commented 7 years ago

please, need typescript types for this

ehartford commented 7 years ago

something like

declare namespace owaspPasswordStrengthTest {
  interface TestRet {
    errors : string[];
    failedTests : number[];
    passedTests : number[];
    requiredTestErrors : string[];
    optionalTestErrors : string[];
    isPassphrase : boolean;
    strong : boolean;
    optionalTestsPassed : number;
  }

  interface Config {
    allowPassphrases? : boolean;
    maxLength? : number;
    minLength? : number;
    minPhraseLength? : number;
    minOptionalTestsToPass? : number;
  }

  interface OwaspPasswordStrengthTest {
    config : (params : Config) => void;
    test : (password : string) => TestRet;
  }
}

declare const owaspPST : owaspPasswordStrengthTest.OwaspPasswordStrengthTest;
export = owaspPST;