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 | string
|
34 | |
35 |
|
36 |
|
37 |
|
38 | harmonyDirection?: 'row' | 'column' | 'flex'
|
39 | }
|
40 |
|
41 | export interface FormItemProps {
|
42 |
|
43 | name?: string
|
44 | }
|
45 |
|
46 | export interface EventProps<TouchEvent extends BaseTouchEvent<any> = ITouchEvent> {
|
47 |
|
48 | onTouchStart?: (event: TouchEvent) => void
|
49 |
|
50 |
|
51 | onTouchMove?: (event: TouchEvent) => void
|
52 |
|
53 |
|
54 | onTouchCancel?: (event: TouchEvent) => void
|
55 |
|
56 |
|
57 | onTouchEnd?: (event: TouchEvent) => void
|
58 |
|
59 |
|
60 | onClick?: (event: ITouchEvent) => void
|
61 |
|
62 |
|
63 | onLongPress?: (event: CommonEvent) => void
|
64 |
|
65 |
|
66 | onLongClick?: (event: CommonEvent) => void
|
67 |
|
68 |
|
69 | onTransitionEnd?: (event: CommonEvent) => void
|
70 |
|
71 |
|
72 | onAnimationStart?: (event: CommonEvent) => void
|
73 |
|
74 |
|
75 | onAnimationIteration?: (event: CommonEvent) => void
|
76 |
|
77 |
|
78 | onAnimationEnd?: (event: CommonEvent) => void
|
79 |
|
80 |
|
81 | onTouchForceChange?: (event: CommonEvent) => void
|
82 | }
|
83 |
|
84 | export type BaseEventOrigFunction<T> = (event: BaseEventOrig<T>) => void
|
85 |
|
86 | export type TouchEventFunction = (event: ITouchEvent) => void
|
87 |
|
88 | export type CanvasTouchEventFunction = (event: CanvasTouchEvent) => void
|
89 |
|
90 | export type CommonEvent<T = any> = BaseEventOrig<T>
|
91 |
|
92 | export type CommonEventFunction<T = any> = BaseEventOrigFunction<T>
|
93 |
|
94 | export interface BaseEventOrig<T = any> {
|
95 |
|
96 | type: string
|
97 |
|
98 |
|
99 | timeStamp: number
|
100 |
|
101 |
|
102 | target: Target
|
103 |
|
104 |
|
105 | currentTarget: currentTarget
|
106 |
|
107 |
|
108 | detail: T
|
109 |
|
110 |
|
111 | preventDefault: () => void
|
112 |
|
113 |
|
114 | stopPropagation: () => void
|
115 | }
|
116 |
|
117 | interface BaseTouchEvent<TouchDetail, T = any> extends BaseEventOrig<T> {
|
118 |
|
119 | touches: Array<TouchDetail>
|
120 |
|
121 |
|
122 | changedTouches: Array<TouchDetail>
|
123 | }
|
124 |
|
125 | export type CanvasTouchEvent = BaseTouchEvent<CanvasTouch, never>
|
126 |
|
127 | export type ITouchEvent = BaseTouchEvent<ITouch>
|
128 |
|
129 | export interface CanvasTouch {
|
130 | identifier: number
|
131 | x: number
|
132 | y: number
|
133 | }
|
134 |
|
135 | export interface ITouch extends Touch {
|
136 |
|
137 | identifier: number
|
138 |
|
139 | pageX: number
|
140 |
|
141 | pageY: number
|
142 |
|
143 | clientX: number
|
144 |
|
145 | clientY: number
|
146 | }
|
147 |
|
148 | export interface Target {
|
149 |
|
150 | id: string
|
151 |
|
152 | tagName: string
|
153 |
|
154 | dataset: {
|
155 | [key: string]: any
|
156 | }
|
157 | }
|
158 |
|
159 | export type currentTarget = Target
|
160 |
|
161 |
|
162 | export interface NetStatus {
|
163 |
|
164 | videoBitrate?: number
|
165 |
|
166 | audioBitrate?: number
|
167 |
|
168 | videoFPS?: number | string
|
169 |
|
170 | videoGOP?: number
|
171 |
|
172 | netSpeed?: number
|
173 |
|
174 | netJitter?: number
|
175 |
|
176 | videoWidth?: number | string
|
177 |
|
178 | videoHeight?: number | string
|
179 | }
|