feat(pro): support corova-plugin-ionic v2.0.0

This commit is contained in:
William Pelrine 2017-10-12 10:53:41 -05:00
parent 773722b767
commit 975f08b7b5

View File

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