|
1 |
| -# @any-touch/share |
2 |
| -一些公用方法和常量. |
| 1 | +# @any-touch/shared |
| 2 | +在这里可以找到状态马 |
3 | 3 |
|
4 | 4 | ```javascript
|
5 |
| -// input的类型 |
6 |
| -export const TYPE_START = 'start'; |
7 |
| -export const TYPE_MOVE = 'move'; |
8 |
| -export const TYPE_CANCEL = 'cancel'; |
9 |
| -export const TYPE_END = 'end'; |
10 |
| - |
11 |
| -export const TOUCH = 'touch'; |
12 |
| -export const MOUSE = 'mouse'; |
13 |
| - |
14 |
| -export const TOUCH_START = 'touchstart'; |
15 |
| -export const TOUCH_MOVE = 'touchmove'; |
16 |
| -export const TOUCH_END = 'touchend'; |
17 |
| -export const TOUCH_CANCEL = 'touchcancel'; |
18 |
| - |
19 |
| -export const MOUSE_UP = 'mouseup'; |
20 |
| -export const MOUSE_MOVE = 'mousemove'; |
21 |
| -export const MOUSE_DOWN = 'mousedown'; |
22 |
| - |
23 |
| -// 计算时候取touchs.clientX | clientY |
24 |
| -export const CLIENT_X = 'clientX'; |
25 |
| -export const CLIENT_Y = 'clientY'; |
26 |
| - |
27 |
| -export const COMPUTE_INTERVAL = 16; |
28 |
| - |
29 |
| -// 识别器状态码 |
30 |
| -// 注意: 此处的值会直接被事件名所用, 如panstart/panmove等等 |
| 5 | +// shared内部代码 |
31 | 6 | export const STATUS_POSSIBLE = 'possible';
|
32 | 7 | export const STATUS_START = 'start';
|
33 | 8 | export const STATUS_MOVE = 'move';
|
34 | 9 | export const STATUS_END = 'end';
|
35 | 10 | export const STATUS_CANCELLED = 'cancel';
|
36 | 11 | export const STATUS_FAILED = 'failed';
|
37 | 12 | export const STATUS_RECOGNIZED = 'recognized';
|
38 |
| - |
39 |
| - |
40 |
| -// 方向 |
41 |
| -export const DIRECTION_LEFT = 'left'; |
42 |
| -export const DIRECTION_RIGHT = 'right'; |
43 |
| -export const DIRECTION_UP = 'up'; |
44 |
| -export const DIRECTION_DOWN = 'down'; |
45 |
| -export const NONE = 'none'; |
46 |
| - |
47 | 13 | ```
|
0 commit comments