@predy-js/render-interface 0.3.4-beta.15 → 0.3.4-beta.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +47 -25
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +48 -26
- package/dist/index.mjs.map +1 -1
- package/dist/src/render/event/RNHandler.d.ts +1 -0
- package/dist/statistic.js +1 -1
- package/dist/types/EventSystem.d.ts +11 -6
- package/package.json +1 -1
- package/types/EventSystem.ts +14 -7
package/dist/statistic.js
CHANGED
@@ -21,26 +21,31 @@ export declare const EVENT_TYPE_TOUCH_START = "touchstart";
|
|
21
21
|
export declare const EVENT_TYPE_TOUCH_MOVE = "touchmove";
|
22
22
|
export declare const EVENT_TYPE_TOUCH_END = "touchend";
|
23
23
|
export declare const EVENT_TYPE_TOUCH_CANCEL = "touchcancel";
|
24
|
+
export declare enum PredyNativeEventType {
|
25
|
+
touchstart = 1,
|
26
|
+
touchmove = 2,
|
27
|
+
touchend = 3
|
28
|
+
}
|
24
29
|
export type BASE_EVENT_TYPE = 'touchstart' | 'touchmove' | 'touchend' | 'touchcancel';
|
25
30
|
export type PredyTouch = {
|
26
31
|
id: number;
|
27
32
|
x: number;
|
28
33
|
y: number;
|
29
|
-
clientX: number;
|
30
|
-
clientY: number;
|
31
|
-
force: number;
|
32
34
|
ts: number;
|
35
|
+
layout: {
|
36
|
+
width: number;
|
37
|
+
height: number;
|
38
|
+
};
|
33
39
|
};
|
34
40
|
export type PredyTouchEventArg = {
|
35
41
|
type: BASE_EVENT_TYPE;
|
36
42
|
timestamp: number;
|
37
|
-
target: EventTarget | null;
|
38
43
|
touches: Array<PredyTouch>;
|
39
|
-
changedTouches
|
44
|
+
changedTouches?: Array<PredyTouch>;
|
40
45
|
velocity?: vec2;
|
41
46
|
preventDefault: Function;
|
42
47
|
stopPropagation: Function;
|
43
|
-
nativeEvent
|
48
|
+
nativeEvent?: any;
|
44
49
|
};
|
45
50
|
export type EventHandlerFunction = (e: PredyTouchEventArg) => void;
|
46
51
|
/**
|
package/package.json
CHANGED
package/types/EventSystem.ts
CHANGED
@@ -24,6 +24,12 @@ export const EVENT_TYPE_TOUCH_MOVE = 'touchmove';
|
|
24
24
|
export const EVENT_TYPE_TOUCH_END = 'touchend';
|
25
25
|
export const EVENT_TYPE_TOUCH_CANCEL = 'touchcancel';
|
26
26
|
|
27
|
+
export enum PredyNativeEventType {
|
28
|
+
touchstart = 1,
|
29
|
+
touchmove = 2,
|
30
|
+
touchend = 3,
|
31
|
+
}
|
32
|
+
|
27
33
|
// export type PredyTouchEventArg = {
|
28
34
|
// x: number,
|
29
35
|
// y: number,
|
@@ -41,24 +47,25 @@ export type BASE_EVENT_TYPE = 'touchstart' | 'touchmove' | 'touchend' | 'touchca
|
|
41
47
|
|
42
48
|
export type PredyTouch = {
|
43
49
|
id: number,
|
44
|
-
x: number,
|
50
|
+
x: number, // 物理坐标
|
45
51
|
y: number,
|
46
|
-
clientX: number, // 物理坐标
|
47
|
-
clientY: number,
|
48
|
-
force: number,
|
49
52
|
ts: number,
|
53
|
+
layout: {
|
54
|
+
width: number,
|
55
|
+
height: number,
|
56
|
+
},
|
50
57
|
};
|
51
58
|
|
52
59
|
export type PredyTouchEventArg = {
|
53
60
|
type: BASE_EVENT_TYPE,
|
54
61
|
timestamp: number,
|
55
|
-
target: EventTarget | null,
|
62
|
+
// target: EventTarget | null,
|
56
63
|
touches: Array<PredyTouch>,
|
57
|
-
changedTouches
|
64
|
+
changedTouches?: Array<PredyTouch>,
|
58
65
|
velocity?: vec2,
|
59
66
|
preventDefault: Function,
|
60
67
|
stopPropagation: Function,
|
61
|
-
nativeEvent
|
68
|
+
nativeEvent?: any,
|
62
69
|
};
|
63
70
|
|
64
71
|
export type EventHandlerFunction = (e: PredyTouchEventArg) => void;
|