import { EventEmitter, Component, ChangeDetectorRef, Output, Input, NgModule } from '@angular/core';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { AlertController, LoadingController, IonicModule } from '@ionic/angular';
import { MODBUS_SETTINGS_FIELDS, TapProtocolConfigurationModule } from '@iotize/ionic/target/common';

/**
 * @fileoverview added by tsickle
 * Generated from: lib/tap-modbus-configuration-form/tap-modbus-configuration-form.component.ts
 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
class TapModbusConfigurationFormComponent {
    /**
     * @param {?} alertCtrl
     * @param {?} loadingCtrl
     * @param {?} changeDetector
     */
    constructor(alertCtrl, loadingCtrl, changeDetector) {
        this.alertCtrl = alertCtrl;
        this.loadingCtrl = loadingCtrl;
        this.changeDetector = changeDetector;
        this.SERIAL_SETTINGS_FIELDS = MODBUS_SETTINGS_FIELDS;
        this.valueChanges = new EventEmitter();
    }
    /**
     * @param {?} obs
     * @return {?}
     */
    set values(obs) {
        var _a;
        (_a = this.valueSub) === null || _a === void 0 ? void 0 : _a.unsubscribe();
        this.valueSub = obs === null || obs === void 0 ? void 0 : obs.subscribe((/**
         * @param {?} newValue
         * @return {?}
         */
        newValue => {
            this.formValues = newValue;
        }));
    }
    /**
     * @param {?} event
     * @return {?}
     */
    onSerialSettingsChanged(event) {
        console.log('Onsettings changed', event);
        this.valueChanges.emit(event);
    }
}
TapModbusConfigurationFormComponent.decorators = [
    { type: Component, args: [{
                selector: 'tap-modbus-configuration-form',
                template: "<tap-protocol-configuration-form\r\n  [values]=\"formValues\"\r\n  (valueChanges)=\"onSerialSettingsChanged($event)\"\r\n  [fields]=\"SERIAL_SETTINGS_FIELDS\">\r\n</tap-protocol-configuration-form>",
                styles: ["ion-input{text-align:right}"]
            }] }
];
/** @nocollapse */
TapModbusConfigurationFormComponent.ctorParameters = () => [
    { type: AlertController },
    { type: LoadingController },
    { type: ChangeDetectorRef }
];
TapModbusConfigurationFormComponent.propDecorators = {
    valueChanges: [{ type: Output }],
    values: [{ type: Input }]
};
if (false) {
    /** @type {?} */
    TapModbusConfigurationFormComponent.prototype.SERIAL_SETTINGS_FIELDS;
    /** @type {?} */
    TapModbusConfigurationFormComponent.prototype.valueChanges;
    /** @type {?} */
    TapModbusConfigurationFormComponent.prototype.formValues;
    /**
     * @type {?}
     * @private
     */
    TapModbusConfigurationFormComponent.prototype.valueSub;
    /** @type {?} */
    TapModbusConfigurationFormComponent.prototype.form;
    /** @type {?} */
    TapModbusConfigurationFormComponent.prototype.alertCtrl;
    /** @type {?} */
    TapModbusConfigurationFormComponent.prototype.loadingCtrl;
    /** @type {?} */
    TapModbusConfigurationFormComponent.prototype.changeDetector;
}

/**
 * @fileoverview added by tsickle
 * Generated from: lib/tap-target-modbus.module.ts
 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
class TapTargetModbusModule {
}
TapTargetModbusModule.decorators = [
    { type: NgModule, args: [{
                declarations: [
                    TapModbusConfigurationFormComponent
                ],
                exports: [
                    TapModbusConfigurationFormComponent
                ],
                imports: [
                    IonicModule,
                    FormsModule,
                    ReactiveFormsModule,
                    TapProtocolConfigurationModule
                ]
            },] }
];

/**
 * @fileoverview added by tsickle
 * Generated from: public_api.ts
 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */

/**
 * @fileoverview added by tsickle
 * Generated from: iotize-ionic-target-modbus.ts
 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */

export { TapModbusConfigurationFormComponent, TapTargetModbusModule };
//# sourceMappingURL=iotize-ionic-target-modbus.js.map
