/**
 * @fileoverview added by tsickle
 * @suppress {checkTypes,extraRequire,missingReturn,uselessCode} checked by tsc
 */
import * as tslib_1 from "tslib";
/**
 * Common service to be injected between components where those implementing common
 * ToggleView interface can register and toggle directives can call their methods.
 * TODO: Track currently active? Events?
 */
var /**
 * Common service to be injected between components where those implementing common
 * ToggleView interface can register and toggle directives can call their methods.
 * TODO: Track currently active? Events?
 */
IgxNavigationService = /** @class */ (function () {
    function IgxNavigationService() {
        this.navs = {};
    }
    /**
     * @param {?} id
     * @param {?} navItem
     * @return {?}
     */
    IgxNavigationService.prototype.add = /**
     * @param {?} id
     * @param {?} navItem
     * @return {?}
     */
    function (id, navItem) {
        this.navs[id] = navItem;
    };
    /**
     * @param {?} id
     * @return {?}
     */
    IgxNavigationService.prototype.remove = /**
     * @param {?} id
     * @return {?}
     */
    function (id) {
        delete this.navs[id];
    };
    /**
     * @param {?} id
     * @return {?}
     */
    IgxNavigationService.prototype.get = /**
     * @param {?} id
     * @return {?}
     */
    function (id) {
        if (id) {
            return this.navs[id];
        }
    };
    /**
     * @param {?} id
     * @param {...?} args
     * @return {?}
     */
    IgxNavigationService.prototype.toggle = /**
     * @param {?} id
     * @param {...?} args
     * @return {?}
     */
    function (id) {
        var args = [];
        for (var _i = 1; _i < arguments.length; _i++) {
            args[_i - 1] = arguments[_i];
        }
        var _a;
        if (this.navs[id]) {
            return (_a = this.navs[id]).toggle.apply(_a, tslib_1.__spread(args));
        }
    };
    /**
     * @param {?} id
     * @param {...?} args
     * @return {?}
     */
    IgxNavigationService.prototype.open = /**
     * @param {?} id
     * @param {...?} args
     * @return {?}
     */
    function (id) {
        var args = [];
        for (var _i = 1; _i < arguments.length; _i++) {
            args[_i - 1] = arguments[_i];
        }
        var _a;
        if (this.navs[id]) {
            return (_a = this.navs[id]).open.apply(_a, tslib_1.__spread(args));
        }
    };
    /**
     * @param {?} id
     * @param {...?} args
     * @return {?}
     */
    IgxNavigationService.prototype.close = /**
     * @param {?} id
     * @param {...?} args
     * @return {?}
     */
    function (id) {
        var args = [];
        for (var _i = 1; _i < arguments.length; _i++) {
            args[_i - 1] = arguments[_i];
        }
        var _a;
        if (this.navs[id]) {
            return (_a = this.navs[id]).close.apply(_a, tslib_1.__spread(args));
        }
    };
    return IgxNavigationService;
}());
/**
 * Common service to be injected between components where those implementing common
 * ToggleView interface can register and toggle directives can call their methods.
 * TODO: Track currently active? Events?
 */
export { IgxNavigationService };
if (false) {
    /** @type {?} */
    IgxNavigationService.prototype.navs;
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmF2LnNlcnZpY2UuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9pZ25pdGV1aS1hbmd1bGFyLyIsInNvdXJjZXMiOlsibGliL2NvcmUvbmF2aWdhdGlvbi9uYXYuc2VydmljZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7O0FBT0E7Ozs7OztJQUdJO1FBQ0ksSUFBSSxDQUFDLElBQUksR0FBRyxFQUFFLENBQUM7SUFDbkIsQ0FBQzs7Ozs7O0lBRU0sa0NBQUc7Ozs7O0lBQVYsVUFBVyxFQUFVLEVBQUUsT0FBb0I7UUFDdkMsSUFBSSxDQUFDLElBQUksQ0FBQyxFQUFFLENBQUMsR0FBRyxPQUFPLENBQUM7SUFDNUIsQ0FBQzs7Ozs7SUFFTSxxQ0FBTTs7OztJQUFiLFVBQWMsRUFBVTtRQUNwQixPQUFPLElBQUksQ0FBQyxJQUFJLENBQUMsRUFBRSxDQUFDLENBQUM7SUFDekIsQ0FBQzs7Ozs7SUFFTSxrQ0FBRzs7OztJQUFWLFVBQVcsRUFBVTtRQUNqQixJQUFJLEVBQUUsRUFBRTtZQUNKLE9BQU8sSUFBSSxDQUFDLElBQUksQ0FBQyxFQUFFLENBQUMsQ0FBQztTQUN4QjtJQUNMLENBQUM7Ozs7OztJQUVNLHFDQUFNOzs7OztJQUFiLFVBQWMsRUFBVTtRQUFFLGN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gICAgICBpZiAodGhpcy5uYXZzW2lkXSkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMubmF2c1tpZF0ub3BlbiguLi5hcmdzKTtcbiAgICAgICAgfVxuICAgIH1cbiAgICBwdWJsaWMgY2xvc2UoaWQ6IHN0cmluZywgLi4uYXJncykge1xuICAgICAgICBpZiAodGhpcy5uYXZzW2lkXSkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMubmF2c1tpZF0uY2xvc2UoLi4uYXJncyk7XG4gICAgICAgIH1cbiAgICB9XG59XG4iXX0=