UNPKG

hs-password-validator

Version:
35 lines (34 loc) 1.02 kB
declare type Language = 'en-US' | 'pt-BR'; declare type TagOptions = 'worst' | 'bad' | 'weak' | 'good' | 'strong'; export declare type ErrorsOutput = 'min' | 'max' | 'uppercase' | 'lowercase' | 'symbol' | 'number' | 'space' | 'sequential' | 'strength'; export interface IErrors { validation: ErrorsOutput; arguments?: number; inverted?: boolean; tag?: string; message: string; satisfied: boolean | undefined; } export interface Response { hasInvalidFields: boolean; data: IErrors[]; } interface ConfigLengthProps { minLength?: number; maxLength?: number; } interface ConfigScoreOptions { minAcceptable: TagOptions; } export interface ConfigProps { length?: ConfigLengthProps; scoreConfig?: ConfigScoreOptions; lang?: Language; } interface Props { password: string; options?: ErrorsOutput[]; config?: ConfigProps; } export declare const PasswordValidator: ({ password, options, config, }: Props) => Response; export {};