/**
 * @fileoverview added by tsickle
 * Generated from: common/activity-reporter/spinner-activity-reporter.component.ts
 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
import { __extends } from "tslib";
/*!
 * Copyright 2020 VMware, Inc.
 * SPDX-License-Identifier: BSD-2-Clause
 */
import { Component, Inject } from '@angular/core';
import { ActivityPromiseResolver } from './activity-promise-resolver';
import { ActivityReporter } from './activity-reporter';
/**
 * Spinner activity reporter shows the spinner until an error or success message is returned.
 * An error message is displayed through the error banner.
 */
var SpinnerActivityReporterComponent = /** @class */ (function (_super) {
    __extends(SpinnerActivityReporterComponent, _super);
    function SpinnerActivityReporterComponent(promiseResolver) {
        var _this = _super.call(this, promiseResolver) || this;
        /**
         * When true show the spinner
         */
        _this.running = false;
        /**
         * When set show the error text
         */
        _this.errorText = null;
        return _this;
    }
    /**
     * Begins to show the loading indicator to the user.
     */
    /**
     * Begins to show the loading indicator to the user.
     * @return {?}
     */
    SpinnerActivityReporterComponent.prototype.startActivity = /**
     * Begins to show the loading indicator to the user.
     * @return {?}
     */
    function () {
        this.running = true;
        this.errorText = null;
    };
    /**
     * Hides the loading indicator and shows an error message.
     */
    /**
     * Hides the loading indicator and shows an error message.
     * @param {?} errorText
     * @return {?}
     */
    SpinnerActivityReporterComponent.prototype.reportError = /**
     * Hides the loading indicator and shows an error message.
     * @param {?} errorText
     * @return {?}
     */
    function (errorText) {
        this.errorText = errorText;
        this.running = false;
    };
    /**
     * Hides the loading indicator.
     */
    /**
     * Hides the loading indicator.
     * @return {?}
     */
    SpinnerActivityReporterComponent.prototype.reportSuccess = /**
     * Hides the loading indicator.
     * @return {?}
     */
    function () {
        this.running = false;
    };
    SpinnerActivityReporterComponent.decorators = [
        { type: Component, args: [{
                    selector: 'vcd-spinner-activity-reporter',
                    template: "<vcd-error-banner *ngIf=\"errorText\" [(errorMessage)]=\"errorText\"></vcd-error-banner>\n<vcd-loading-indicator [isLoading]=\"running\"></vcd-loading-indicator>\n"
                }] }
    ];
    /** @nocollapse */
    SpinnerActivityReporterComponent.ctorParameters = function () { return [
        { type: ActivityPromiseResolver, decorators: [{ type: Inject, args: [ActivityPromiseResolver,] }] }
    ]; };
    return SpinnerActivityReporterComponent;
}(ActivityReporter));
export { SpinnerActivityReporterComponent };
if (false) {
    /**
     * When true show the spinner
     * @type {?}
     */
    SpinnerActivityReporterComponent.prototype.running;
    /**
     * When set show the error text
     * @type {?}
     */
    SpinnerActivityReporterComponent.prototype.errorText;
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3Bpbm5lci1hY3Rpdml0eS1yZXBvcnRlci5jb21wb25lbnQuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9AdmNkL3VpLWNvbXBvbmVudHMvIiwic291cmNlcyI6WyJjb21tb24vYWN0aXZpdHktcmVwb3J0ZXIvc3Bpbm5lci1hY3Rpdml0eS1yZXBvcnRlci5jb21wb25lbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7OztBQUtBLE9BQU8sRUFBRSxTQUFTLEVBQUUsTUFBTSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQ2xELE9BQU8sRUFBRSx1QkFBdUIsRUFBRSxNQUFNLDZCQUE2QixDQUFDO0FBQ3RFLE9BQU8sRUFBRSxnQkFBZ0IsRUFBRSxNQUFNLHFCQUFxQixDQUFDOzs7OztBQU12RDtJQUlzRCxvREFBZ0I7SUFXbEUsMENBQTZDLGVBQTZDO1FBQTFGLFlBQ0ksa0JBQU0sZUFBZSxDQUFDLFNBQ3pCOzs7O1FBVE0sYUFBTyxHQUFHLEtBQUssQ0FBQzs7OztRQUtoQixlQUFTLEdBQVcsSUFBSSxDQUFDOztJQUloQyxDQUFDO0lBRUQ7O09BRUc7Ozs7O0lBQ0gsd0RBQWE7Ozs7SUFBYjtRQUNJLElBQUksQ0FBQyxPQUFPLEdBQUcsSUFBSSxDQUF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