UNPKG

1.76 kBTypeScriptView Raw
1import { Platform } from '../platform/platform';
2/**
3 * @name Haptic
4 * @description
5 * The `Haptic` class interacts with a haptic engine on the device, if
6 * available. Generally, Ionic components use this under the hood, but you're
7 * welcome to get a bit crazy with it if you fancy.
8 *
9 * Currently, this uses the Taptic engine on iOS.
10 *
11 * @usage
12 * ```ts
13 * export class MyClass {
14 *
15 * constructor(haptic: Haptic) {
16 * haptic.selection();
17 * }
18 * }
19 *
20 * ```
21 */
22export declare class Haptic {
23 private _p;
24 constructor(plt: Platform);
25 /**
26 * Check to see if the Haptic Plugin is available
27 * @return {boolean} Returns true or false if the plugin is available
28 *
29 */
30 available(): boolean;
31 /**
32 * Trigger a selection changed haptic event. Good for one-time events
33 * (not for gestures)
34 */
35 selection(): void;
36 /**
37 * Tell the haptic engine that a gesture for a selection change is starting.
38 */
39 gestureSelectionStart(): void;
40 /**
41 * Tell the haptic engine that a selection changed during a gesture.
42 */
43 gestureSelectionChanged(): void;
44 /**
45 * Tell the haptic engine we are done with a gesture. This needs to be
46 * called lest resources are not properly recycled.
47 */
48 gestureSelectionEnd(): void;
49 /**
50 * Use this to indicate success/failure/warning to the user.
51 * options should be of the type `{ type: 'success' }` (or `warning`/`error`)
52 */
53 notification(options: {
54 type: string;
55 }): void;
56 /**
57 * Use this to indicate success/failure/warning to the user.
58 * options should be of the type `{ style: 'light' }` (or `medium`/`heavy`)
59 */
60 impact(options: {
61 style: string;
62 }): void;
63}