import React from "react"; import { ChangeContext } from "../form/controlled"; import { InputProps } from "./Input"; import { BubbleProps } from "../bubble"; export interface InputPasswordRule { /** * 规则描述 */ text: string; /** * 规则校验器 */ validator: (inputValue: string, subRuleResults: boolean[]) => boolean; /** * 子规则 */ subRules?: { /** * 规则描述 */ text: InputPasswordRule["text"]; /** * 规则校验器 */ validator: (inputValue: string) => boolean; }[]; } export interface InputPasswordChangeContext extends ChangeContext { /** * 是否符合校验规则 */ valid: boolean; } export interface InputPasswordProps extends Omit { /** * 密码校验规则 * * **建议统一使用组件默认规则** * * @default 见示例 */ rules?: InputPasswordRule[] | false; /** * 规则气泡放置的位置 * @default "right-start" */ bubblePlacement?: BubbleProps["placement"]; /** * 值发生变更时进行回调 */ onChange?: (value: string, context: InputPasswordChangeContext) => void; } export declare const InputPassword: React.FunctionComponent> & { defaultLabelAlign: string; };