@akveo/nga-theme
Version:
@akveo/nga-theme
90 lines (89 loc) • 2.66 kB
TypeScript
/**
* @license
* Copyright Akveo. All Rights Reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*/
import { InjectionToken } from '@angular/core';
import { Location } from '@angular/common';
import { Router } from '@angular/router';
import { Observable } from 'rxjs/Observable';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
import { List } from 'immutable';
import 'rxjs/add/operator/publish';
export declare abstract class NgaMenuItem {
title: string;
link?: string;
url?: string;
icon?: string;
expanded?: boolean;
children?: List<NgaMenuItem>;
target?: string;
hidden?: boolean;
pathMath?: string;
home?: boolean;
group?: boolean;
parent?: NgaMenuItem;
selected?: boolean;
data?: any;
}
export interface NgaMenuOptions {
items?: List<NgaMenuItem>;
}
export declare const ngaMenuOptionsToken: InjectionToken<NgaMenuOptions>;
export declare class NgaMenuService {
addItems(items: List<NgaMenuItem>, tag?: string): void;
navigateHome(tag?: string): void;
getSelectedItem(tag?: string): Observable<{
tag: string;
item: NgaMenuItem;
}>;
onItemClick(): Observable<{
tag: string;
item: NgaMenuItem;
}>;
onItemSelect(): Observable<{
tag: string;
item: NgaMenuItem;
}>;
onItemHover(): Observable<{
tag: string;
item: NgaMenuItem;
}>;
onSubmenuToggle(): Observable<{
tag: string;
item: NgaMenuItem;
}>;
}
export declare class NgaMenuInternalService {
private router;
private location;
private options;
private stack;
private items;
constructor(router: Router, location: Location, options: any);
getItems(): List<NgaMenuItem>;
prepareItems(items: List<NgaMenuItem>): void;
onAddItem(): Observable<{
tag: string;
items: List<NgaMenuItem>;
}>;
onNavigateHome(): Observable<{
tag: string;
}>;
onGetSelectedItem(): Observable<{
tag: string;
listener: BehaviorSubject<{
tag: string;
item: NgaMenuItem;
}>;
}>;
itemHover(item: NgaMenuItem, tag?: string): void;
submenuToggle(item: NgaMenuItem, tag?: string): void;
resetItems(items: List<NgaMenuItem>): void;
itemSelect(item: NgaMenuItem, tag?: string): void;
itemClick(item: NgaMenuItem, tag?: string): void;
private resetItem(parent);
private setParent(parent);
private prepareItem(parent);
private clearStack();
}