index.d.ts 2.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. import { IonicNativePlugin } from '@ionic-native/core';
  2. /**
  3. * @name Status Bar
  4. * @description
  5. * Manage the appearance of the native status bar.
  6. *
  7. * Requires Cordova plugin: `cordova-plugin-statusbar`. For more info, please see the [StatusBar plugin docs](https://github.com/apache/cordova-plugin-statusbar).
  8. *
  9. * @usage
  10. * ```typescript
  11. * import { StatusBar } from '@ionic-native/status-bar';
  12. *
  13. * constructor(private statusBar: StatusBar) { }
  14. *
  15. * ...
  16. *
  17. * // let status bar overlay webview
  18. * this.statusBar.overlaysWebView(true);
  19. *
  20. * // set status bar to white
  21. * this.statusBar.backgroundColorByHexString('#ffffff');
  22. * ```
  23. *
  24. */
  25. export declare class StatusBar extends IonicNativePlugin {
  26. /**
  27. * Set whether the status bar overlays the main app view. The default
  28. * is true.
  29. *
  30. * @param {boolean} doesOverlay Whether the status bar overlays the main app view.
  31. */
  32. overlaysWebView(doesOverlay: boolean): void;
  33. /**
  34. * Use the default statusbar (dark text, for light backgrounds).
  35. */
  36. styleDefault(): void;
  37. /**
  38. * Use the lightContent statusbar (light text, for dark backgrounds).
  39. */
  40. styleLightContent(): void;
  41. /**
  42. * Use the blackTranslucent statusbar (light text, for dark backgrounds).
  43. */
  44. styleBlackTranslucent(): void;
  45. /**
  46. * Use the blackOpaque statusbar (light text, for dark backgrounds).
  47. */
  48. styleBlackOpaque(): void;
  49. /**
  50. * Set the status bar to a specific named color. Valid options:
  51. * black, darkGray, lightGray, white, gray, red, green, blue, cyan, yellow, magenta, orange, purple, brown.
  52. *
  53. * iOS note: you must call StatusBar.overlaysWebView(false) to enable color changing.
  54. *
  55. * @param {string} colorName The name of the color (from above)
  56. */
  57. backgroundColorByName(colorName: string): void;
  58. /**
  59. * Set the status bar to a specific hex color (CSS shorthand supported!).
  60. *
  61. * iOS note: you must call StatusBar.overlaysWebView(false) to enable color changing.
  62. *
  63. * @param {string} hexString The hex value of the color.
  64. */
  65. backgroundColorByHexString(hexString: string): void;
  66. /**
  67. * Hide the StatusBar
  68. */
  69. hide(): void;
  70. /**
  71. * Show the StatusBar
  72. */
  73. show(): void;
  74. /**
  75. * Whether the StatusBar is currently visible or not.
  76. */
  77. isVisible: boolean;
  78. }