1 | import type { View } from '../core/view';
|
2 |
|
3 | export * from './gestures-common';
|
4 | export * from './touch-manager';
|
5 |
|
6 |
|
7 |
|
8 |
|
9 | export class GesturesObserver {
|
10 | |
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 | constructor(target: View, callback: (args: GestureEventData) => void, context: any);
|
17 |
|
18 | /**
|
19 | * Registers a gesture observer to a view and gesture.
|
20 | * @param type - Type of the gesture.
|
21 | */
|
22 | observe(type: GestureTypes);
|
23 |
|
24 | /**
|
25 | * Disconnects the gesture observer.
|
26 | */
|
27 | disconnect();
|
28 |
|
29 | /**
|
30 | * Singular gesture type (e.g. GestureTypes.tap) attached to the observer.
|
31 | * Does not support plural gesture types (e.g.
|
32 | * GestureTypes.tap & GestureTypes.doubleTap).
|
33 | */
|
34 | type: GestureTypes;
|
35 |
|
36 | /**
|
37 | * A function that will be executed when a gesture is received.
|
38 | */
|
39 | callback: (args: GestureEventData) => void;
|
40 |
|
41 | /**
|
42 | * A context which will be used as `this` in callback execution.
|
43 | */
|
44 | context: any;
|
45 |
|
46 | /**
|
47 | * An internal Android specific method used to pass the motion event to the correct gesture observer.
|
48 | */
|
49 | androidOnTouchEvent: (motionEvent: any ) => void;
|
50 | }
|
51 |
|
52 | /**
|
53 | * A short-hand function that is used to create a gesture observer for a view and gesture.
|
54 | * @param target - View which will be watched for originating a specific gesture.
|
55 | * @param type - Type of the gesture.
|
56 | * @param callback - A function that will be executed when a gesture is received.
|
57 | * @param context - this argument for the callback.
|
58 | */
|
59 | export function observe(target: View, type: GestureTypes, callback: (args: GestureEventData) => void, context?: any): GesturesObserver;
|