/* eslint-disable no-unused-expressions */
/* eslint-disable @typescript-eslint/no-empty-function */
/* eslint-disable @typescript-eslint/no-unused-vars */
import { IReactComponentProps, IReactComponentState, IRuleTrigger } from '@wowpic/xform-types';
import React from 'react';

export default class Component extends React.Component<IReactComponentProps, IReactComponentState> {
    public validate?(_trigger?: IRuleTrigger, _value?: any): any;

    public reset?(): void;

    constructor(props: IReactComponentProps) {
        super(props);

        const field = props.field;

        if (this.validate) {
            field.onValidate(this.validate);
        }
        field.on('RESET', () => {
            this.reset && this.reset();
        });
    }
}
