UI for Zipcoin Blue

deep-linker.d.ts 3.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. import { ComponentFactory, ComponentFactoryResolver } from '@angular/core';
  2. import { Location } from '@angular/common';
  3. import { App } from '../components/app/app';
  4. import { NavLink, NavSegment, TransitionDoneFn } from './nav-util';
  5. import { ModuleLoader } from '../util/module-loader';
  6. import { Tab } from './nav-interfaces';
  7. import { NavigationContainer } from './navigation-container';
  8. import { NavController } from './nav-controller';
  9. import { UrlSerializer } from './url-serializer';
  10. import { ViewController } from './view-controller';
  11. /**
  12. * @hidden
  13. */
  14. export 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. }
  100. export declare function setupDeepLinker(app: App, serializer: UrlSerializer, location: Location, moduleLoader: ModuleLoader, cfr: ComponentFactoryResolver): DeepLinker;
  101. export declare function normalizeUrl(browserUrl: string): string;
  102. export declare function getNavFromTree(nav: NavigationContainer, id: string): NavigationContainer;