/// <reference types="preact/compat" />

import { FieldOption } from 'alifd-field';
import innerField from 'alifd-field';

export * from 'alifd-field';
export default class Field extends innerField{
    /**
     *
     * @param contextComp 传入调用class的this
     * @param options 一些事件配置
     */
    constructor(contextComp: any, options?: FieldOption);

    /**
     * 校验
     * @param callback
     */
    validate(callback?: (errors: object[], values: object) => void): void;

    /**
     * 校验
     * @param names
     * @param callback
     */
    validate(
        names?: string[] | string,
        callback?: (errors: object[], values: object) => void
    ): void;

    /**
     * preact/compat hooks 风格使用 Field
     * @param options
     */
    static useField(options?: FieldOption): Field;
}
