1 | import { CSSProperties, LegacyRef, ReactNode } from 'react'
|
2 |
|
3 | export interface StandardProps<T = any, TouchEvent extends BaseTouchEvent<any> = ITouchEvent> extends EventProps<TouchEvent> {
|
4 |
|
5 | id?: string
|
6 |
|
7 | className?: string
|
8 |
|
9 | style?: string | CSSProperties
|
10 |
|
11 | children?: ReactNode
|
12 | |
13 |
|
14 |
|
15 | key?: string | number
|
16 |
|
17 | hidden?: boolean
|
18 |
|
19 | animation?: { actions: TaroGeneral.IAnyObject[] } | TaroGeneral.IAnyObject
|
20 |
|
21 | ref?: LegacyRef<T>
|
22 | |
23 |
|
24 |
|
25 |
|
26 | dangerouslySetInnerHTML?: {
|
27 | __html: string
|
28 | }
|
29 | |
30 |
|
31 |
|
32 |
|
33 | compileMode?: boolean
|
34 | }
|
35 |
|
36 | export interface FormItemProps {
|
37 |
|
38 | name?: string
|
39 | }
|
40 |
|
41 | export interface EventProps<TouchEvent extends BaseTouchEvent<any> = ITouchEvent> {
|
42 |
|
43 | onTouchStart?: (event: TouchEvent) => void
|
44 |
|
45 |
|
46 | onTouchMove?: (event: TouchEvent) => void
|
47 |
|
48 |
|
49 | onTouchCancel?: (event: TouchEvent) => void
|
50 |
|
51 |
|
52 | onTouchEnd?: (event: TouchEvent) => void
|
53 |
|
54 |
|
55 | onClick?: (event: ITouchEvent) => void
|
56 |
|
57 |
|
58 | onLongPress?: (event: CommonEvent) => void
|
59 |
|
60 |
|
61 | onLongClick?: (event: CommonEvent) => void
|
62 |
|
63 |
|
64 | onTransitionEnd?: (event: CommonEvent) => void
|
65 |
|
66 |
|
67 | onAnimationStart?: (event: CommonEvent) => void
|
68 |
|
69 |
|
70 | onAnimationIteration?: (event: CommonEvent) => void
|
71 |
|
72 |
|
73 | onAnimationEnd?: (event: CommonEvent) => void
|
74 |
|
75 |
|
76 | onTouchForceChange?: (event: CommonEvent) => void
|
77 | }
|
78 |
|
79 | export type BaseEventOrigFunction<T> = (event: BaseEventOrig<T>) => void
|
80 |
|
81 | export type TouchEventFunction = (event: ITouchEvent) => void
|
82 |
|
83 | export type CanvasTouchEventFunction = (event: CanvasTouchEvent) => void
|
84 |
|
85 | export type CommonEvent<T = any> = BaseEventOrig<T>
|
86 |
|
87 | export type CommonEventFunction<T = any> = BaseEventOrigFunction<T>
|
88 |
|
89 | export interface BaseEventOrig<T = any> {
|
90 |
|
91 | type: string
|
92 |
|
93 |
|
94 | timeStamp: number
|
95 |
|
96 |
|
97 | target: Target
|
98 |
|
99 |
|
100 | currentTarget: currentTarget
|
101 |
|
102 |
|
103 | detail: T
|
104 |
|
105 |
|
106 | preventDefault: () => void
|
107 |
|
108 |
|
109 | stopPropagation: () => void
|
110 | }
|
111 |
|
112 | interface BaseTouchEvent<TouchDetail, T = any> extends BaseEventOrig<T> {
|
113 |
|
114 | touches: Array<TouchDetail>
|
115 |
|
116 |
|
117 | changedTouches: Array<TouchDetail>
|
118 | }
|
119 |
|
120 | export type CanvasTouchEvent = BaseTouchEvent<CanvasTouch, never>
|
121 |
|
122 | export type ITouchEvent = BaseTouchEvent<ITouch>
|
123 |
|
124 | export interface CanvasTouch {
|
125 | identifier: number
|
126 | x: number
|
127 | y: number
|
128 | }
|
129 |
|
130 | export interface ITouch extends Touch {
|
131 |
|
132 | identifier: number
|
133 |
|
134 | pageX: number
|
135 |
|
136 | pageY: number
|
137 |
|
138 | clientX: number
|
139 |
|
140 | clientY: number
|
141 | }
|
142 |
|
143 | export interface Target {
|
144 |
|
145 | id: string
|
146 |
|
147 | tagName: string
|
148 |
|
149 | dataset: {
|
150 | [key: string]: any
|
151 | }
|
152 | }
|
153 |
|
154 | export type currentTarget = Target
|
155 |
|
156 |
|
157 | export interface NetStatus {
|
158 |
|
159 | videoBitrate?: number
|
160 |
|
161 | audioBitrate?: number
|
162 |
|
163 | videoFPS?: number | string
|
164 |
|
165 | videoGOP?: number
|
166 |
|
167 | netSpeed?: number
|
168 |
|
169 | netJitter?: number
|
170 |
|
171 | videoWidth?: number | string
|
172 |
|
173 | videoHeight?: number | string
|
174 | }
|