password-validator-lib
Version:
A reusable password validator component for React
24 lines (23 loc) • 645 B
TypeScript
import { default as React } from 'react';
export type RequirementType = "specialChar" | "digit" | "uppercase" | "noConsecutive";
interface CustomRule {
message: string;
validate: (password: string) => boolean;
}
interface CustomStyles {
container?: string;
input?: string;
label?: string;
button?: string;
list?: string;
listItem?: string;
}
interface Props {
options: RequirementType[];
customRules?: CustomRule[];
onValidChange?: (password: string, isValid: boolean) => void;
customStyles?: CustomStyles;
label?: string;
}
export declare const PasswordValidator: React.FC<Props>;
export {};