Skip to content

Commit

Permalink
feat(taptic-engine): add taptic engine plugin support (#1271)
Browse files Browse the repository at this point in the history
* Added taptic plugin. #571

* docs(taptic): improve docs

* update to v3
  • Loading branch information
ihadeed committed Mar 28, 2017
1 parent f911366 commit ffa37e2
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions src/@ionic-native/plugins/taptic-engine/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import { Cordova, Plugin } from '@ionic-native/core';
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
* ```ts
* import { TapticEngine } from '@ionic-native/taptic-engine;
*
* ...
*
* 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()
export class TapticEngine {

/**
* 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; }

}

0 comments on commit ffa37e2

Please sign in to comment.