tabs.d.ts 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. import { AfterContentChecked, AfterContentInit, ElementRef, EventEmitter, AfterViewInit, QueryList } from '@angular/core';
  2. import { NavController } from '../../providers/nav-controller';
  3. import { StackDidChangeEvent, StackWillChangeEvent } from './stack-utils';
  4. import * as i0 from "@angular/core";
  5. export declare abstract class IonTabs implements AfterViewInit, AfterContentInit, AfterContentChecked {
  6. private navCtrl;
  7. /**
  8. * Note: These must be redeclared on each child class since it needs
  9. * access to generated components such as IonRouterOutlet and IonTabBar.
  10. */
  11. abstract outlet: any;
  12. abstract tabBar: any;
  13. abstract tabBars: QueryList<any>;
  14. abstract tabs: QueryList<any>;
  15. tabsInner: ElementRef<HTMLDivElement>;
  16. /**
  17. * Emitted before the tab view is changed.
  18. */
  19. ionTabsWillChange: EventEmitter<{
  20. tab: string;
  21. }>;
  22. /**
  23. * Emitted after the tab view is changed.
  24. */
  25. ionTabsDidChange: EventEmitter<{
  26. tab: string;
  27. }>;
  28. private tabBarSlot;
  29. private hasTab;
  30. private selectedTab?;
  31. private leavingTab?;
  32. constructor(navCtrl: NavController);
  33. ngAfterViewInit(): void;
  34. ngAfterContentInit(): void;
  35. ngAfterContentChecked(): void;
  36. /**
  37. * @internal
  38. */
  39. onStackWillChange({ enteringView, tabSwitch }: StackWillChangeEvent): void;
  40. /**
  41. * @internal
  42. */
  43. onStackDidChange({ enteringView, tabSwitch }: StackDidChangeEvent): void;
  44. /**
  45. * When a tab button is clicked, there are several scenarios:
  46. * 1. If the selected tab is currently active (the tab button has been clicked
  47. * again), then it should go to the root view for that tab.
  48. *
  49. * a. Get the saved root view from the router outlet. If the saved root view
  50. * matches the tabRootUrl, set the route view to this view including the
  51. * navigation extras.
  52. * b. If the saved root view from the router outlet does
  53. * not match, navigate to the tabRootUrl. No navigation extras are
  54. * included.
  55. *
  56. * 2. If the current tab tab is not currently selected, get the last route
  57. * view from the router outlet.
  58. *
  59. * a. If the last route view exists, navigate to that view including any
  60. * navigation extras
  61. * b. If the last route view doesn't exist, then navigate
  62. * to the default tabRootUrl
  63. */
  64. select(tabOrEvent: string | CustomEvent): Promise<boolean> | undefined;
  65. private setActiveTab;
  66. private tabSwitch;
  67. getSelected(): string | undefined;
  68. /**
  69. * Detects changes to the slot attribute of the tab bar.
  70. *
  71. * If the slot attribute has changed, then the tab bar
  72. * should be relocated to the new slot position.
  73. */
  74. private detectSlotChanges;
  75. /**
  76. * Relocates the tab bar to the new slot position.
  77. */
  78. private relocateTabBar;
  79. static ɵfac: i0.ɵɵFactoryDeclaration<IonTabs, never>;
  80. static ɵdir: i0.ɵɵDirectiveDeclaration<IonTabs, "ion-tabs", never, {}, { "ionTabsWillChange": "ionTabsWillChange"; "ionTabsDidChange": "ionTabsDidChange"; }, never, never, false, never>;
  81. }