1 | import { 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 | * constructor(haptic: Haptic){
|
15 | * haptic.selection();
|
16 | * }
|
17 | * }
|
18 | *
|
19 | * ```
|
20 | */
|
21 | export declare class Haptic {
|
22 | private _p;
|
23 | constructor(plt: Platform);
|
24 | /**
|
25 | * Check to see if the Haptic Plugin is available
|
26 | * @return {boolean} Returns true or false if the plugin is available
|
27 | *
|
28 | */
|
29 | available(): boolean;
|
30 | /**
|
31 | * Trigger a selection changed haptic event. Good for one-time events
|
32 | * (not for gestures)
|
33 | */
|
34 | selection(): void;
|
35 | /**
|
36 | * Tell the haptic engine that a gesture for a selection change is starting.
|
37 | */
|
38 | gestureSelectionStart(): void;
|
39 | /**
|
40 | * Tell the haptic engine that a selection changed during a gesture.
|
41 | */
|
42 | gestureSelectionChanged(): void;
|
43 | /**
|
44 | * Tell the haptic engine we are done with a gesture. This needs to be
|
45 | * called lest resources are not properly recycled.
|
46 | */
|
47 | gestureSelectionEnd(): void;
|
48 | /**
|
49 | * Use this to indicate success/failure/warning to the user.
|
50 | * options should be of the type `{ type: 'success' }` (or `warning`/`error`)
|
51 | */
|
52 | notification(options: {
|
53 | type: string;
|
54 | }): void;
|
55 | /**
|
56 | * Use this to indicate success/failure/warning to the user.
|
57 | * options should be of the type `{ style: 'light' }` (or `medium`/`heavy`)
|
58 | */
|
59 | impact(options: {
|
60 | style: string;
|
61 | }): void;
|
62 | }
|