/**
 * @fileoverview added by tsickle
 * @suppress {checkTypes} checked by tsc
 */
import { Directive, HostListener, Input, ElementRef } from '@angular/core';
import { ImageViewerController } from './image-viewer-controller';
var ImageViewableDirective = /** @class */ (function () {
    function ImageViewableDirective(imageViewerService, elementRef) {
        this.imageViewerService = imageViewerService;
        this.elementRef = elementRef;
    }
    Object.defineProperty(ImageViewableDirective.prototype, "src", {
        get: /**
         * @return {?}
         */
        function () {
            return this._src;
        },
        set: /**
         * @param {?} v
         * @return {?}
         */
        function (v) {
            if (v && typeof v === 'string') {
                this.imageViewerService.removeImage(this._src);
                this._src = v;
                this.imageViewerService.addImage(v, this.elementRef.nativeElement);
            }
        },
        enumerable: true,
        configurable: true
    });
    /**
     * @return {?}
     */
    ImageViewableDirective.prototype.ngOnDestroy = /**
     * @return {?}
     */
    function () {
        this.imageViewerService.removeImage(this.src);
    };
    /**
     * @return {?}
     */
    ImageViewableDirective.prototype.click = /**
     * @return {?}
     */
    function () {
        this.imageViewerService.show(this.src);
    };
    ImageViewableDirective.decorators = [
        { type: Directive, args: [{
                    selector: '[uiImageViewable]'
                },] },
    ];
    /** @nocollapse */
    ImageViewableDirective.ctorParameters = function () { return [
        { type: ImageViewerController, },
        { type: ElementRef, },
    ]; };
    ImageViewableDirective.propDecorators = {
        "src": [{ type: Input },],
        "click": [{ type: HostListener, args: ['click',] },],
    };
    return ImageViewableDirective;
}());
export { ImageViewableDirective };
function ImageViewableDirective_tsickle_Closure_declarations() {
    /** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
    ImageViewableDirective.decorators;
    /**
     * @nocollapse
     * @type {function(): !Array<(null|{type: ?, decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array<?>)}>)})>}
     */
    ImageViewableDirective.ctorParameters;
    /** @type {!Object<string,!Array<{type: !Function, args: (undefined|!Array<?>)}>>} */
    ImageViewableDirective.propDecorators;
    /** @type {?} */
    ImageViewableDirective.prototype._src;
    /** @type {?} */
    ImageViewableDirective.prototype.imageVi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