From a6bcc9affd2248df68a17e323b3e1c4aad689492 Mon Sep 17 00:00:00 2001 From: Daniel Date: Tue, 18 Sep 2018 22:35:58 +0200 Subject: [PATCH] feat(taptic-engine): add missing functions and types --- .../plugins/taptic-engine/index.ts | 47 ++++++++++++++++--- 1 file changed, 40 insertions(+), 7 deletions(-) diff --git a/src/@ionic-native/plugins/taptic-engine/index.ts b/src/@ionic-native/plugins/taptic-engine/index.ts index 9c400f0bd..31e44d980 100644 --- a/src/@ionic-native/plugins/taptic-engine/index.ts +++ b/src/@ionic-native/plugins/taptic-engine/index.ts @@ -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 @@ -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} Returns a promise that resolves on success and rejects on error */ @Cordova() - selection(): Promise { return; } + selection(): Promise { + 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} Returns a promise that resolves on success and rejects on error */ @Cordova() - notification(options: { type: string }): Promise { return; } + notification(options: { + type: 'success' | 'warning' | 'error'; + }): Promise { + 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} Returns a promise that resolves on success and rejects on error */ @Cordova() - impact(options: { style: string }): Promise { return; } + impact(options: { style: 'light' | 'medium' | 'heavy' }): Promise { + return; + } + /** + * Tell the taptic engine that a gesture for a selection change is starting. + * @returns {Promise} + */ + @Cordova() + gestureSelectionStart(): Promise { + return; + } + + /** + * Tell the taptic engine that a selection changed during a gesture. + * @returns {Promise} + */ + @Cordova() + gestureSelectionChanged(): Promise { + return; + } + + /** + * Tell the taptic engine we are done with a gesture. This needs to be called lest resources are not properly recycled. + * @returns {Promise} + */ + @Cordova() + gestureSelectionEnd(): Promise { + return; + } }