@eresearchqut/angular-password-strength-meter
Version:
[](https://github.com/eresearchqut/angular-password-strength-meter/actions/workflows/ci-workflow.yml) [ • 3.23 kB
TypeScript
import * as i0 from '@angular/core';
import { OnChanges, EventEmitter, SimpleChanges } from '@angular/core';
interface FeedbackResult {
score: number | null;
feedback: Feedback | null;
}
interface Feedback {
warning: string | null;
suggestions: string[];
}
declare abstract class IPasswordStrengthMeterService {
abstract score(password: string): number;
abstract scoreWithFeedback(password: string): FeedbackResult;
abstract scoreAsync(password: string): Promise<number>;
abstract scoreWithFeedbackAsync(password: string): Promise<FeedbackResult>;
}
declare class PasswordStrengthMeterComponent implements OnChanges {
password: string;
minPasswordLength: number;
enableFeedback: boolean;
enableAsync: boolean;
colors: string[];
numberOfProgressBarItems: number;
strengthChange: EventEmitter<number | null>;
baseClass: string;
private passwordStrengthMeterService;
passwordStrength: number | null;
feedback: Feedback | null;
private prevPasswordStrength;
private passwordChangeObservable$;
constructor();
ngOnChanges(changes: SimpleChanges): void;
private init;
private calculateScore;
private calculateScoreAsync;
static ɵfac: i0.ɵɵFactoryDeclaration<PasswordStrengthMeterComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<PasswordStrengthMeterComponent, "password-strength-meter", never, { "password": { "alias": "password"; "required": true; }; "minPasswordLength": { "alias": "minPasswordLength"; "required": false; }; "enableFeedback": { "alias": "enableFeedback"; "required": false; }; "enableAsync": { "alias": "enableAsync"; "required": false; }; "colors": { "alias": "colors"; "required": false; }; "numberOfProgressBarItems": { "alias": "numberOfProgressBarItems"; "required": false; }; }, { "strengthChange": "strengthChange"; }, never, never, true, never>;
static ngAcceptInputType_enableFeedback: unknown;
static ngAcceptInputType_enableAsync: unknown;
}
declare class PSMProgressBarDirective implements OnChanges {
private renderer;
private el;
numberOfProgressBarItems: number;
passwordStrength: number | null;
colors: string[];
minProgressVal: number;
maxProgressVal: number;
currentProgressVal: number;
dataPasswordStrength: number;
progressBar: HTMLDivElement;
private defaultColors;
constructor();
ngOnChanges(changes: SimpleChanges): void;
setProgressBarItems(): void;
setProgressBar(): void;
getFillMeterWidth(strength: number | null | undefined): number;
getMeterFillColor(progressLevel: number): string;
private getRoundedStrength;
static ɵfac: i0.ɵɵFactoryDeclaration<PSMProgressBarDirective, never>;
static ɵdir: i0.ɵɵDirectiveDeclaration<PSMProgressBarDirective, ".psm__progress-bar", never, { "numberOfProgressBarItems": { "alias": "numberOfProgressBarItems"; "required": true; }; "passwordStrength": { "alias": "passwordStrength"; "required": true; }; "colors": { "alias": "colors"; "required": false; }; }, {}, never, never, true, never>;
}
export { IPasswordStrengthMeterService, PSMProgressBarDirective, PasswordStrengthMeterComponent };
export type { Feedback, FeedbackResult };