2017-04-27 00:36:12 -04:00
|
|
|
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
2017-03-28 06:49:32 -04:00
|
|
|
import { Injectable } from '@angular/core';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @name Taptic Engine
|
|
|
|
* @description
|
|
|
|
* An Ionic plugin to use Taptic Engine API on iPHone 7, 7 Plus or newer.
|
|
|
|
*
|
|
|
|
* @usage
|
2017-04-30 20:36:22 +02:00
|
|
|
* ```typescript
|
2017-04-26 22:34:22 -06:00
|
|
|
* import { TapticEngine } from '@ionic-native/taptic-engine';
|
2017-03-28 06:49:32 -04:00
|
|
|
*
|
|
|
|
* ...
|
|
|
|
*
|
|
|
|
* constructor(private taptic: TapticEngine) { }
|
|
|
|
*
|
|
|
|
* ...
|
|
|
|
*
|
|
|
|
* this.taptic.selection();
|
|
|
|
*
|
|
|
|
* this.taptic.notification();
|
|
|
|
*
|
|
|
|
* this.taptic.impact();
|
|
|
|
*
|
|
|
|
* ```
|
|
|
|
*/
|
|
|
|
@Plugin({
|
|
|
|
pluginName: 'TapticEngine',
|
|
|
|
plugin: 'cordova-plugin-taptic-engine',
|
|
|
|
pluginRef: 'TapticEngine',
|
|
|
|
repo: 'https://github.com/EddyVerbruggen/cordova-plugin-taptic-engine',
|
|
|
|
platforms: ['iOS']
|
|
|
|
})
|
|
|
|
@Injectable()
|
2017-04-27 00:36:12 -04:00
|
|
|
export class TapticEngine extends IonicNativePlugin {
|
2017-03-28 06:49:32 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Use selection feedback generators to indicate a change in selection.
|
|
|
|
* @returns {Promise<any>} Returns a promise that resolves on success and rejects on error
|
|
|
|
*/
|
|
|
|
@Cordova()
|
|
|
|
selection(): Promise<any> { return; }
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Use this to indicate success/failure/warning to the user.
|
|
|
|
* @param options {Object} should be of the type { type: 'success' } (or 'warning'/'error')
|
|
|
|
* @param options.type {string}
|
|
|
|
* @returns {Promise<any>} Returns a promise that resolves on success and rejects on error
|
|
|
|
*/
|
|
|
|
@Cordova()
|
|
|
|
notification(options: { type: string }): Promise<any> { return; }
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Use this to indicate success/failure/warning to the user.
|
|
|
|
* @param options {Object} should be of the type { style: 'light' } (or 'medium'/'heavy')
|
|
|
|
* @param options.type {string}
|
|
|
|
* @returns {Promise<any>} Returns a promise that resolves on success and rejects on error
|
|
|
|
*/
|
|
|
|
@Cordova()
|
|
|
|
impact(options: { style: string }): Promise<any> { return; }
|
|
|
|
|
|
|
|
}
|