Front end of the Slack clone application.

view-controller.d.ts 8.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  1. import { ComponentRef, ElementRef, EventEmitter, Renderer } from '@angular/core';
  2. import { NavController } from './nav-controller';
  3. import { NavOptions } from './nav-util';
  4. import { NavParams } from './nav-params';
  5. import { Content, Footer, Header, Navbar } from './nav-interfaces';
  6. /**
  7. * @name ViewController
  8. * @description
  9. * Access various features and information about the current view.
  10. * @usage
  11. * ```ts
  12. * import { Component } from '@angular/core';
  13. * import { ViewController } from 'ionic-angular';
  14. *
  15. * @Component({...})
  16. * export class MyPage{
  17. *
  18. * constructor(public viewCtrl: ViewController) {}
  19. *
  20. * }
  21. * ```
  22. */
  23. export declare class ViewController {
  24. component: any;
  25. private _cntDir;
  26. private _cntRef;
  27. private _ionCntDir;
  28. private _ionCntRef;
  29. private _hdrDir;
  30. private _ftrDir;
  31. private _isHidden;
  32. private _leavingOpts;
  33. private _nb;
  34. private _onDidDismiss;
  35. private _onWillDismiss;
  36. private _dismissData;
  37. private _dismissRole;
  38. private _detached;
  39. _cmp: ComponentRef<any>;
  40. _nav: NavController;
  41. _zIndex: number;
  42. _state: number;
  43. _cssClass: string;
  44. _ts: number;
  45. /**
  46. * Observable to be subscribed to when the current component will become active
  47. * @returns {Observable} Returns an observable
  48. */
  49. willEnter: EventEmitter<any>;
  50. /**
  51. * Observable to be subscribed to when the current component has become active
  52. * @returns {Observable} Returns an observable
  53. */
  54. didEnter: EventEmitter<any>;
  55. /**
  56. * Observable to be subscribed to when the current component will no longer be active
  57. * @returns {Observable} Returns an observable
  58. */
  59. willLeave: EventEmitter<any>;
  60. /**
  61. * Observable to be subscribed to when the current component is no long active
  62. * @returns {Observable} Returns an observable
  63. */
  64. didLeave: EventEmitter<any>;
  65. /**
  66. * Observable to be subscribed to when the current component has been destroyed
  67. * @returns {Observable} Returns an observable
  68. */
  69. willUnload: EventEmitter<any>;
  70. /**
  71. * @hidden
  72. */
  73. readReady: EventEmitter<any>;
  74. /**
  75. * @hidden
  76. */
  77. writeReady: EventEmitter<any>;
  78. /** @hidden */
  79. data: any;
  80. /** @hidden */
  81. instance: any;
  82. /** @hidden */
  83. id: string;
  84. /** @hidden */
  85. isOverlay: boolean;
  86. /** @hidden */
  87. private _emitter;
  88. constructor(component?: any, data?: any, rootCssClass?: string);
  89. handleOrientationChange(): void;
  90. /**
  91. * @hidden
  92. */
  93. init(componentRef: ComponentRef<any>): void;
  94. _setNav(navCtrl: NavController): void;
  95. _setInstance(instance: any): void;
  96. /**
  97. * @hidden
  98. */
  99. subscribe(generatorOrNext?: any): any;
  100. /**
  101. * @hidden
  102. */
  103. emit(data?: any): void;
  104. /**
  105. * Called when the current viewController has be successfully dismissed
  106. */
  107. onDidDismiss(callback: (data: any, role: string) => void): void;
  108. /**
  109. * Called when the current viewController will be dismissed
  110. */
  111. onWillDismiss(callback: (data: any, role: string) => void): void;
  112. /**
  113. * Dismiss the current viewController
  114. * @param {any} [data] Data that you want to return when the viewController is dismissed.
  115. * @param {any} [role ]
  116. * @param {NavOptions} navOptions Options for the dismiss navigation.
  117. * @returns {any} data Returns the data passed in, if any.
  118. */
  119. dismiss(data?: any, role?: string, navOptions?: NavOptions): Promise<any>;
  120. /**
  121. * @hidden
  122. */
  123. getNav(): NavController;
  124. /**
  125. * @hidden
  126. */
  127. getTransitionName(_direction: string): string;
  128. /**
  129. * @hidden
  130. */
  131. getNavParams(): NavParams;
  132. /**
  133. * @hidden
  134. */
  135. setLeavingOpts(opts: NavOptions): void;
  136. /**
  137. * Check to see if you can go back in the navigation stack.
  138. * @returns {boolean} Returns if it's possible to go back from this Page.
  139. */
  140. enableBack(): boolean;
  141. /**
  142. * @hidden
  143. */
  144. readonly name: string;
  145. /**
  146. * Get the index of the current component in the current navigation stack.
  147. * @returns {number} Returns the index of this page within its `NavController`.
  148. */
  149. readonly index: number;
  150. /**
  151. * @returns {boolean} Returns if this Page is the first in the stack of pages within its NavController.
  152. */
  153. isFirst(): boolean;
  154. /**
  155. * @returns {boolean} Returns if this Page is the last in the stack of pages within its NavController.
  156. */
  157. isLast(): boolean;
  158. /**
  159. * @hidden
  160. * DOM WRITE
  161. */
  162. _domShow(shouldShow: boolean, renderer: Renderer): void;
  163. /**
  164. * @hidden
  165. */
  166. getZIndex(): number;
  167. /**
  168. * @hidden
  169. * DOM WRITE
  170. */
  171. _setZIndex(zIndex: number, renderer: Renderer): void;
  172. /**
  173. * @returns {ElementRef} Returns the Page's ElementRef.
  174. */
  175. pageRef(): ElementRef;
  176. _setContent(directive: any): void;
  177. /**
  178. * @returns {component} Returns the Page's Content component reference.
  179. */
  180. getContent(): any;
  181. _setContentRef(elementRef: ElementRef): void;
  182. /**
  183. * @returns {ElementRef} Returns the Content's ElementRef.
  184. */
  185. contentRef(): ElementRef;
  186. _setIONContent(content: Content): void;
  187. /**
  188. * @hidden
  189. */
  190. getIONContent(): Content;
  191. _setIONContentRef(elementRef: ElementRef): void;
  192. /**
  193. * @hidden
  194. */
  195. getIONContentRef(): ElementRef;
  196. _setHeader(directive: Header): void;
  197. /**
  198. * @hidden
  199. */
  200. getHeader(): Header;
  201. _setFooter(directive: Footer): void;
  202. /**
  203. * @hidden
  204. */
  205. getFooter(): Footer;
  206. _setNavbar(directive: Navbar): void;
  207. /**
  208. * @hidden
  209. */
  210. getNavbar(): Navbar;
  211. /**
  212. * Find out if the current component has a NavBar or not. Be sure
  213. * to wrap this in an `ionViewWillEnter` method in order to make sure
  214. * the view has rendered fully.
  215. * @returns {boolean} Returns a boolean if this Page has a navbar or not.
  216. */
  217. hasNavbar(): boolean;
  218. /**
  219. * Change the title of the back-button. Be sure to call this
  220. * after `ionViewWillEnter` to make sure the DOM has been rendered.
  221. * @param {string} val Set the back button text.
  222. */
  223. setBackButtonText(val: string): void;
  224. /**
  225. * Set if the back button for the current view is visible or not. Be sure to call this
  226. * after `ionViewWillEnter` to make sure the DOM has been rendered.
  227. * @param {boolean} Set if this Page's back button should show or not.
  228. */
  229. showBackButton(shouldShow: boolean): void;
  230. _preLoad(): void;
  231. /**
  232. * @hidden
  233. * The view has loaded. This event only happens once per view will be created.
  234. * This event is fired before the component and his children have been initialized.
  235. */
  236. _willLoad(): void;
  237. /**
  238. * @hidden
  239. * The view has loaded. This event only happens once per view being
  240. * created. If a view leaves but is cached, then this will not
  241. * fire again on a subsequent viewing. This method is a good place
  242. * to put your setup code for the view; however, it is not the
  243. * recommended method to use when a view becomes active.
  244. */
  245. _didLoad(): void;
  246. /**
  247. * @hidden
  248. * The view is about to enter and become the active view.
  249. */
  250. _willEnter(): void;
  251. /**
  252. * @hidden
  253. * The view has fully entered and is now the active view. This
  254. * will fire, whether it was the first load or loaded from the cache.
  255. */
  256. _didEnter(): void;
  257. /**
  258. * @hidden
  259. * The view is about to leave and no longer be the active view.
  260. */
  261. _willLeave(willUnload: boolean): void;
  262. /**
  263. * @hidden
  264. * The view has finished leaving and is no longer the active view. This
  265. * will fire, whether it is cached or unloaded.
  266. */
  267. _didLeave(): void;
  268. /**
  269. * @hidden
  270. */
  271. _willUnload(): void;
  272. /**
  273. * @hidden
  274. * DOM WRITE
  275. */
  276. _destroy(renderer: Renderer): void;
  277. /**
  278. * @hidden
  279. */
  280. _lifecycleTest(lifecycle: string): Promise<boolean>;
  281. /**
  282. * @hidden
  283. */
  284. _lifecycle(lifecycle: string): void;
  285. }
  286. export declare function isViewController(viewCtrl: any): boolean;