cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject [2/8] cordova-plugin-statusbar git commit: CB-12369: Add plugin typings from DefinitelyTyped
Date Fri, 03 Mar 2017 00:48:43 GMT
CB-12369: Add plugin typings from DefinitelyTyped

 This closes #75


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-statusbar/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-statusbar/commit/dfe54817
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-statusbar/tree/dfe54817
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-statusbar/diff/dfe54817

Branch: refs/heads/2.2.x
Commit: dfe548170f0db14477cbd539653482a632d85123
Parents: 1040688
Author: Nikita Matrosov <v-nimatr@microsoft.com>
Authored: Thu Jan 19 16:11:46 2017 +0300
Committer: Steve Gill <stevengill97@gmail.com>
Committed: Thu Mar 2 16:48:19 2017 -0800

----------------------------------------------------------------------
 package.json     |  1 +
 types/index.d.ts | 77 +++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 78 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-statusbar/blob/dfe54817/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index d31c942..a2321a0 100644
--- a/package.json
+++ b/package.json
@@ -2,6 +2,7 @@
   "name": "cordova-plugin-statusbar",
   "version": "2.2.2-dev",
   "description": "Cordova StatusBar Plugin",
+  "types": "./types/index.d.ts",
   "cordova": {
     "id": "cordova-plugin-statusbar",
     "platforms": [

http://git-wip-us.apache.org/repos/asf/cordova-plugin-statusbar/blob/dfe54817/types/index.d.ts
----------------------------------------------------------------------
diff --git a/types/index.d.ts b/types/index.d.ts
new file mode 100644
index 0000000..87df2e7
--- /dev/null
+++ b/types/index.d.ts
@@ -0,0 +1,77 @@
+// Type definitions for Apache Cordova StatusBar plugin
+// Project: https://github.com/apache/cordova-plugin-statusbar
+// Definitions by: Xinkai Chen <https://github.com/Xinkai>
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+
+/**
+* Global object StatusBar.
+*/
+interface Window {
+    StatusBar: StatusBar;
+}
+
+
+/**
+* The StatusBar object provides some functions to customize the iOS and Android StatusBar.
+*/
+interface StatusBar {
+    /**
+    * On iOS 7, make the statusbar overlay or not overlay the WebView.
+    * @param isOverlay         On iOS 7, set to false to make the statusbar appear like iOS
6.
+    *                              Set the style and background color to suit using the other
functions.
+    */
+    overlaysWebView: (isOverlay: boolean) => void;
+
+    /**
+    * Use the default statusbar (dark text, for light backgrounds).
+    */
+    styleDefault: () => void;
+
+    /**
+    * Use the lightContent statusbar (light text, for dark backgrounds).
+    */
+    styleLightContent: () => void;
+
+    /**
+    * Use the blackTranslucent statusbar (light text, for dark backgrounds).
+    */
+    styleBlackTranslucent: () => void;
+
+    /**
+    * Use the blackOpaque statusbar (light text, for dark backgrounds).
+    */
+    styleBlackOpaque: () => void;
+
+    /**
+    * On iOS 7, when you set StatusBar.statusBarOverlaysWebView to false,
+    * you can set the background color of the statusbar by color name.
+    * @param color             Supported color names are:
+    *                              black, darkGray, lightGray, white, gray, red, green, blue,
cyan, yellow, magenta, orange, purple, brown
+    */
+    backgroundColorByName: (color: string) => void;
+
+    /**
+    * Sets the background color of the statusbar by a hex string.
+    * @param color             CSS shorthand properties are also supported.
+    *                              On iOS 7, when you set StatusBar.statusBarOverlaysWebView
to false, you can set the background color of the statusbar by a hex string (#RRGGBB).
+    *                              On WP7 and WP8 you can also specify values as #AARRGGBB,
where AA is an alpha value
+    */
+    backgroundColorByHexString: (color: string) => void;
+
+    /**
+    * Hide the statusbar.
+    */
+    hide: () => void;
+
+    /**
+    * Show the statusbar.
+    */
+    show: () => void;
+
+    /**
+    * Read this property to see if the statusbar is visible or not.
+    */
+    isVisible: boolean;
+}
+
+declare var StatusBar: StatusBar;
\ No newline at end of file


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message