UNPKG

@ctodev/cclibrary-typings

Version:

Library typings for use with CLARC INFINITY

95 lines (94 loc) 3.74 kB
import { OnDestroy } from '@angular/core'; import { Router } from '@angular/router'; import { Observable } from 'rxjs'; import { TccKeyValuePair } from '../../../odata/models/shared.model'; import { TopNavCrumbNode, TopNavLeaf, TopNavNode, TopNavSelectOption } from '../../components/tcc-top-navbar/tcc-top-navbar.component'; import { TccSingleton } from '../../models/tcc-singleton.model'; import { TccManageSingletonsService } from '../tcc-manage-singletons/tcc-manage-singletons.service'; export interface TopNavigation { node: TopNavCrumbNode; leaf?: TopNavLeaf; } export interface FlattenedNavigation { node: FlattenedTopNavNode; leaf?: TopNavLeaf; } export interface FlattenedTopNavNode extends TopNavNode { parents: Array<string>; } export declare class TccTopNavService implements TccSingleton, OnDestroy { private router; private routerSubscription; flattenedNodes: Array<FlattenedTopNavNode>; allNodes: { [nodeidentifier: string]: FlattenedTopNavNode; }; private basehref; private lasturl; private tempContextText; private tempContextData; private pastNavigations; lastNavigation: FlattenedNavigation; private _next; private _onNavigate; private _onCrumbClickSubject; private canNavigate; private settoactiveleaf; set topNavElements(elements: Array<TopNavNode>); constructor(router: Router, manageSingletons: TccManageSingletonsService); init(): void; reset(): void; _init(basehref: string): void; ngOnDestroy(): void; set contextData(data: any); get contextData(): any; set contextText(text: string); getContextData(nodeName: string): any; private resetContext; get OnTopNavigation(): Observable<TopNavigation>; get OnNavigationChange(): Observable<TopNavigation>; get onCrumbClick(): Observable<TopNavCrumbNode>; get Next(): Observable<{ breadcrumbs: Array<TopNavCrumbNode>; activeLeaf: string; activeNode: TopNavCrumbNode; }>; private set _Next(value); private set OnNavigate(value); setCanNavigateFunction(func: () => Observable<boolean>, leafs?: string[]): void; deleteCanNavigateFunction(): void; NavigatePath(path: string, contextText?: string, contextData?: any): void; Navigate(nodename: string, leafname: string, contextText?: string, contextData?: any): void; NavigateBack(): void; _onLeafSelect(leaf: TopNavLeaf, selectedPair: TccKeyValuePair): void; _onLeafClick(leaf: TopNavLeaf): void; private handleLeafClick; private handleLeafClickCallback; _onCrumbClick(crumb: TopNavCrumbNode): void; private getNodeByPath; private getNodeByUniqueIdentifier; private onCrumbClickClearContext; _onContextCrumbClick(crumb: TopNavCrumbNode): void; OnNavigation(url: string): void; private compareFirst; private findNavigation; private returnLeafByUniqueIdentifier; private returnFirstLeaf; private pathIsEmpty; private pathisinpath; private find; buildLeafSelect(group: string, leaf: string, options: Array<TopNavSelectOption>): void; deleteFromCurrentLeafSelect(leaf: string, select: string, byName: boolean): void; private findCurrentLeaf; addToCurrentLeafSelect(leaf: string, select: TopNavSelectOption): void; hideLeaf(group: string, leaf: string): void; showLeaf(group: string, leaf: string): void; updateLeafSelectOption(group: string, leaf: string, selectValue: any, additional: string): void; getSelectedLeafValue(leaf: TopNavLeaf | string): any; private flattenNodes; private flattenNode; private nodeToCrumb; private getBreadCrumbs; private generateBreadCrumbs; private clearContextNodes; }