/// <reference types="react" />
import { UkeComponent } from '../utils/uke-component';
export interface CaptchaResData {
    /** 是否发生错误 */
    hasErr: boolean;
    /** 验证码的图片 */
    captchaImage: string;
    /** 验证码的 key */
    captchaKey: string;
}
declare type APIQueryCaptcha = (getDataCallback: (resData: CaptchaResData) => void) => void;
export interface CaptchaOnChangeParams {
    isPass: boolean;
    value: any;
    key: string;
}
export interface CaptchaProps {
    /** 获取错误时的回调 */
    onError?: (e: any) => void;
    /** 值改变时的回调 */
    onChange?: (options: CaptchaOnChangeParams) => void;
    /** 验证码 Mount 的回调 */
    onCaptchaLoad?: (captchaKey: any) => void;
    /** 失去焦点的回调 */
    onBlur?: (blurEvent: any) => void;
    /** 与 react 受控控件行为一致 */
    value?: string | number;
    /** icon */
    icon?: string;
    /** 限制输入长度 */
    limit?: number;
    /** 尝试自动刷新验证码的次数 */
    autoRetryTime?: number;
}
interface State {
    captchaImg: string;
    captchaValue: string | number;
    loading: boolean;
}
/**
 * 验证码，需要先通过 setUkelliConfig 设置获取验证码的方式
 *
 * @export
 * @class Captcha
 * @extends {Component}
 */
export default class Captcha extends UkeComponent<CaptchaProps, State> {
    static defaultProps: {
        limit: number;
        autoRetryTime: number;
        icon: string;
    };
    static setQueryCAPTCHAData: (func: APIQueryCaptcha) => void;
    static setAPI: (func: APIQueryCaptcha) => void;
    captchaInput: any;
    isControl: boolean;
    captchaLength: number;
    isPass: boolean;
    value: any;
    getCaptchaTimer: any;
    captchaKey: string;
    refreshTime: number;
    retryTime: number;
    __didMount: boolean;
    constructor(props: any);
    componentDidMount(): void;
    componentWillUnmount(): void;
    select(): void;
    getCaptcha: () => void;
    clearTimeout(): void;
    shouldRefreshCaptcha(should?: boolean, needFocus?: boolean): void;
    refreshCaptcha(needFocus?: boolean): void;
    changeCaptcha(val: any): void;
    focus(): void;
    render(): JSX.Element;
}
export {};
