stack-utils.d.ts 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. import { ComponentRef } from '@angular/core';
  2. import { ActivatedRoute, NavigationExtras, Router } from '@angular/router';
  3. import type { AnimationBuilder, NavDirection, RouterDirection } from '@ionic/core/components';
  4. export declare const insertView: (views: RouteView[], view: RouteView, direction: RouterDirection) => RouteView[];
  5. export declare const getUrl: (router: Router, activatedRoute: ActivatedRoute) => string;
  6. export declare const isTabSwitch: (enteringView: RouteView, leavingView: RouteView | undefined) => boolean;
  7. export declare const computeStackId: (prefixUrl: string[] | undefined, url: string) => string | undefined;
  8. export declare const toSegments: (path: string) => string[];
  9. export declare const destroyView: (view: RouteView | undefined) => void;
  10. export interface StackWillChangeEvent {
  11. enteringView: RouteView;
  12. /**
  13. * `true` if the event is trigged as a result of a switch
  14. * between tab navigation stacks.
  15. */
  16. tabSwitch: boolean;
  17. }
  18. export interface StackDidChangeEvent {
  19. enteringView: RouteView;
  20. direction: RouterDirection;
  21. animation: NavDirection | undefined;
  22. /**
  23. * `true` if the event is trigged as a result of a switch
  24. * between tab navigation stacks.
  25. */
  26. tabSwitch: boolean;
  27. }
  28. export interface RouteView {
  29. id: number;
  30. url: string;
  31. stackId: string | undefined;
  32. element: HTMLElement;
  33. ref: ComponentRef<any>;
  34. savedData?: any;
  35. savedExtras?: NavigationExtras;
  36. unlistenEvents: () => void;
  37. animationBuilder?: AnimationBuilder;
  38. }