mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 12:56:46 +08:00
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:
82
ionic/ionic.d.ts
vendored
82
ionic/ionic.d.ts
vendored
@@ -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), it’ll fire
|
||||
* the callback once the device is ready. If the app is within
|
||||
* a web browser, it’ll 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;
|
||||
|
||||
Reference in New Issue
Block a user