Skip to content

Commit

Permalink
feat(taptic-engine): add missing functions and types
Browse files Browse the repository at this point in the history
  • Loading branch information
danielsogl committed Sep 18, 2018
1 parent c0d8c99 commit a6bcc9a
Showing 1 changed file with 40 additions and 7 deletions.
47 changes: 40 additions & 7 deletions src/@ionic-native/plugins/taptic-engine/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';

/**
* @name Taptic Engine
Expand Down Expand Up @@ -33,30 +33,63 @@ import { Injectable } from '@angular/core';
})
@Injectable()
export class TapticEngine extends IonicNativePlugin {

/**
* 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; }
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}
* @param {'success' | 'warning' | 'error'} options.type
* @returns {Promise<any>} Returns a promise that resolves on success and rejects on error
*/
@Cordova()
notification(options: { type: string }): Promise<any> { return; }
notification(options: {
type: 'success' | 'warning' | 'error';
}): 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}
* @param {'light' | 'medium' | 'heavy'} options.type
* @returns {Promise<any>} Returns a promise that resolves on success and rejects on error
*/
@Cordova()
impact(options: { style: string }): Promise<any> { return; }
impact(options: { style: 'light' | 'medium' | 'heavy' }): Promise<any> {
return;
}

/**
* Tell the taptic engine that a gesture for a selection change is starting.
* @returns {Promise<any>}
*/
@Cordova()
gestureSelectionStart(): Promise<any> {
return;
}

/**
* Tell the taptic engine that a selection changed during a gesture.
* @returns {Promise<any>}
*/
@Cordova()
gestureSelectionChanged(): Promise<any> {
return;
}

/**
* Tell the taptic engine we are done with a gesture. This needs to be called lest resources are not properly recycled.
* @returns {Promise<any>}
*/
@Cordova()
gestureSelectionEnd(): Promise<any> {
return;
}
}

0 comments on commit a6bcc9a

Please sign in to comment.