/**
 * @fileoverview added by tsickle
 * @suppress {checkTypes} checked by tsc
 */
import * as tslib_1 from "tslib";
/**
 * Common service to be injected between components.
 * Those components, implementing common `ToggleView` interface, can register and toggle directives can call their methods.
 */
var /**
 * Common service to be injected between components.
 * Those components, implementing common `ToggleView` interface, can register and toggle directives can call their methods.
 */
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];
        }
        if (this.navs[id]) {
            return (_a = this.navs[id]).toggle.apply(_a, tslib_1.__spread(args));
        }
        var _a;
    };
    /**
     * @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];
        }
        if (this.navs[id]) {
            return (_a = this.navs[id]).open.apply(_a, tslib_1.__spread(args));
        }
        var _a;
    };
    /**
     * @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];
        }
        if (this.navs[id]) {
            return (_a = this.navs[id]).close.apply(_a, tslib_1.__spread(args));
        }
        var _a;
    };
    return IgxNavigationService;
}());
/**
 * Common service to be injected between components.
 * Those components, implementing common `ToggleView` interface, can register and toggle directives can call their methods.
 */
export { IgxNavigationService };
function IgxNavigationService_tsickle_Closure_declarations() {
    /** @type {?} */
    IgxNavigationService.prototype.navs;
}

//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmF2LnNlcnZpY2UuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9pZ25pdGV1aS1hbmd1bGFyLyIsInNvdXJjZXMiOlsibGliL2NvcmUvbmF2aWdhdGlvbi9uYXYuc2VydmljZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7QUFNQTs7OztBQUFBO0lBR0k7UUFDSSxJQUFJLENBQUMsSUFBSSxHQUFHLEVBQUUsQ0FBQztLQUNsQjs7Ozs7O0lBRU0sa0NBQUc7Ozs7O2NBQUMsRUFBVSxFQUFFLE9BQW9CO1FBQ3ZDLElBQUksQ0FBQyxJQUFJLENBQUMsRUFBRSxDQUFDLEdBQUcsT0FBTyxDQUFDOzs7Ozs7SUFHckIscUNBQU07Ozs7Y0FBQyxFQUFVO1FBQ3BCLE9BQU8sSUFBSSxDQUFDLElBQUksQ0FBQyxFQUFFLENBQUMsQ0FBQzs7Ozs7O0lBR2xCLGtDQUFHOzs7O2NBQUMsRUFBVTtRQUNqQixFQUFFLENBQUMsQ0FBQyxFQUFFLENBQUMsQ0FBQyxDQUFDO1lBQ0wsTUFBTSxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsRUFBRSxDQUFDLENBQUM7U0FDeEI7Ozs7Ozs7SUFHRSxxQ0FBTTs7Ozs7Y0FBQyxFQUFVO1FBQUUsY0FBTzthQUFQLFVBQU8sRUFBUCxxQkFBTyxFQUFQLElBQU87WUFBUCw2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