Merge remote-tracking branch 'origin/master' into v5

This commit is contained in:
Daniel 2018-06-28 13:37:10 +02:00
parent 95c8566d76
commit 23e0977954
14 changed files with 771 additions and 322 deletions

792
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,66 @@
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
/**
* @name AES256
* @description
* This cordova ionic plugin allows you to perform AES 256 encryption and decryption on the plain text.
* It's a cross-platform plugin which supports both Android and iOS.
* The encryption and decryption are performed on the device native layer so that the performance is much faster.
*
* @usage
* ```typescript
* import { AES256 } from '@ionic-native/aes-256';
*
*
* constructor(private aES256: AES256) { }
*
* ...
*
*
* this.aES256.encrypt('12345678123456781234567812345678', '1234567812345678', 'testdata')
* .then(res => console.log('Encrypted Data: ',res))
* .catch((error: any) => console.error(error));
*
* this.aES256.decrypt('12345678123456781234567812345678', '1234567812345678', 'encryptedData')
* .then(res => console.log('Decrypted Data : ',res))
* .catch((error: any) => console.error(error));
*
* ```
*/
@Plugin({
pluginName: 'AES256',
plugin: 'cordova-plugin-aes256-encryption',
pluginRef: 'cordova.plugins.AES256',
repo: 'https://github.com/Ideas2IT/cordova-aes256',
platforms: ['Android', 'iOS'],
install: 'ionic cordova plugin add cordova-plugin-aes256-encryption'
})
@Injectable()
export class AES256 extends IonicNativePlugin {
/**
* This function used to perform the aes256 encryption
* @param {string} secureKey A 32 bytes string, which will used as input key for AES256 encryption.
* @param {string} secureIV A 16 bytes string, which will used as initial vector for AES256 encryption.
* @param {string} data A string which will be encrypted
* @return {Promise<string>} Returns a promise that resolves when encryption happens. The success response will returns encrypted data.
*/
@Cordova()
encrypt(secureKey: string, secureIV: string, data: string): Promise<string> {
return;
}
/**
* This function used to perform the aes256 decryption
* @param {string} secureKey A 32 bytes string, which will used as input key for AES256 decryption.
* @param {string} secureIV A 16 bytes string, which will used as initial vector for AES256 decryption.
* @param {string} data An AES256 encrypted data which will be decrypted.
* @return {Promise<string>} Returns a promise that resolves when decryption happens. The success response will returns decrypted data.
*/
@Cordova()
decrypt(secureKey: string, secureIV: string, data: string): Promise<string> {
return;
}
}

View File

@ -1,6 +1,6 @@
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { Observable } from 'rxjs';
import { Injectable } from '@angular/core';
/**
* @name Appodeal

View File

@ -7,7 +7,7 @@ export interface CameraOptions {
/**
* Choose the format of the return value.
* Defined in Camera.DestinationType. Default is FILE_URI.
* DATA_URL : 0, Return image as base64-encoded string,
* DATA_URL : 0, Return image as base64-encoded string (DATA_URL can be very memory intensive and cause app crashes or out of memory errors. Use FILE_URI or NATIVE_URI if possible),
* FILE_URI : 1, Return image file URI,
* NATIVE_URI : 2 Return image native URI
* (e.g., assets-library:// on iOS or content:// on Android)
@ -139,14 +139,14 @@ export enum Direction {
*
* const options: CameraOptions = {
* quality: 100,
* destinationType: this.camera.DestinationType.DATA_URL,
* destinationType: this.camera.DestinationType.FILE_URI,
* encodingType: this.camera.EncodingType.JPEG,
* mediaType: this.camera.MediaType.PICTURE
* }
*
* this.camera.getPicture(options).then((imageData) => {
* // imageData is either a base64 encoded string or a file URI
* // If it's base64:
* // If it's base64 (DATA_URL):
* let base64Image = 'data:image/jpeg;base64,' + imageData;
* }, (err) => {
* // Handle error

View File

@ -318,7 +318,10 @@ export class Firebase extends IonicNativePlugin {
successIndex: 2,
errorIndex: 3
})
verifyPhoneNumber(phoneNumber: string, timeoutDuration = 0): Promise<any> {
verifyPhoneNumber(
phoneNumber: string,
timeoutDuration = 0
): Promise<any> {
return;
}
}

View File

@ -306,13 +306,11 @@ export class Health extends IonicNativePlugin {
* nutrition.vitamin_a is given in micrograms in HealthKit and International Unit in Google Fit.
* Automatic conversion is not trivial and depends on the actual substance.
*
* @param queryOptions {HealthQueryOptions}
* @return {Promise<HealthData>}
* @param {HealthQueryOptions} queryOptions
* @return {Promise<HealthData[]>}
*/
@Cordova()
query(queryOptions: HealthQueryOptions): Promise<HealthData> {
return;
}
query(queryOptions: HealthQueryOptions): Promise<HealthData[]> { return; }
/**
* Gets aggregated data in a certain time window. Usually the sum is returned for the given quantity.
@ -332,7 +330,7 @@ export class Health extends IonicNativePlugin {
* To be sure to get all the stored quantities, it's better to query single nutrients.
* nutrition.vitamin_a is given in micrograms in HealthKit and International Unit in Google Fit.
*
* @param queryOptionsAggregated {HealthQueryOptionsAggregated}
* @param {HealthQueryOptionsAggregated} queryOptionsAggregated
* @return {Promise<HealthData[]>}
*/
@Cordova()

View File

@ -23,11 +23,19 @@ export interface ImagePickerOptions {
quality?: number;
/**
* Output type, defaults to 0 (FILE_URI).
* Choose the format of the return value.
* Defined in ImagePicker.OutputType. Default is FILE_URI.
* FILE_URI : 0, Return image file URI,
* DATA_URL : 1, Return image as base64-encoded string
*/
outputType?: number;
}
export enum OutputType {
FILE_URL = 0,
DATA_URL
}
/**
* @name Image Picker
* @description

View File

@ -1,5 +1,6 @@
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { Observable } from 'rxjs';
export interface IndexItem {
domain: string;
@ -15,7 +16,7 @@ export interface IndexItem {
/**
* Item keywords
*/
keywords?: Array<string>;
keywords?: Array < string > ;
/**
* Lifetime in minutes
@ -77,44 +78,54 @@ export class IndexAppContent extends IonicNativePlugin {
* @return {Promise<boolean>} Returns a promise that resolves with true if indexing is available, false if not
*/
@Cordova()
isIndexingAvailable(): Promise<boolean> {
isIndexingAvailable(): Promise <boolean> {
return;
}
/**
* Add or change items to spotlight index
* @param {Array<IndexItem>} Array of items to index
* @param {Array<IndexItem>} items Array of items to index
* @return {Promise<any>} Returns if index set was successfull
*/
@Cordova()
setItems(items: Array<IndexItem>): Promise<any> {
setItems(items: Array <IndexItem> ): Promise < any > {
return;
}
/**
* Clear all items stored for a given array of domains
* @param {Array<string>} Array of domains to clear
* @param {Array<string>} domains Array of domains to clear
* @return {Promise<any>} Resolve if successfull
*/
@Cordova()
clearItemsForDomains(domains: Array<string>): Promise<any> {
clearItemsForDomains(domains: Array <string> ): Promise < any > {
return;
}
/**
* Clear all items stored for a given array of identifiers
* @param {Array<string>} Array of identifiers to clear
* @param {Array<string>} identifiers Array of identifiers to clear
* @return {Promise<any>} Resolve if successfull
*/
@Cordova()
clearItemsForIdentifiers(identifiers: Array<string>): Promise<any> {
clearItemsForIdentifiers(identifiers: Array < string > ): Promise < any > {
return;
}
/**
* If user taps on a search result in spotlight then the app will be launched.
* You can register a Javascript handler to get informed when this happens.
* @returns {Observable<any>} returns an observable that notifies you when he user presses on the home screen icon
*/
@CordovaFunctionOverride()
onItemPressed(): Observable < any > {
return;
}
/**
* You might want to avoid to update spotlight index too frequently.
* Without calling this function a subsequent call to manipulate the index is only possible after 1440 minutes (= 24 hours)!
* @param {number} Numeric value => 0
* @param {number} intervalMinutes value => 0
*/
@Cordova()
setIndexingInterval(intervalMinutes: number) {

View File

@ -394,7 +394,8 @@ export interface ILocalNotification {
* ANDROID ONLY
* Set the token for the media session
*/
mediaSession?: string;
mediaSession?: string;
}
/**

View File

@ -8,23 +8,29 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
*
* @usage
* ```typescript
* import { NativeGeocoder, NativeGeocoderReverseResult, NativeGeocoderForwardResult } from '@ionic-native/native-geocoder';
* import { NativeGeocoder, NativeGeocoderReverseResult, NativeGeocoderForwardResult, NativeGeocoderOptions } from '@ionic-native/native-geocoder';
*
* constructor(private nativeGeocoder: NativeGeocoder) { }
*
* ...
*
* this.nativeGeocoder.reverseGeocode(52.5072095, 13.1452818)
* .then((result: NativeGeocoderReverseResult) => console.log(JSON.stringify(result)))
* let options: NativeGeocoderOptions = {
* useLocale: true,
* maxResults: 5
* };
*
* this.nativeGeocoder.reverseGeocode(52.5072095, 13.1452818, options)
* .then((result: NativeGeocoderReverseResult[]) => console.log(JSON.stringify(result[0])))
* .catch((error: any) => console.log(error));
*
* this.nativeGeocoder.forwardGeocode('Berlin')
* .then((coordinates: NativeGeocoderForwardResult) => console.log('The coordinates are latitude=' + coordinates.latitude + ' and longitude=' + coordinates.longitude))
* this.nativeGeocoder.forwardGeocode('Berlin', options)
* .then((coordinates: NativeGeocoderForwardResult[]) => console.log('The coordinates are latitude=' + coordinates[0].latitude + ' and longitude=' + coordinates[0].longitude))
* .catch((error: any) => console.log(error));
* ```
* @interfaces
* NativeGeocoderReverseResult
* NativeGeocoderForwardResult
* NativeGeocoderOptions
*/
@Plugin({
pluginName: 'NativeGeocoder',
@ -40,26 +46,24 @@ export class NativeGeocoder extends IonicNativePlugin {
* Reverse geocode a given latitude and longitude to find location address
* @param latitude {number} The latitude
* @param longitude {number} The longitude
* @return {Promise<NativeGeocoderReverseResult>}
* @param options {NativeGeocoderOptions} The options
* @return {Promise<NativeGeocoderReverseResult[]>}
*/
@Cordova({
callbackOrder: 'reverse'
})
reverseGeocode(latitude: number, longitude: number): Promise<NativeGeocoderReverseResult> {
return;
}
reverseGeocode(latitude: number, longitude: number, options?: NativeGeocoderOptions): Promise<NativeGeocoderReverseResult[]> { return; }
/**
* Forward geocode a given address to find coordinates
* @param addressString {string} The address to be geocoded
* @return {Promise<NativeGeocoderForwardResult>}
* @param options {NativeGeocoderOptions} The options
* @return {Promise<NativeGeocoderForwardResult[]>}
*/
@Cordova({
callbackOrder: 'reverse'
})
forwardGeocode(addressString: string): Promise<NativeGeocoderForwardResult> {
return;
}
forwardGeocode(addressString: string, options?: NativeGeocoderOptions): Promise<NativeGeocoderForwardResult[]> { return; }
}
/**
@ -120,3 +124,25 @@ export interface NativeGeocoderForwardResult {
*/
longitude: string;
}
/**
* Options for reverse and forward geocoding.
*/
export interface NativeGeocoderOptions {
/**
* The locale to use when returning the address information.
* If set to 'false' the locale will always be 'en_US'.
* Default is 'true'
*/
useLocale: boolean;
/**
* The default locale to use when returning the address information.
* e.g.: 'fa-IR' or 'de_DE'.
*/
defaultLocale?: string;
/**
* The maximum number of result to return (max is 5).
* Default is 1
*/
maxResults: number;
}

View File

@ -9,6 +9,8 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
*
* Requires Cordova plugin: `cordova-plugin-pin-dialog`. For more info, please see the [Pin Dialog plugin docs](https://github.com/Paldom/PinDialog).
*
* Requires Cordova plugin: `cordova-plugin-pin-dialog`. For more info, please see the [Pin Dialog plugin docs](https://github.com/Paldom/PinDialog).
*
* @usage
* ```typescript
* import { PinDialog } from '@ionic-native/pin-dialog';

View File

@ -37,6 +37,8 @@ export interface DeployConfig {
channel?: string;
}
export type ProgressMessage = number | string;
/**
* @hidden
*/
@ -48,9 +50,7 @@ export class ProDeploy {
* @param config A valid Deploy config object
*/
@CordovaInstance()
init(config: DeployConfig): Promise<any> {
return;
}
init(config: DeployConfig): Promise<void> { return; }
/**
* Check a channel for an available update
@ -63,33 +63,27 @@ export class ProDeploy {
/**
* Download an available version
* @return {Observable<any>} Updates with percent completion, or errors with a message.
* @return {Observable<ProgressMessage>} Updates with percent completion, or errors with a message.
*/
@CordovaInstance({
observable: true
})
download(): Observable<any> {
return;
}
download(): Observable<ProgressMessage> { return; }
/**
* Unzip the latest downloaded version
* @return {Observable<any>} Updates with percent completion, or errors with a message.
* @return {Observable<ProgressMessage>} Updates with percent completion, or errors with a message.
*/
@CordovaInstance({
observable: true
})
extract(): Observable<any> {
return;
}
extract(): Observable<ProgressMessage> { return; }
/**
* Reload app with the deployed version
*/
@CordovaInstance()
redirect(): Promise<any> {
return;
}
redirect(): Promise<void> { return; }
/**
* Get info about the version running on the device
@ -104,18 +98,14 @@ export class ProDeploy {
* List versions stored on the device
*/
@CordovaInstance()
getVersions(): Promise<any> {
return;
}
getVersions(): Promise<string[]> { return; }
/**
* Delete a version stored on the device by UUID
* @param version A version UUID
*/
@CordovaInstance()
deleteVersion(version: string): Promise<any> {
return;
}
deleteVersion(version: string): Promise<void> { return; }
}
/**

View File

@ -0,0 +1,82 @@
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
export const enum TYPE_SENSOR {
PROXIMITY = 'PROXIMITY',
ACCELEROMETER = 'ACCELEROMETER',
GRAVITY = 'GRAVITY',
GYROSCOPE = 'GYROSCOPE',
GYROSCOPE_UNCALIBRATED = 'GYROSCOPE_UNCALIBRATED',
LINEAR_ACCELERATION = 'LINEAR_ACCELERATION',
ROTATION_VECTOR = 'ROTATION_VECTOR',
STEP_COUNTER = 'STEP_COUNTER',
GAME_ROTATION_VECTOR = 'GAME_ROTATION_VECTOR',
GEOMAGNETIC_ROTATION_VECTOR = 'GEOMAGNETIC_ROTATION_VECTOR',
MAGNETIC_FIELD = 'MAGNETIC_FIELD',
MAGNETIC_FIELD_UNCALIBRATED = 'MAGNETIC_FIELD_UNCALIBRATED',
ORIENTATION = 'ORIENTATION',
AMBIENT_TEMPERATURE = 'AMBIENT_TEMPERATURE',
LIGHT = 'LIGHT',
PRESSURE = 'PRESSURE',
RELATIVE_HUMIDITY = 'RELATIVE_HUMIDITY',
TEMPERATURE = 'TEMPERATURE',
}
/**
* @name Sensors
* @description
* This plugin enables sensors on Android devices
*
* @usage
* ```typescript
* import { Sensors, TYPE_SENSOR } from '@ionic-native/sensors';
*
*
* constructor(private sensors: Sensors) { }
*
* ...
*
*
* this.sensors.enableSensor(TYPE_SENSOR.LIGHT);
*
* ```
*/
@Plugin({
pluginName: 'Sensors',
plugin: 'https://github.com/fabiorogeriosj/cordova-plugin-sensors.git',
pluginRef: 'sensors',
repo: 'https://github.com/fabiorogeriosj/cordova-plugin-sensors.git',
platforms: ['Android'],
})
@Injectable()
export class Sensors extends IonicNativePlugin {
/**
* This function enables the sensor
* @param {string} TYPE_SENSOR Specify the sensor to enable
* @return {Promise<any>} Returns a promise that resolves when something happens
*/
@Cordova()
enableSensor(TYPE_SENSOR: string): Promise<any> {
return;
}
/**
* This function disables the sensor
* @return {Promise<any>} Returns a promise that resolves when something happens
*/
@Cordova()
disableSensor(): Promise<any> {
return;
}
/**
* This function calls the success callback
* @return {Promise<any>} Returns sensor state
*/
@Cordova()
getState(): Promise<any> {
return;
}
}

View File

@ -3,8 +3,6 @@
"rules": {
"ordered-imports": false,
"no-empty": false,
"no-import-side-effect": false,
"rxjs-add": { "severity": "error" },
"rxjs-no-unused-add": { "severity": "error" }
"no-import-side-effect": false
}
}