UNPKG

3.77 kBTypeScriptView Raw
1import { ComponentFactory, ComponentFactoryResolver } from '@angular/core';
2import { Location } from '@angular/common';
3import { App } from '../components/app/app';
4import { NavLink, NavSegment, TransitionDoneFn } from './nav-util';
5import { ModuleLoader } from '../util/module-loader';
6import { Tab } from './nav-interfaces';
7import { NavigationContainer } from './navigation-container';
8import { NavController } from './nav-controller';
9import { UrlSerializer } from './url-serializer';
10import { ViewController } from './view-controller';
11/**
12 * @hidden
13 */
14export declare class DeepLinker {
15 _app: App;
16 _serializer: UrlSerializer;
17 _location: Location;
18 _moduleLoader: ModuleLoader;
19 _baseCfr: ComponentFactoryResolver;
20 /** @internal */
21 _history: string[];
22 /** @internal */
23 _indexAliasUrl: string;
24 constructor(_app: App, _serializer: UrlSerializer, _location: Location, _moduleLoader: ModuleLoader, _baseCfr: ComponentFactoryResolver);
25 /**
26 * @internal
27 */
28 init(): void;
29 /**
30 * The browser's location has been updated somehow.
31 * @internal
32 */
33 _urlChange(browserUrl: string): void;
34 getCurrentSegments(browserUrl?: string): NavSegment[];
35 /**
36 * Update the deep linker using the NavController's current active view.
37 * @internal
38 */
39 navChange(direction: string): void;
40 getSegmentsFromNav(nav: NavigationContainer): NavSegment[];
41 getSegmentFromNav(nav: NavController, component?: any, data?: any): NavSegment;
42 getSegmentFromTab(navContainer: NavigationContainer, component?: any, data?: any): NavSegment;
43 /**
44 * @internal
45 */
46 _updateLocation(browserUrl: string, direction: string): void;
47 getComponentFromName(componentName: string): Promise<any>;
48 getNavLinkComponent(link: NavLink): Promise<any>;
49 /**
50 * @internal
51 */
52 resolveComponent(component: any): ComponentFactory<any>;
53 /**
54 * @internal
55 */
56 createUrl(navContainer: NavigationContainer, nameOrComponent: any, _data: any, prepareExternalUrl?: boolean): string;
57 /**
58 * Each NavController will call this method when it initializes for
59 * the first time. This allows each NavController to figure out
60 * where it lives in the path and load up the correct component.
61 * @internal
62 */
63 getSegmentByNavIdOrName(navId: string, name: string): NavSegment;
64 /**
65 * @internal
66 */
67 initViews(segment: NavSegment): Promise<ViewController[]>;
68 /**
69 * @internal
70 */
71 _isBackUrl(browserUrl: string): boolean;
72 /**
73 * @internal
74 */
75 _isCurrentUrl(browserUrl: string): boolean;
76 /**
77 * @internal
78 */
79 _historyPush(browserUrl: string): void;
80 /**
81 * @internal
82 */
83 _historyPop(): void;
84 /**
85 * @internal
86 */
87 _getTabSelector(tab: Tab): string;
88 /**
89 * Using the known Path of Segments, walk down all descendents
90 * from the root NavController and load each NavController according
91 * to each Segment. This is usually called after a browser URL and
92 * Path changes and needs to update all NavControllers to match
93 * the new browser URL. Because the URL is already known, it will
94 * not update the browser's URL when transitions have completed.
95 *
96 * @internal
97 */
98 _loadViewForSegment(navContainer: NavigationContainer, segment: NavSegment, done: TransitionDoneFn): void | Promise<any>;
99}
100export declare function setupDeepLinker(app: App, serializer: UrlSerializer, location: Location, moduleLoader: ModuleLoader, cfr: ComponentFactoryResolver): DeepLinker;
101export declare function normalizeUrl(browserUrl: string): string;
102export declare function getNavFromTree(nav: NavigationContainer, id: string): NavigationContainer;