import { IFieldMap , FindAuthenticationStrategyResponse , UserId , } from "@bluelibs/security-bundle" ; export interface IPasswordBundleConfig { failedAuthenticationAttempts ? : { lockAfter ? : number ; cooldown ? : string ; } ; resetPassword ? : { cooldown ? : string ; expiresAfter ? : string ; } ; } export interface IPasswordService { attach ( userId , options ) : Promise < void > ; isPasswordValid ( userId , password , options ? ) : Promise < boolean > ; findUserIdByUsername ( username ) : Promise < any > ; createTokenForPasswordReset ( userId ) : Promise < string > ; isResetPasswordTokenValid ( userId , token ) : Promise < boolean > ; resetPassword ( userId , token , newPassword ) : Promise < void > ; setPassword ( userId , password ) : Promise < void > ; setUsername ( userId , username ) : Promise < void > ; /**
     * Helper method to get data easier
     */ getData ( userId , fields ? ) : Promise < Partial < IPasswordAuthenticationStrategy > > ; /**
     * Helper method to easily update the password data
     */ updateData ( userId , data ) : Promise < void > ; } export interface IHasherService { generateSalt ( userId ? ) : string ; getHashedPassword ( plainPassword , salt ? ) : string ; generateToken ( userId ? ) : string ; } export interface IPasswordAuthenticationStrategyCreationOptions { username : string ; email ? : string ; isEmailVerified ? : boolean ; password : string ; } export interface IPasswordValidationOptions { failedAuthenticationAttemptsProcessing : boolean ; } export interface IPasswordAuthenticationStrategy { username : string ; email ? : string ; isEmailVerified ? : boolean ; emailVerificationToken ? : string ; salt : string ; passwordHash : string ; lastSuccessfulPasswordValidationAt : Date ; resetPasswordVerificationToken : string ; resetPasswordRequestedAt : Date ; currentFailedLoginAttempts : number ; lastFailedLoginAttemptAt : Date ; }