Merge branch 'master' into v5

This commit is contained in:
Daniel 2018-04-08 18:51:08 +02:00
parent c4e8c2efbc
commit c0737feb41
6 changed files with 98 additions and 87 deletions

View File

@ -2,7 +2,6 @@ import { checkAvailability } from './decorators/common';
import { get } from './util'; import { get } from './util';
export class IonicNativePlugin { export class IonicNativePlugin {
static pluginName: string; static pluginName: string;
static pluginRef: string; static pluginRef: string;

View File

@ -13,7 +13,6 @@ export function get(element: Element | Window, path: string) {
return obj; return obj;
} }
/** /**
* @private * @private
*/ */
@ -25,7 +24,9 @@ export function getPromise(callback: Function = () => {}): Promise<any> {
callback(resolve, reject); callback(resolve, reject);
}); });
} else { } else {
console.error('No Promise support or polyfill found. To enable Ionic Native support, please add the es6-promise polyfill before this script, or run with a library like Angular or on a recent browser.'); console.error(
'No Promise support or polyfill found. To enable Ionic Native support, please add the es6-promise polyfill before this script, or run with a library like Angular or on a recent browser.'
);
} }
}; };

View File

@ -138,7 +138,7 @@ export interface AndroidExoPlayerControllerConfig {
exo_play: string; exo_play: string;
/** /**
* Payse button icon. * Pause button icon.
*/ */
exo_pause: string; exo_pause: string;
@ -184,7 +184,7 @@ export interface AndroidExoPlayerControllerConfig {
export class AndroidExoplayer extends IonicNativePlugin { export class AndroidExoplayer extends IonicNativePlugin {
/** /**
* Show the player. * Show the player.
* @param parameters {AndroidExoPlayerParams} Parameters * @param {AndroidExoPlayerParams} parameters Parameters
* @return {Observable<AndroidExoplayerState>} * @return {Observable<AndroidExoplayerState>}
*/ */
@Cordova({ @Cordova({
@ -200,8 +200,8 @@ export class AndroidExoplayer extends IonicNativePlugin {
/** /**
* Switch stream without disposing of the player. * Switch stream without disposing of the player.
* @param url {string} The url of the new stream. * @param {string} url The url of the new stream.
* @param controller {AndroidExoPlayerControllerConfig} Configuration of the controller. * @param {AndroidExoPlayerControllerConfig} controller Configuration of the controller.
* @return {Promise<void>} * @return {Promise<void>}
*/ */
@Cordova() @Cordova()
@ -232,7 +232,7 @@ export class AndroidExoplayer extends IonicNativePlugin {
/** /**
* Jump to a particular position. * Jump to a particular position.
* @param milliseconds {number} Position in stream in milliseconds * @param {number} milliseconds Position in stream in milliseconds
* @return {Promise<void>} * @return {Promise<void>}
*/ */
@Cordova() @Cordova()
@ -242,7 +242,7 @@ export class AndroidExoplayer extends IonicNativePlugin {
/** /**
* Jump to a particular time relative to the current position. * Jump to a particular time relative to the current position.
* @param milliseconds {number} Time in milliseconds * @param {number} milliseconds Time in milliseconds
* @return {Promise<void>} * @return {Promise<void>}
*/ */
@Cordova() @Cordova()
@ -279,7 +279,7 @@ export class AndroidExoplayer extends IonicNativePlugin {
/** /**
* Update the controller configuration. * Update the controller configuration.
* @param controller {AndroidExoPlayerControllerConfig} Configuration of the controller. * @param {AndroidExoPlayerControllerConfig} controller Configuration of the controller.
* @return {Promise<void>} * @return {Promise<void>}
*/ */
@Cordova() @Cordova()

View File

@ -1,9 +1,7 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
export interface AFAAuthOptions { export interface AFAAuthOptions {
/** /**
* Required * Required
* Used as the alias for your key in the Android Key Store. * Used as the alias for your key in the Android Key Store.
@ -62,7 +60,6 @@ export interface AFAAuthOptions {
* Set the hint displayed by the fingerprint icon on the fingerprint authentication dialog. * Set the hint displayed by the fingerprint icon on the fingerprint authentication dialog.
*/ */
dialogHint?: string; dialogHint?: string;
} }
export interface AFADecryptOptions { export interface AFADecryptOptions {
@ -96,6 +93,17 @@ export interface AFAEncryptResponse {
token: string; token: string;
} }
export interface AFAAvailableResponse {
isAvailable: boolean;
isHardwareDetected: boolean;
hasEnrolledFingerprints: boolean;
}
export interface AFADeleteOptions {
clientId: string;
username: string;
}
/** /**
* @name Android Fingerprint Auth * @name Android Fingerprint Auth
* @description * @description
@ -139,6 +147,8 @@ export interface AFAEncryptResponse {
* AFAAuthOptions * AFAAuthOptions
* AFAEncryptResponse * AFAEncryptResponse
* AFADecryptOptions * AFADecryptOptions
* AFAAvailableResponse
* AFADeleteOptions
*/ */
@Plugin({ @Plugin({
pluginName: 'AndroidFingerprintAuth', pluginName: 'AndroidFingerprintAuth',
@ -149,32 +159,31 @@ export interface AFAEncryptResponse {
}) })
@Injectable() @Injectable()
export class AndroidFingerprintAuth extends IonicNativePlugin { export class AndroidFingerprintAuth extends IonicNativePlugin {
ERRORS: { ERRORS: {
BAD_PADDING_EXCEPTION: 'BAD_PADDING_EXCEPTION', BAD_PADDING_EXCEPTION: 'BAD_PADDING_EXCEPTION';
CERTIFICATE_EXCEPTION: 'CERTIFICATE_EXCEPTION', CERTIFICATE_EXCEPTION: 'CERTIFICATE_EXCEPTION';
FINGERPRINT_CANCELLED: 'FINGERPRINT_CANCELLED', FINGERPRINT_CANCELLED: 'FINGERPRINT_CANCELLED';
FINGERPRINT_DATA_NOT_DELETED: 'FINGERPRINT_DATA_NOT_DELETED', FINGERPRINT_DATA_NOT_DELETED: 'FINGERPRINT_DATA_NOT_DELETED';
FINGERPRINT_ERROR: 'FINGERPRINT_ERROR', FINGERPRINT_ERROR: 'FINGERPRINT_ERROR';
FINGERPRINT_NOT_AVAILABLE: 'FINGERPRINT_NOT_AVAILABLE', FINGERPRINT_NOT_AVAILABLE: 'FINGERPRINT_NOT_AVAILABLE';
FINGERPRINT_PERMISSION_DENIED: 'FINGERPRINT_PERMISSION_DENIED', FINGERPRINT_PERMISSION_DENIED: 'FINGERPRINT_PERMISSION_DENIED';
FINGERPRINT_PERMISSION_DENIED_SHOW_REQUEST: 'FINGERPRINT_PERMISSION_DENIED_SHOW_REQUEST', FINGERPRINT_PERMISSION_DENIED_SHOW_REQUEST: 'FINGERPRINT_PERMISSION_DENIED_SHOW_REQUEST';
ILLEGAL_BLOCK_SIZE_EXCEPTION: 'ILLEGAL_BLOCK_SIZE_EXCEPTION', ILLEGAL_BLOCK_SIZE_EXCEPTION: 'ILLEGAL_BLOCK_SIZE_EXCEPTION';
INIT_CIPHER_FAILED: 'INIT_CIPHER_FAILED', INIT_CIPHER_FAILED: 'INIT_CIPHER_FAILED';
INVALID_ALGORITHM_PARAMETER_EXCEPTION: 'INVALID_ALGORITHM_PARAMETER_EXCEPTION', INVALID_ALGORITHM_PARAMETER_EXCEPTION: 'INVALID_ALGORITHM_PARAMETER_EXCEPTION';
IO_EXCEPTION: 'IO_EXCEPTION', IO_EXCEPTION: 'IO_EXCEPTION';
JSON_EXCEPTION: 'JSON_EXCEPTION', JSON_EXCEPTION: 'JSON_EXCEPTION';
MINIMUM_SDK: 'MINIMUM_SDK', MINIMUM_SDK: 'MINIMUM_SDK';
MISSING_ACTION_PARAMETERS: 'MISSING_ACTION_PARAMETERS', MISSING_ACTION_PARAMETERS: 'MISSING_ACTION_PARAMETERS';
MISSING_PARAMETERS: 'MISSING_PARAMETERS', MISSING_PARAMETERS: 'MISSING_PARAMETERS';
NO_SUCH_ALGORITHM_EXCEPTION: 'NO_SUCH_ALGORITHM_EXCEPTION', NO_SUCH_ALGORITHM_EXCEPTION: 'NO_SUCH_ALGORITHM_EXCEPTION';
SECURITY_EXCEPTION: 'SECURITY_EXCEPTION' SECURITY_EXCEPTION: 'SECURITY_EXCEPTION';
}; };
/** /**
* Opens a native dialog fragment to use the device hardware fingerprint scanner to authenticate against fingerprints registered for the device. * Opens a native dialog fragment to use the device hardware fingerprint scanner to authenticate against fingerprints registered for the device.
* @param options {AFAAuthOptions} Options * @param {AFAAuthOptions} options Options
* @returns {Promise<any>} * @returns {Promise<AFAEncryptResponse>}
*/ */
@Cordova() @Cordova()
encrypt(options: AFAAuthOptions): Promise<AFAEncryptResponse> { encrypt(options: AFAAuthOptions): Promise<AFAEncryptResponse> {
@ -183,8 +192,8 @@ export class AndroidFingerprintAuth extends IonicNativePlugin {
/** /**
* Opens a native dialog fragment to use the device hardware fingerprint scanner to authenticate against fingerprints registered for the device. * Opens a native dialog fragment to use the device hardware fingerprint scanner to authenticate against fingerprints registered for the device.
* @param options {AFAAuthOptions} Options * @param {AFAAuthOptions} options Options
* @returns {Promise<any>} * @returns {Promise<AFADecryptOptions>}
*/ */
@Cordova() @Cordova()
decrypt(options: AFAAuthOptions): Promise<AFADecryptOptions> { decrypt(options: AFAAuthOptions): Promise<AFADecryptOptions> {
@ -193,19 +202,20 @@ export class AndroidFingerprintAuth extends IonicNativePlugin {
/** /**
* Check if service is available * Check if service is available
* @returns {Promise<any>} Returns a Promise that resolves if fingerprint auth is available on the device * @returns {Promise<AFAAvailableResponse>} Returns a Promise that resolves if fingerprint auth is available on the device
*/ */
@Cordova() @Cordova()
isAvailable(): Promise<{ isAvailable: boolean, isHardwareDetected: boolean, hasEnrolledFingerprints: boolean }> { isAvailable(): Promise<AFAAvailableResponse> {
return; return;
} }
/** /**
* Delete the cipher used for encryption and decryption by username * Delete the cipher used for encryption and decryption by username
* @returns {Promise<any>} Returns a Promise that resolves if the cipher was successfully deleted * @param {AFADeleteOptions} options Options
* @returns {Promise<{ deleted: boolean }>} Returns a Promise that resolves if the cipher was successfully deleted
*/ */
@Cordova() @Cordova()
delete(options: { clientId: string; username: string; }): Promise<{ deleted: boolean }> { delete(options: AFADeleteOptions): Promise<{ deleted: boolean }> {
return; return;
} }
} }

View File

@ -1,5 +1,5 @@
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
/** /**
* @name Android Permissions * @name Android Permissions
@ -37,12 +37,12 @@ import { Injectable } from '@angular/core';
}) })
@Injectable() @Injectable()
export class AndroidPermissions extends IonicNativePlugin { export class AndroidPermissions extends IonicNativePlugin {
PERMISSION: any = { PERMISSION: any = {
ACCESS_CHECKIN_PROPERTIES: 'android.permission.ACCESS_CHECKIN_PROPERTIES', ACCESS_CHECKIN_PROPERTIES: 'android.permission.ACCESS_CHECKIN_PROPERTIES',
ACCESS_COARSE_LOCATION: 'android.permission.ACCESS_COARSE_LOCATION', ACCESS_COARSE_LOCATION: 'android.permission.ACCESS_COARSE_LOCATION',
ACCESS_FINE_LOCATION: 'android.permission.ACCESS_FINE_LOCATION', ACCESS_FINE_LOCATION: 'android.permission.ACCESS_FINE_LOCATION',
ACCESS_LOCATION_EXTRA_COMMANDS: 'android.permission.ACCESS_LOCATION_EXTRA_COMMANDS', ACCESS_LOCATION_EXTRA_COMMANDS:
'android.permission.ACCESS_LOCATION_EXTRA_COMMANDS',
ACCESS_MOCK_LOCATION: 'android.permission.ACCESS_MOCK_LOCATION', ACCESS_MOCK_LOCATION: 'android.permission.ACCESS_MOCK_LOCATION',
ACCESS_NETWORK_STATE: 'android.permission.ACCESS_NETWORK_STATE', ACCESS_NETWORK_STATE: 'android.permission.ACCESS_NETWORK_STATE',
ACCESS_SURFACE_FLINGER: 'android.permission.ACCESS_SURFACE_FLINGER', ACCESS_SURFACE_FLINGER: 'android.permission.ACCESS_SURFACE_FLINGER',
@ -53,12 +53,14 @@ export class AndroidPermissions extends IonicNativePlugin {
BATTERY_STATS: 'android.permission.BATTERY_STATS', BATTERY_STATS: 'android.permission.BATTERY_STATS',
BIND_ACCESSIBILITY_SERVICE: 'android.permission.BIND_ACCESSIBILITY_SERVICE', BIND_ACCESSIBILITY_SERVICE: 'android.permission.BIND_ACCESSIBILITY_SERVICE',
BIND_APPWIDGET: 'android.permission.BIND_APPWIDGET', BIND_APPWIDGET: 'android.permission.BIND_APPWIDGET',
BIND_CARRIER_MESSAGING_SERVICE: 'android.permission.BIND_CARRIER_MESSAGING_SERVICE', BIND_CARRIER_MESSAGING_SERVICE:
'android.permission.BIND_CARRIER_MESSAGING_SERVICE',
BIND_DEVICE_ADMIN: 'android.permission.BIND_DEVICE_ADMIN', BIND_DEVICE_ADMIN: 'android.permission.BIND_DEVICE_ADMIN',
BIND_DREAM_SERVICE: 'android.permission.BIND_DREAM_SERVICE', BIND_DREAM_SERVICE: 'android.permission.BIND_DREAM_SERVICE',
BIND_INPUT_METHOD: 'android.permission.BIND_INPUT_METHOD', BIND_INPUT_METHOD: 'android.permission.BIND_INPUT_METHOD',
BIND_NFC_SERVICE: 'android.permission.BIND_NFC_SERVICE', BIND_NFC_SERVICE: 'android.permission.BIND_NFC_SERVICE',
BIND_NOTIFICATION_LISTENER_SERVICE: 'android.permission.BIND_NOTIFICATION_LISTENER_SERVICE', BIND_NOTIFICATION_LISTENER_SERVICE:
'android.permission.BIND_NOTIFICATION_LISTENER_SERVICE',
BIND_PRINT_SERVICE: 'android.permission.BIND_PRINT_SERVICE', BIND_PRINT_SERVICE: 'android.permission.BIND_PRINT_SERVICE',
BIND_REMOTEVIEWS: 'android.permission.BIND_REMOTEVIEWS', BIND_REMOTEVIEWS: 'android.permission.BIND_REMOTEVIEWS',
BIND_TEXT_SERVICE: 'android.permission.BIND_TEXT_SERVICE', BIND_TEXT_SERVICE: 'android.permission.BIND_TEXT_SERVICE',
@ -79,12 +81,15 @@ export class AndroidPermissions extends IonicNativePlugin {
CALL_PRIVILEGED: 'android.permission.CALL_PRIVILEGED', CALL_PRIVILEGED: 'android.permission.CALL_PRIVILEGED',
CAMERA: 'android.permission.CAMERA', CAMERA: 'android.permission.CAMERA',
CAPTURE_AUDIO_OUTPUT: 'android.permission.CAPTURE_AUDIO_OUTPUT', CAPTURE_AUDIO_OUTPUT: 'android.permission.CAPTURE_AUDIO_OUTPUT',
CAPTURE_SECURE_VIDEO_OUTPUT: 'android.permission.CAPTURE_SECURE_VIDEO_OUTPUT', CAPTURE_SECURE_VIDEO_OUTPUT:
'android.permission.CAPTURE_SECURE_VIDEO_OUTPUT',
CAPTURE_VIDEO_OUTPUT: 'android.permission.CAPTURE_VIDEO_OUTPUT', CAPTURE_VIDEO_OUTPUT: 'android.permission.CAPTURE_VIDEO_OUTPUT',
CHANGE_COMPONENT_ENABLED_STATE: 'android.permission.CHANGE_COMPONENT_ENABLED_STATE', CHANGE_COMPONENT_ENABLED_STATE:
'android.permission.CHANGE_COMPONENT_ENABLED_STATE',
CHANGE_CONFIGURATION: 'android.permission.CHANGE_CONFIGURATION', CHANGE_CONFIGURATION: 'android.permission.CHANGE_CONFIGURATION',
CHANGE_NETWORK_STATE: 'android.permission.CHANGE_NETWORK_STATE', CHANGE_NETWORK_STATE: 'android.permission.CHANGE_NETWORK_STATE',
CHANGE_WIFI_MULTICAST_STATE: 'android.permission.CHANGE_WIFI_MULTICAST_STATE', CHANGE_WIFI_MULTICAST_STATE:
'android.permission.CHANGE_WIFI_MULTICAST_STATE',
CHANGE_WIFI_STATE: 'android.permission.CHANGE_WIFI_STATE', CHANGE_WIFI_STATE: 'android.permission.CHANGE_WIFI_STATE',
CLEAR_APP_CACHE: 'android.permission.CLEAR_APP_CACHE', CLEAR_APP_CACHE: 'android.permission.CLEAR_APP_CACHE',
CLEAR_APP_USER_DATA: 'android.permission.CLEAR_APP_USER_DATA', CLEAR_APP_USER_DATA: 'android.permission.CLEAR_APP_USER_DATA',
@ -130,7 +135,8 @@ export class AndroidPermissions extends IonicNativePlugin {
READ_CONTACTS: 'android.permission.READ_CONTACTS', READ_CONTACTS: 'android.permission.READ_CONTACTS',
READ_EXTERNAL_STORAGE: 'android.permission.READ_EXTERNAL_STORAGE', READ_EXTERNAL_STORAGE: 'android.permission.READ_EXTERNAL_STORAGE',
READ_FRAME_BUFFER: 'android.permission.READ_FRAME_BUFFER', READ_FRAME_BUFFER: 'android.permission.READ_FRAME_BUFFER',
READ_HISTORY_BOOKMARKS: 'com.android.browser.permission.READ_HISTORY_BOOKMARKS', READ_HISTORY_BOOKMARKS:
'com.android.browser.permission.READ_HISTORY_BOOKMARKS',
READ_INPUT_STATE: 'android.permission.READ_INPUT_STATE', READ_INPUT_STATE: 'android.permission.READ_INPUT_STATE',
READ_LOGS: 'android.permission.READ_LOGS', READ_LOGS: 'android.permission.READ_LOGS',
READ_PHONE_STATE: 'android.permission.READ_PHONE_STATE', READ_PHONE_STATE: 'android.permission.READ_PHONE_STATE',
@ -164,7 +170,8 @@ export class AndroidPermissions extends IonicNativePlugin {
SET_TIME_ZONE: 'android.permission.SET_TIME_ZONE', SET_TIME_ZONE: 'android.permission.SET_TIME_ZONE',
SET_WALLPAPER: 'android.permission.SET_WALLPAPER', SET_WALLPAPER: 'android.permission.SET_WALLPAPER',
SET_WALLPAPER_HINTS: 'android.permission.SET_WALLPAPER_HINTS', SET_WALLPAPER_HINTS: 'android.permission.SET_WALLPAPER_HINTS',
SIGNAL_PERSISTENT_PROCESSES: 'android.permission.SIGNAL_PERSISTENT_PROCESSES', SIGNAL_PERSISTENT_PROCESSES:
'android.permission.SIGNAL_PERSISTENT_PROCESSES',
STATUS_BAR: 'android.permission.STATUS_BAR', STATUS_BAR: 'android.permission.STATUS_BAR',
SUBSCRIBED_FEEDS_READ: 'android.permission.SUBSCRIBED_FEEDS_READ', SUBSCRIBED_FEEDS_READ: 'android.permission.SUBSCRIBED_FEEDS_READ',
SUBSCRIBED_FEEDS_WRITE: 'android.permission.SUBSCRIBED_FEEDS_WRITE', SUBSCRIBED_FEEDS_WRITE: 'android.permission.SUBSCRIBED_FEEDS_WRITE',
@ -182,7 +189,8 @@ export class AndroidPermissions extends IonicNativePlugin {
WRITE_CONTACTS: 'android.permission.WRITE_CONTACTS', WRITE_CONTACTS: 'android.permission.WRITE_CONTACTS',
WRITE_EXTERNAL_STORAGE: 'android.permission.WRITE_EXTERNAL_STORAGE', WRITE_EXTERNAL_STORAGE: 'android.permission.WRITE_EXTERNAL_STORAGE',
WRITE_GSERVICES: 'android.permission.WRITE_GSERVICES', WRITE_GSERVICES: 'android.permission.WRITE_GSERVICES',
WRITE_HISTORY_BOOKMARKS: 'com.android.browser.permission.WRITE_HISTORY_BOOKMARKS', WRITE_HISTORY_BOOKMARKS:
'com.android.browser.permission.WRITE_HISTORY_BOOKMARKS',
WRITE_PROFILE: 'android.permission.WRITE_PROFILE', WRITE_PROFILE: 'android.permission.WRITE_PROFILE',
WRITE_SECURE_SETTINGS: 'android.permission.WRITE_SECURE_SETTINGS', WRITE_SECURE_SETTINGS: 'android.permission.WRITE_SECURE_SETTINGS',
WRITE_SETTINGS: 'android.permission.WRITE_SETTINGS', WRITE_SETTINGS: 'android.permission.WRITE_SETTINGS',
@ -190,12 +198,12 @@ export class AndroidPermissions extends IonicNativePlugin {
WRITE_SOCIAL_STREAM: 'android.permission.WRITE_SOCIAL_STREAM', WRITE_SOCIAL_STREAM: 'android.permission.WRITE_SOCIAL_STREAM',
WRITE_SYNC_SETTINGS: 'android.permission.WRITE_SYNC_SETTINGS', WRITE_SYNC_SETTINGS: 'android.permission.WRITE_SYNC_SETTINGS',
WRITE_USER_DICTIONARY: 'android.permission.WRITE_USER_DICTIONARY', WRITE_USER_DICTIONARY: 'android.permission.WRITE_USER_DICTIONARY',
WRITE_VOICEMAIL: 'com.android.voicemail.permission.WRITE_VOICEMAIL', WRITE_VOICEMAIL: 'com.android.voicemail.permission.WRITE_VOICEMAIL'
}; };
/** /**
* Check permission * Check permission
* @param permission {string} The name of the permission * @param {string} permission The name of the permission
* @return {Promise<any>} Returns a promise * @return {Promise<any>} Returns a promise
*/ */
@Cordova() @Cordova()
@ -205,7 +213,7 @@ export class AndroidPermissions extends IonicNativePlugin {
/** /**
* Request permission * Request permission
* @param permission {string} The name of the permission to request * @param {string} permission The name of the permission to request
* @return {Promise<any>} * @return {Promise<any>}
*/ */
@Cordova() @Cordova()
@ -215,7 +223,7 @@ export class AndroidPermissions extends IonicNativePlugin {
/** /**
* Request permissions * Request permissions
* @param permissions {Array<string>} An array with permissions * @param {Array<string>} permissions An array with permissions
* @return {Promise<any>} Returns a promise * @return {Promise<any>} Returns a promise
*/ */
@Cordova() @Cordova()
@ -225,12 +233,11 @@ export class AndroidPermissions extends IonicNativePlugin {
/** /**
* This function still works now, will not support in the future. * This function still works now, will not support in the future.
* @param permission {string} The name of the permission * @param {string} permission The name of the permission
* @return {Promise<any>} Returns a promise * @return {Promise<any>} Returns a promise
*/ */
@Cordova() @Cordova()
hasPermission(permission: string): Promise<any> { hasPermission(permission: string): Promise<any> {
return; return;
} }
} }

View File

@ -61,9 +61,9 @@ export interface IRemotePackage extends IPackage {
/** /**
* Downloads the package update from the CodePush service. * Downloads the package update from the CodePush service.
* *
* @param downloadSuccess Called with one parameter, the downloaded package information, once the download completed successfully. * @param {SuccessCallback} downloadSuccess Called with one parameter, the downloaded package information, once the download completed successfully.
* @param downloadError Optional callback invoked in case of an error. * @param {ErrorCallback} [downloadError] Optional callback invoked in case of an error.
* @param downloadProgress Optional callback invoked during the download process. It is called several times with one DownloadProgress parameter. * @param {SuccessCallback<DownloadProgress>} [downloadProgress] Optional callback invoked during the download process. It is called several times with one DownloadProgress parameter.
*/ */
download( download(
downloadSuccess: SuccessCallback<ILocalPackage>, downloadSuccess: SuccessCallback<ILocalPackage>,
@ -74,8 +74,8 @@ export interface IRemotePackage extends IPackage {
/** /**
* Aborts the current download session, previously started with download(). * Aborts the current download session, previously started with download().
* *
* @param abortSuccess Optional callback invoked if the abort operation succeeded. * @param {SuccessCallback<void>} [abortSuccess] Optional callback invoked if the abort operation succeeded.
* @param abortError Optional callback invoked in case of an error. * @param {ErrorCallback} [abortError] Optional callback invoked in case of an error.
*/ */
abortDownload( abortDownload(
abortSuccess?: SuccessCallback<void>, abortSuccess?: SuccessCallback<void>,
@ -104,9 +104,9 @@ export interface ILocalPackage extends IPackage {
* On the first run after the update, the application will wait for a codePush.notifyApplicationReady() call. Once this call is made, the install operation is considered a success. * On the first run after the update, the application will wait for a codePush.notifyApplicationReady() call. Once this call is made, the install operation is considered a success.
* Otherwise, the install operation will be marked as failed, and the application is reverted to its previous version on the next run. * Otherwise, the install operation will be marked as failed, and the application is reverted to its previous version on the next run.
* *
* @param installSuccess Callback invoked if the install operation succeeded. * @param {SuccessCallback<InstallMode>} installSuccess Callback invoked if the install operation succeeded.
* @param installError Optional callback inovoked in case of an error. * @param {ErrorCallback} [installError] Optional callback invoked in case of an error.
* @param installOptions Optional parameter used for customizing the installation behavior. * @param {InstallOptions} [installOptions] Optional parameter used for customizing the installation behavior.
*/ */
install( install(
installSuccess: SuccessCallback<InstallMode>, installSuccess: SuccessCallback<InstallMode>,
@ -215,7 +215,7 @@ interface CodePushCordovaPlugin {
/** /**
* Gets the pending package information, if any. A pending package is one that has been installed but the application still runs the old code. * Gets the pending package information, if any. A pending package is one that has been installed but the application still runs the old code.
* This happends only after a package has been installed using ON_NEXT_RESTART or ON_NEXT_RESUME mode, but the application was not restarted/resumed yet. * This happens only after a package has been installed using ON_NEXT_RESTART or ON_NEXT_RESUME mode, but the application was not restarted/resumed yet.
*/ */
getPendingPackage( getPendingPackage(
packageSuccess: SuccessCallback<ILocalPackage>, packageSuccess: SuccessCallback<ILocalPackage>,
@ -225,11 +225,11 @@ interface CodePushCordovaPlugin {
/** /**
* Checks with the CodePush server if an update package is available for download. * Checks with the CodePush server if an update package is available for download.
* *
* @param querySuccess Callback invoked in case of a successful response from the server. * @param {SuccessCallback<IRemotePackage>} querySuccess Callback invoked in case of a successful response from the server.
* The callback takes one RemotePackage parameter. A non-null package is a valid update. * The callback takes one RemotePackage parameter. A non-null package is a valid update.
* A null package means the application is up to date for the current native application version. * A null package means the application is up to date for the current native application version.
* @param queryError Optional callback invoked in case of an error. * @param {ErrorCallback} [queryError] Optional callback invoked in case of an error.
* @param deploymentKey Optional deployment key that overrides the config.xml setting. * @param {string} [deploymentKey] Optional deployment key that overrides the config.xml setting.
*/ */
checkForUpdate( checkForUpdate(
querySuccess: SuccessCallback<IRemotePackage>, querySuccess: SuccessCallback<IRemotePackage>,
@ -242,8 +242,8 @@ interface CodePushCordovaPlugin {
* Calling this function is required on the first run after an update. On every subsequent application run, calling this function is a noop. * Calling this function is required on the first run after an update. On every subsequent application run, calling this function is a noop.
* If using sync API, calling this function is not required since sync calls it internally. * If using sync API, calling this function is not required since sync calls it internally.
* *
* @param notifySucceeded Optional callback invoked if the plugin was successfully notified. * @param {SuccessCallback<void>} [notifySucceeded] Optional callback invoked if the plugin was successfully notified.
* @param notifyFailed Optional callback invoked in case of an error during notifying the plugin. * @param {ErrorCallback} [notifyFailed] Optional callback invoked in case of an error during notifying the plugin.
*/ */
notifyApplicationReady( notifyApplicationReady(
notifySucceeded?: SuccessCallback<void>, notifySucceeded?: SuccessCallback<void>,
@ -253,6 +253,9 @@ interface CodePushCordovaPlugin {
/** /**
* Reloads the application. If there is a pending update package installed using ON_NEXT_RESTART or ON_NEXT_RESUME modes, the update * Reloads the application. If there is a pending update package installed using ON_NEXT_RESTART or ON_NEXT_RESUME modes, the update
* will be immediately visible to the user. Otherwise, calling this function will simply reload the current version of the application. * will be immediately visible to the user. Otherwise, calling this function will simply reload the current version of the application.
*
* @param {SuccessCallback<void>} installSuccess
* @param {ErrorCallback} [errorCallback]
*/ */
restartApplication( restartApplication(
installSuccess: SuccessCallback<void>, installSuccess: SuccessCallback<void>,
@ -274,10 +277,10 @@ interface CodePushCordovaPlugin {
* - If no update is available on the server, or if a previously rolled back update is available and the ignoreFailedUpdates is set to true, the syncCallback will be invoked with the SyncStatus.UP_TO_DATE. * - If no update is available on the server, or if a previously rolled back update is available and the ignoreFailedUpdates is set to true, the syncCallback will be invoked with the SyncStatus.UP_TO_DATE.
* - If an error occurs during checking for update, downloading or installing it, the syncCallback will be invoked with the SyncStatus.ERROR. * - If an error occurs during checking for update, downloading or installing it, the syncCallback will be invoked with the SyncStatus.ERROR.
* *
* @param syncCallback Optional callback to be called with the status of the sync operation. * @param {SuccessCallback<SyncStatus>} [syncCallback] Optional callback to be called with the status of the sync operation.
* The callback will be called only once, and the possible statuses are defined by the SyncStatus enum. * The callback will be called only once, and the possible statuses are defined by the SyncStatus enum.
* @param syncOptions Optional SyncOptions parameter configuring the behavior of the sync operation. * @param {SyncOptions} [syncOptions] Optional SyncOptions parameter configuring the behavior of the sync operation.
* @param downloadProgress Optional callback invoked during the download process. It is called several times with one DownloadProgress parameter. * @param {SuccessCallback<DownloadProgress>} [downloadProgress] Optional callback invoked during the download process. It is called several times with one DownloadProgress parameter.
* *
*/ */
sync( sync(
@ -500,8 +503,6 @@ export class CodePush extends IonicNativePlugin {
/** /**
* Get the current package information. * Get the current package information.
* *
* @param packageSuccess Callback invoked with the currently deployed package information.
* @param packageError Optional callback invoked in case of an error.
* @returns {Promise<ILocalPackage>} * @returns {Promise<ILocalPackage>}
*/ */
@Cordova() @Cordova()
@ -511,7 +512,7 @@ export class CodePush extends IonicNativePlugin {
/** /**
* Gets the pending package information, if any. A pending package is one that has been installed but the application still runs the old code. * Gets the pending package information, if any. A pending package is one that has been installed but the application still runs the old code.
* This happends only after a package has been installed using ON_NEXT_RESTART or ON_NEXT_RESUME mode, but the application was not restarted/resumed yet. * This happens only after a package has been installed using ON_NEXT_RESTART or ON_NEXT_RESUME mode, but the application was not restarted/resumed yet.
* @returns {Promise<ILocalPackage>} * @returns {Promise<ILocalPackage>}
*/ */
@Cordova() @Cordova()
@ -522,11 +523,7 @@ export class CodePush extends IonicNativePlugin {
/** /**
* Checks with the CodePush server if an update package is available for download. * Checks with the CodePush server if an update package is available for download.
* *
* @param querySuccess Callback invoked in case of a successful response from the server. * @param {string} [deploymentKey] Optional deployment key that overrides the config.xml setting.
* The callback takes one RemotePackage parameter. A non-null package is a valid update.
* A null package means the application is up to date for the current native application version.
* @param queryError Optional callback invoked in case of an error.
* @param deploymentKey Optional deployment key that overrides the config.xml setting.
* @returns {Promise<IRemotePackage>} * @returns {Promise<IRemotePackage>}
*/ */
@Cordova({ @Cordova({
@ -541,8 +538,6 @@ export class CodePush extends IonicNativePlugin {
* Calling this function is required on the first run after an update. On every subsequent application run, calling this function is a noop. * Calling this function is required on the first run after an update. On every subsequent application run, calling this function is a noop.
* If using sync API, calling this function is not required since sync calls it internally. * If using sync API, calling this function is not required since sync calls it internally.
* *
* @param notifySucceeded Optional callback invoked if the plugin was successfully notified.
* @param notifyFailed Optional callback invoked in case of an error during notifying the plugin.
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
@Cordova() @Cordova()
@ -575,9 +570,8 @@ export class CodePush extends IonicNativePlugin {
* - If no update is available on the server, or if a previously rolled back update is available and the ignoreFailedUpdates is set to true, the syncCallback will be invoked with the SyncStatus.UP_TO_DATE. * - If no update is available on the server, or if a previously rolled back update is available and the ignoreFailedUpdates is set to true, the syncCallback will be invoked with the SyncStatus.UP_TO_DATE.
* - If an error occurs during checking for update, downloading or installing it, the syncCallback will be invoked with the SyncStatus.ERROR. * - If an error occurs during checking for update, downloading or installing it, the syncCallback will be invoked with the SyncStatus.ERROR.
* *
* @param syncCallback Optional callback to be called with the status of the sync operation. * @param {SyncOptions} [syncOptions] Optional SyncOptions parameter configuring the behavior of the sync operation.
* @param syncOptions Optional SyncOptions parameter configuring the behavior of the sync operation. * @param {SuccessCallback<DownloadProgress>} [downloadProgress] Optional callback invoked during the download process. It is called several times with one DownloadProgress parameter.
* @param downloadProgress Optional callback invoked during the download process. It is called several times with one DownloadProgress parameter.
* @returns {Observable<SyncStatus>} * @returns {Observable<SyncStatus>}
* *
*/ */