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

/**
 * @fileoverview added by tsickle
 * Generated from: lib/tap-serial-configuration-form/tap-serial-configuration-form.component.ts
 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
var TapSerialConfigurationFormComponent = /** @class */ (function () {
    function TapSerialConfigurationFormComponent(changeDetector, toastController) {
        this.changeDetector = changeDetector;
        this.toastController = toastController;
        this.SERIAL_SETTINGS_FIELDS = SERIAL_SETTINGS_FIELDS;
        this.valueChanges = new EventEmitter();
    }
    Object.defineProperty(TapSerialConfigurationFormComponent.prototype, "values", {
        set: /**
         * @param {?} obs
         * @return {?}
         */
        function (obs) {
            var _this = this;
            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 {?}
             */
            function (newValue) {
                _this.formValues = newValue;
            }));
        },
        enumerable: true,
        configurable: true
    });
    /**
     * @param {?} event
     * @return {?}
     */
    TapSerialConfigurationFormComponent.prototype.onSerialSettingsChanged = /**
     * @param {?} event
     * @return {?}
     */
    function (event) {
        console.log('Selected', event);
        this.valueChanges.emit(event);
    };
    TapSerialConfigurationFormComponent.decorators = [
        { type: Component, args: [{
                    selector: 'tap-serial-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: [""]
                }] }
    ];
    /** @nocollapse */
    TapSerialConfigurationFormComponent.ctorParameters = function () { return [
        { type: ChangeDetectorRef },
        { type: ToastController }
    ]; };
    TapSerialConfigurationFormComponent.propDecorators = {
        valueChanges: [{ type: Output }],
        values: [{ type: Input }]
    };
    return TapSerialConfigurationFormComponent;
}());
if (false) {
    /** @type {?} */
    TapSerialConfigurationFormComponent.prototype.SERIAL_SETTINGS_FIELDS;
    /** @type {?} */
    TapSerialConfigurationFormComponent.prototype.valueChanges;
    /** @type {?} */
    TapSerialConfigurationFormComponent.prototype.form;
    /** @type {?} */
    TapSerialConfigurationFormComponent.prototype.formValues;
    /**
     * @type {?}
     * @private
     */
    TapSerialConfigurationFormComponent.prototype.valueSub;
    /** @type {?} */
    TapSerialConfigurationFormComponent.prototype.changeDetector;
    /** @type {?} */
    TapSerialConfigurationFormComponent.prototype.toastController;
}

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

/**
 * @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-serial.ts
 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */

export { TapSerialConfigurationFormComponent, TapTargetSerialModule };
//# sourceMappingURL=iotize-ionic-target-serial.js.map
