ionic framework: static ionic.Platform utility

Add the static ionic.Platform utility according to the API
documentation
(http://ionicframework.com/docs/api/utility/ionic.Platform/)
This commit is contained in:
Julien Evano
2015-11-03 19:43:16 +11:00
parent 0dd29bf825
commit 7ca9b69f1c
2 changed files with 126 additions and 11 deletions

82
ionic/ionic.d.ts vendored
View File

@@ -6,7 +6,89 @@
/// <reference path="../angularjs/angular.d.ts" />
interface IonicStatic {
/**
* What Ionic package version is.
*/
version: string;
Platform: {
/**
* Trigger a callback once the device is ready, or immediately
* if the device is already ready. This method can be run from
* anywhere and does not need to be wrapped by any additonal methods.
* When the app is within a WebView (Cordova), itll fire
* the callback once the device is ready. If the app is within
* a web browser, itll fire the callback after window.load.
* Please remember that Cordova features (Camera, FileSystem, etc) still
* will not work in a web browser.
*/
ready(callback: ()=>void): void;
/**
* Set the grade of the device: a, b, or c. a is the best
* (most css features enabled), c is the worst. By default, sets the grade
* depending on the current device.
*/
setGrade(grade: string): void;
/**
* Return the current device (given by cordova).
*/
device(): any;
/**
* Check if we are running within a WebView (such as Cordova).
*/
isWebView(): boolean;
/**
* Whether we are running on iPad.
*/
isIPad(): boolean;
/**
* Whether we are running on iOS.
*/
isIOS(): boolean;
/**
* Whether we are running on Android.
*/
isAndroid(): boolean;
/**
* Whether we are running on Windows Phone.
*/
isWindowsPhone(): boolean;
/**
* The name of the current platform.
*/
platform(): string;
/**
* The version of the current device platform.
*/
version(): number;
/**
* Exit the app.
*/
exitApp(): void;
/**
* Shows or hides the device status bar (in Cordova). Requires cordova plugin add org.apache.cordova.statusbar
*/
showStatusBar(shouldShow: boolean): void;
/**
* Sets whether the app is fullscreen or not (in Cordova).
*/
fullScreen(showFullScreen?: boolean, showStatusBar?: boolean): void;
/**
* Whether the device is ready.
*/
isReady: boolean;
/**
* Whether the device is fullscreen.
*/
isFullScreen: boolean;
/**
* An array of all platforms found.
*/
platforms: Array<string>;
/**
* What grade the current platform is.
*/
grade: string;
};
}
declare var ionic: IonicStatic;