UNPKG

rgex

Version:

A powerful, chainable regex builder platform with comprehensive validation utilities

53 lines 2.54 kB
/** * RGex Password Validation Utilities * Advanced password strength analysis and validation */ import type { PasswordValidationOptions, PasswordValidationResult } from '../../types/index.js'; /** * Validates a password against a comprehensive set of rules and provides a detailed analysis. * * @param password The password string to validate. * @param options A `PasswordValidationOptions` object to customize the validation rules. * @returns A `PasswordValidationResult` object containing the validation details. */ export declare function validatePassword(password: string, options?: PasswordValidationOptions): PasswordValidationResult; /** * Detects if a string contains sequential characters (e.g., "abc" or "123"). * * @param password The string to check. * @param minLength The minimum length of a sequence to be considered sequential. Defaults to 3. * @returns `true` if sequential characters are found, otherwise `false`. */ export declare function hasSequentialChars(password: string, minLength?: number): boolean; /** * Detects if a string contains repeating characters (e.g., "aaa" or "111"). * * @param password The string to check. * @param minLength The minimum number of repeating characters to be considered a repetition. Defaults to 3. * @returns `true` if repeating characters are found, otherwise `false`. */ export declare function hasRepeatingChars(password: string, minLength?: number): boolean; /** * Checks if a password is found in the list of common passwords. * * @param password The password to check. * @returns `true` if the password is in the common list, otherwise `false`. */ export declare function hasCommonWords(password: string): boolean; /** * Provides suggestions for improving a password based on failed validation checks. * * @param password The password that was tested. * @param options The validation options that were used. * @returns An array of string suggestions to improve the password. */ export declare function getPasswordSuggestions(password: string, options?: PasswordValidationOptions): string[]; /** * Generates a strong, random password that adheres to specified criteria. * * @param length The desired length of the password. Defaults to 12. * @param options Options to customize the character sets to include in the generated password. * @returns A securely generated password string. */ export declare function generateStrongPassword(length?: number, options?: Partial<PasswordValidationOptions>): string; //# sourceMappingURL=password.d.ts.map