diff --git a/src/@ionic-native/plugins/pro/index.ts b/src/@ionic-native/plugins/pro/index.ts index 8a5f2f43cd..1475c86b64 100644 --- a/src/@ionic-native/plugins/pro/index.ts +++ b/src/@ionic-native/plugins/pro/index.ts @@ -1,5 +1,6 @@ import { Injectable } from '@angular/core'; import { Plugin, Cordova, CordovaInstance, IonicNativePlugin } from '@ionic-native/core'; +import { Observable } from 'rxjs/Observable'; /** * Information about the currently running app @@ -21,6 +22,15 @@ export interface DeployInfo { binary_version: string; } +/** + * Object for manually configuring deploy + */ +export interface DeployConfig { + appId?: string; + host?: string; + channel?: string; +} + /** * @hidden */ @@ -30,68 +40,61 @@ export class ProDeploy { /** * Re-initialize Deploy plugin with a new App ID and host. Not used in most cases. - * @param appId An Ionic Pro app ID - * @param host An Ionic Pro live update API + * @param config A valid Deploy config object */ @CordovaInstance() - init(appId: string, host: string): Promise { return; } - - @CordovaInstance() - debug(): Promise { return; } - - @CordovaInstance() - clearDebug(): Promise { return; } + init(config: DeployConfig): Promise { return; } /** * Check a channel for an available update - * @param appId An Ionic Pro app ID - * @param channelName An Ionic Pro channel name + * @return {Promise} Resolves with 'true' or 'false', or rejects with an error. */ - @CordovaInstance() - check(appId: string, channelName: string): Promise { return; } + @CordovaInstance({ + observable: true + }) + check(): Promise { return; } /** * Download an available version - * @param appId An Ionic Pro app ID + * @return {Observable} Updates with percent completion, or errors with a message. */ - @CordovaInstance() - download(appId: string): Promise { return; } + @CordovaInstance({ + observable: true + }) + download(): Observable { return; } /** * Unzip the latest downloaded version - * @param appId An Ionic Pro app ID + * @return {Observable} Updates with percent completion, or errors with a message. */ @CordovaInstance() - extract(appId: string): Promise { return; } + extract(): Observable { return; } /** * Reload app with the deployed version - * @param appId An Ionic Pro app ID */ @CordovaInstance() - redirect(appId: string): Promise { return; } + redirect(): Promise { return; } /** * Get info about the version running on the device - * @param appId An Ionic Pro app ID + * @return {Promise} Information about the current version running on the app. */ @CordovaInstance() - info(appId: string): Promise { return; } + info(): Promise { return; } /** * List versions stored on the device - * @param appId An Ionic Pro app ID */ @CordovaInstance() - getVersions(appId: string): Promise { return; } + getVersions(): Promise { return; } /** * Delete a version stored on the device by UUID - * @param appId An Ionic Pro app ID * @param version A version UUID */ @CordovaInstance() - deleteVersion(appId: string, version: string): Promise { return; } + deleteVersion(version: string): Promise { return; } } /**