import { EventEmitter, NgZone } from 'angular2/core';
import { Config } from '../config/config';
/**
 * @name Platform
 * @description
 * The Platform service can be used to get information about your current device.
 * You can get all of the platforms associated with the device using the [platforms](#platforms)
 * method, including whether the app is being viewed from a tablet, if it's
 * on a mobile device or browser, and the exact platform (ios, android, etc).
 * You can also get the orientation of the device, if it uses right-to-left
 * language direction, and much much more. With this information you can completely
 * customize your app to fit any device.
 *
 * @usage
 * ```ts
 * import {Platform} from 'ionic-angular';
 *
 * @Page({...})
 * export MyPage {
 *   constructor(platform: Platform) {
 *     this.platform = platform;
 *   }
 * }
 * ```
 * @demo /docs/v2/demos/platform/
 */
export declare class Platform {
    private _platforms;
    private _versions;
    private _dir;
    private _lang;
    private _url;
    private _qs;
    private _ua;
    private _bPlt;
    private _onResizes;
    private _readyPromise;
    private _readyResolve;
    private _resizeTm;
    private _zone;
    constructor(platforms?: any[]);
    /**
     * @private
     */
    setZone(zone: NgZone): void;
    /**
     * @returns {boolean} returns true/false based on platform.
     * @description
     * Depending on the platform the user is on, `is(platformName)` will
     * return `true` or `false`. Note that the same app can return `true`
     * for more than one platform name. For example, an app running from
     * an iPad would return `true` for the platform names: `mobile`,
     * `ios`, `ipad`, and `tablet`. Additionally, if the app was running
     * from Cordova then `cordova` would be true, and if it was running
     * from a web browser on the iPad then `mobileweb` would be `true`.
     *
     * ```
     * import {Platform} from 'ionic-angular';
     *
     * @Page({...})
     * export MyPage {
     *   constructor(platform: Platform) {
     *     this.platform = platform;
     *
     *     if (this.platform.is('ios')) {
     *       // This will only print when on ios
     *       console.log("I'm an ios device!");
     *     }
     *   }
     * }
     * ```
     *
     * | Platform Name   | Description                        |
     * |-----------------|------------------------------------|
     * | android         | on a device running Android.       |
     * | cordova         | on a device running Cordova.       |
     * | core            | on a desktop device.               |
     * | ios             | on a device running iOS.           |
     * | ipad            | on an iPad device.                 |
     * | iphone          | on an iPhone device.               |
     * | mobile          | on a mobile device.                |
     * | mobileweb       | in a browser on a mobile device.   |
     * | phablet         | on a phablet device.               |
     * | tablet          | on a tablet device.                |
     * | windows         | on a device running Windows.       |
     *
     * @param {string} platformName
     */
    is(platformName: string): boolean;
    /**
     * @returns {array} the array of platforms
     * @description
     * Depending on what device you are on, `platforms` can return multiple values.
     * Each possible value is a hierarchy of platforms. For example, on an iPhone,
     * it would return `mobile`, `ios`, and `iphone`.
     *
     * ```
     * import {Platform} from 'ionic-angular';
     *
     * @Page({...})
     * export MyPage {
     *   constructor(platform: Platform) {
     *     this.platform = platform;
     *
     *     // This will print an array of the current platforms
     *     console.log(this.platform.platforms());
     *   }
     * }
     * ```
     */
    platforms(): Array<string>;
    /**
     * Returns an object containing version information about all of the platforms.
     *
     * ```
     * import {Platform} from 'ionic-angular';
     *
     * @Page({...})
     * export MyPage {
     *   constructor(platform: Platform) {
     *     this.platform = platform;
     *
     *     // This will print an object containing
     *     // all of the platforms and their versions
     *     console.log(platform.versions());
     *   }
     * }
     * ```
     *
     * @param {string} [platformName] optional platformName
     * @returns {object} An object with various platform info
     *
     */
    versions(): {
        [name: string]: PlatformVersion;
    };
    /**
     * @private
     */
    version(): PlatformVersion;
    /**
     * Returns a promise when the platform is ready and native functionality
     * can be called. If the app is running from within a web browser, then
     * the promise will resolve when the DOM is ready. When the app is running
     * from an application engine such as Cordova, then the promise
     * will resolve when Cordova triggers the `deviceready` event.
     *
     * ```
     * import {Platform} from 'ionic-angular';
     *
     * @Page({...})
     * export MyPage {
     *   constructor(platform: Platform) {
     *     platform.ready().then(() => {
     *       console.log('Platform ready');
     *       // The platform is now ready, execute any native code you want
     *     });
     *   }
     * }
     * ```
     * @returns {promise}
     */
    ready(): Promise<any>;
    /**
     * @private
     */
    triggerReady(): void;
    /**
     * @private
     */
    prepareReady(): void;
    /**
    * Set the app's language direction, which will update the `dir` attribute
    * on the app's root `<html>` element. We recommend the app's `index.html`
    * file already has the correct `dir` attribute value set, such as
    * `<html dir="ltr">` or `<html dir="rtl">`. This method is useful if the
    * direction needs to be dynamically changed per user/session.
    * [W3C: Structural markup and right-to-left text in HTML](http://www.w3.org/International/questions/qa-html-dir)
    * @param {string} dir  Examples: `rtl`, `ltr`
    */
    setDir(dir: string, updateDocument: boolean): void;
    /**
     * Returns app's language direction.
     * We recommend the app's `index.html` file already has the correct `dir`
     * attribute value set, such as `<html dir="ltr">` or `<html dir="rtl">`.
     * [W3C: Structural markup and right-to-left text in HTML](http://www.w3.org/International/questions/qa-html-dir)
     * @returns {string}
     */
    dir(): string;
    /**
     * Returns if this app is using right-to-left language direction or not.
     * We recommend the app's `index.html` file already has the correct `dir`
     * attribute value set, such as `<html dir="ltr">` or `<html dir="rtl">`.
     * [W3C: Structural markup and right-to-left text in HTML](http://www.w3.org/International/questions/qa-html-dir)
     * @returns {boolean}
     */
    isRTL(): boolean;
    /**
    * Set the app's language and optionally the country code, which will update
    * the `lang` attribute on the app's root `<html>` element.
    * We recommend the app's `index.html` file already has the correct `lang`
    * attribute value set, such as `<html lang="en">`. This method is useful if
    * the language needs to be dynamically changed per user/session.
    * [W3C: Declaring language in HTML](http://www.w3.org/International/questions/qa-html-language-declarations)
    * @param {string} language  Examples: `en-US`, `en-GB`, `ar`, `de`, `zh`, `es-MX`
    */
    setLang(language: string, updateDocument: boolean): void;
    /**
     * Returns app's language and optional country code.
     * We recommend the app's `index.html` file already has the correct `lang`
     * attribute value set, such as `<html lang="en">`.
     * [W3C: Declaring language in HTML](http://www.w3.org/International/questions/qa-html-language-declarations)
     * @returns {string}
     */
    lang(): string;
    /**
    * @private
    */
    exitApp(): void;
    /**
    * @private
    */
    backButton: EventEmitter<any>;
    /**
    * @private
    */
    pause: EventEmitter<any>;
    /**
    * @private
    */
    resume: EventEmitter<any>;
    /**
    * @private
    */
    setUrl(url: string): void;
    /**
    * @private
    */
    url(): string;
    /**
    * @private
    */
    query(key: string): string;
    /**
    * @private
    */
    setUserAgent(userAgent: string): void;
    /**
    * @private
    */
    userAgent(): string;
    /**
    * @private
    */
    setNavigatorPlatform(navigatorPlatform: string): void;
    /**
    * @private
    */
    navigatorPlatform(): string;
    /**
    * @private
    */
    width(): number;
    /**
    * @private
    */
    height(): number;
    /**
    * @private
    */
    isPortrait(): boolean;
    /**
    * @private
    */
    isLandscape(): boolean;
    /**
    * @private
    */
    windowResize(): void;
    /**
     * @private
     * @returns Unregister function
     */
    onResize(cb: Function): Function;
    /**
     * @private
     */
    static register(platformConfig: PlatformConfig): void;
    /**
    * @private
    */
    static registry(): {
        [name: string]: PlatformConfig;
    };
    /**
     * @private
     */
    static get(platformName: string): PlatformConfig;
    /**
     * @private
     */
    static setDefault(platformName: string): void;
    /**
     * @private
     */
    testQuery(queryValue: string, queryTestValue: string): boolean;
    /**
     * @private
     */
    testNavigatorPlatform(navigatorPlatformExpression: string): boolean;
    /**
     * @private
     */
    matchUserAgentVersion(userAgentExpression: RegExp): any;
    /**
     * @private
     */
    isPlatformMatch(queryStringName: string, userAgentAtLeastHas?: string[], userAgentMustNotHave?: string[]): boolean;
    /**
     * @private
     */
    load(config: Config): void;
    /**
     * @private
     */
    private matchPlatform(platformName);
}
export interface PlatformConfig {
    name?: string;
    isEngine?: boolean;
    initialize?: Function;
    isMatch?: Function;
    superset?: string;
    subsets?: string[];
    settings?: any;
    versionParser?: any;
}
export interface PlatformVersion {
    str?: string;
    num?: number;
    major?: number;
    minor?: number;
}
