UNPKG

6.53 kBTypeScriptView Raw
1import { StylusData } from '../web/interfaces';
2export type FlingGestureHandlerEventPayload = {
3 x: number;
4 y: number;
5 absoluteX: number;
6 absoluteY: number;
7};
8export type ForceTouchGestureHandlerEventPayload = {
9 x: number;
10 y: number;
11 absoluteX: number;
12 absoluteY: number;
13 /**
14 * The pressure of a touch.
15 */
16 force: number;
17};
18export type LongPressGestureHandlerEventPayload = {
19 /**
20 * X coordinate, expressed in points, of the current position of the pointer
21 * (finger or a leading pointer when there are multiple fingers placed)
22 * relative to the view attached to the handler.
23 */
24 x: number;
25 /**
26 * Y coordinate, expressed in points, of the current position of the pointer
27 * (finger or a leading pointer when there are multiple fingers placed)
28 * relative to the view attached to the handler.
29 */
30 y: number;
31 /**
32 * X coordinate, expressed in points, of the current position of the pointer
33 * (finger or a leading pointer when there are multiple fingers placed)
34 * relative to the window. It is recommended to use `absoluteX` instead of
35 * `x` in cases when the view attached to the handler can be transformed as an
36 * effect of the gesture.
37 */
38 absoluteX: number;
39 /**
40 * Y coordinate, expressed in points, of the current position of the pointer
41 * (finger or a leading pointer when there are multiple fingers placed)
42 * relative to the window. It is recommended to use `absoluteY` instead of
43 * `y` in cases when the view attached to the handler can be transformed as an
44 * effect of the gesture.
45 */
46 absoluteY: number;
47 /**
48 * Duration of the long press (time since the start of the event), expressed
49 * in milliseconds.
50 */
51 duration: number;
52};
53export type NativeViewGestureHandlerPayload = {
54 /**
55 * True if gesture was performed inside of containing view, false otherwise.
56 */
57 pointerInside: boolean;
58};
59export type PanGestureHandlerEventPayload = {
60 /**
61 * X coordinate of the current position of the pointer (finger or a leading
62 * pointer when there are multiple fingers placed) relative to the view
63 * attached to the handler. Expressed in point units.
64 */
65 x: number;
66 /**
67 * Y coordinate of the current position of the pointer (finger or a leading
68 * pointer when there are multiple fingers placed) relative to the view
69 * attached to the handler. Expressed in point units.
70 */
71 y: number;
72 /**
73 * X coordinate of the current position of the pointer (finger or a leading
74 * pointer when there are multiple fingers placed) relative to the window.
75 * The value is expressed in point units. It is recommended to use it instead
76 * of `x` in cases when the original view can be transformed as an effect of
77 * the gesture.
78 */
79 absoluteX: number;
80 /**
81 * Y coordinate of the current position of the pointer (finger or a leading
82 * pointer when there are multiple fingers placed) relative to the window.
83 * The value is expressed in point units. It is recommended to use it instead
84 * of `y` in cases when the original view can be transformed as an
85 * effect of the gesture.
86 */
87 absoluteY: number;
88 /**
89 * Translation of the pan gesture along X axis accumulated over the time of
90 * the gesture. The value is expressed in the point units.
91 */
92 translationX: number;
93 /**
94 * Translation of the pan gesture along Y axis accumulated over the time of
95 * the gesture. The value is expressed in the point units.
96 */
97 translationY: number;
98 /**
99 * Velocity of the pan gesture along the X axis in the current moment. The
100 * value is expressed in point units per second.
101 */
102 velocityX: number;
103 /**
104 * Velocity of the pan gesture along the Y axis in the current moment. The
105 * value is expressed in point units per second.
106 */
107 velocityY: number;
108 /**
109 * Object containing additional stylus data.
110 */
111 stylusData: StylusData | undefined;
112};
113export type PinchGestureHandlerEventPayload = {
114 /**
115 * The scale factor relative to the points of the two touches in screen
116 * coordinates.
117 */
118 scale: number;
119 /**
120 * Position expressed in points along X axis of center anchor point of
121 * gesture.
122 */
123 focalX: number;
124 /**
125 * Position expressed in points along Y axis of center anchor point of
126 * gesture.
127 */
128 focalY: number;
129 /**
130 *
131 * Velocity of the pan gesture the current moment. The value is expressed in
132 * point units per second.
133 */
134 velocity: number;
135};
136export type TapGestureHandlerEventPayload = {
137 x: number;
138 y: number;
139 absoluteX: number;
140 absoluteY: number;
141};
142export type RotationGestureHandlerEventPayload = {
143 /**
144 * Amount rotated, expressed in radians, from the gesture's focal point
145 * (anchor).
146 */
147 rotation: number;
148 /**
149 * X coordinate, expressed in points, of the gesture's central focal point
150 * (anchor).
151 */
152 anchorX: number;
153 /**
154 * Y coordinate, expressed in points, of the gesture's central focal point
155 * (anchor).
156 */
157 anchorY: number;
158 /**
159 *
160 * Instantaneous velocity, expressed in point units per second, of the
161 * gesture.
162 */
163 velocity: number;
164};
165export type HoverGestureHandlerEventPayload = {
166 /**
167 * X coordinate of the current position of the pointer relative to the view
168 * attached to the handler. Expressed in point units.
169 */
170 x: number;
171 /**
172 * Y coordinate of the current position of the pointer relative to the view
173 * attached to the handler. Expressed in point units.
174 */
175 y: number;
176 /**
177 * X coordinate of the current position of the pointer relative to the window.
178 * The value is expressed in point units. It is recommended to use it instead
179 * of `x` in cases when the original view can be transformed as an
180 * effect of the gesture.
181 */
182 absoluteX: number;
183 /**
184 * Y coordinate of the current position of the pointer relative to the window.
185 * The value is expressed in point units. It is recommended to use it instead
186 * of `y` in cases when the original view can be transformed as an
187 * effect of the gesture.
188 */
189 absoluteY: number;
190 /**
191 * Object containing additional stylus data.
192 */
193 stylusData: StylusData | undefined;
194};