From 94ac3ff149e85c4201b395a23270e280f5cc526e Mon Sep 17 00:00:00 2001 From: Daniel Sogl Date: Mon, 24 Sep 2018 18:47:23 +0200 Subject: [PATCH] refactor(haptic): add tuple types (#15651) --- core/src/utils/haptic.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/utils/haptic.ts b/core/src/utils/haptic.ts index 5c0853c355..95663d99d1 100644 --- a/core/src/utils/haptic.ts +++ b/core/src/utils/haptic.ts @@ -53,7 +53,7 @@ export function hapticSelectionEnd() { * Use this to indicate success/failure/warning to the user. * options should be of the type `{ type: 'success' }` (or `warning`/`error`) */ -export function hapticNotification(options: { type: string }) { +export function hapticNotification(options: { type: 'success' | 'warning' | 'error' }) { const engine = (window as any).TapticEngine; if (engine) { engine.notification(options); @@ -64,7 +64,7 @@ export function hapticNotification(options: { type: string }) { * Use this to indicate success/failure/warning to the user. * options should be of the type `{ style: 'light' }` (or `medium`/`heavy`) */ -export function hapticImpact(options: { style: string }) { +export function hapticImpact(options: { style: 'light' | 'medium' | 'heavy' }) { const engine = (window as any).TapticEngine; if (engine) { engine.impact(options);