@react-native-ohos/react-native-bindingx 1.0.4-rc.1
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/LICENSE.md +13 -0
- package/README.OpenSource +11 -0
- package/README.md +14 -0
- package/harmony/bindingx/BuildProfile.ets +5 -0
- package/harmony/bindingx/build-profile.json5 +9 -0
- package/harmony/bindingx/hvigorfile.ts +2 -0
- package/harmony/bindingx/index.ets +25 -0
- package/harmony/bindingx/oh-package.json5 +12 -0
- package/harmony/bindingx/src/main/cpp/CMakeLists.txt +8 -0
- package/harmony/bindingx/src/main/cpp/ExpressHandleEval.cpp +176 -0
- package/harmony/bindingx/src/main/cpp/ExpressHandleEval.h +51 -0
- package/harmony/bindingx/src/main/cpp/ReactBindingXModule.cpp +42 -0
- package/harmony/bindingx/src/main/cpp/ReactBindingXModule.h +38 -0
- package/harmony/bindingx/src/main/cpp/ReactBindingXPackage.cpp +53 -0
- package/harmony/bindingx/src/main/cpp/ReactBindingXPackage.h +37 -0
- package/harmony/bindingx/src/main/cpp/ReactBindingxArkTSMessageHandler.cpp +563 -0
- package/harmony/bindingx/src/main/cpp/ReactBindingxArkTSMessageHandler.h +78 -0
- package/harmony/bindingx/src/main/ets/BindingXCore.ts +477 -0
- package/harmony/bindingx/src/main/ets/BindingXParamBean.ts +37 -0
- package/harmony/bindingx/src/main/ets/IRNViewUpdater.ts +45 -0
- package/harmony/bindingx/src/main/ets/ReactBindingXModule.ts +71 -0
- package/harmony/bindingx/src/main/ets/ReactBindingXPackage.ts +46 -0
- package/harmony/bindingx/src/main/ets/TimingFunctions.ts +281 -0
- package/harmony/bindingx/src/main/ets/TimingFunctionsType.ts +58 -0
- package/harmony/bindingx/src/main/ets/TimingFunctionsTypeHandler.ts +128 -0
- package/harmony/bindingx/src/main/module.json5 +7 -0
- package/harmony/bindingx/src/main/resources/base/element/color.json +8 -0
- package/harmony/bindingx/src/main/resources/base/element/string.json +16 -0
- package/harmony/bindingx/src/main/resources/base/media/icon.png +0 -0
- package/harmony/bindingx/src/main/resources/base/profile/main_pages.json +5 -0
- package/harmony/bindingx/src/main/resources/en_US/element/string.json +16 -0
- package/harmony/bindingx/src/main/resources/zh_CN/element/string.json +16 -0
- package/harmony/bindingx/ts.ts +26 -0
- package/harmony/bindingx.har +0 -0
- package/lib/index.js +3 -0
- package/lib/specs/NativeReactBindingXModule.ts +12 -0
- package/lib/src/bindingx.js +131 -0
- package/package.json +27 -0
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MIT License
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2024 Huawei Device Co., Ltd.
|
|
5
|
+
*
|
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
* furnished to do so, subject to the following conditions:
|
|
12
|
+
*
|
|
13
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
* copies or substantial portions of the Software.
|
|
15
|
+
*
|
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
* SOFTWARE.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
export class TimingFunctions {
|
|
26
|
+
public static linear(t: number, b: number, c: number, d: number): number {
|
|
27
|
+
t = Math.min(t, d);
|
|
28
|
+
return c * (t / d) + b;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
public static easeOutElastic(t: number, b: number, c: number, d: number): number {
|
|
33
|
+
t = Math.min(t, d);
|
|
34
|
+
let s = 0;
|
|
35
|
+
let p = 0;
|
|
36
|
+
let a = c;
|
|
37
|
+
p = d * .3;
|
|
38
|
+
if (a < Math.abs(c)) {
|
|
39
|
+
a = c;
|
|
40
|
+
s = p / 4;
|
|
41
|
+
} else {
|
|
42
|
+
s = p / (2 * Math.PI) * Math.asin(c / a);
|
|
43
|
+
}
|
|
44
|
+
return a * Math.pow(2, -10 * t) * Math.sin((t * d - s) * (2 * Math.PI) / p) + c + b;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
public static easeInQuad(t: number, b: number, c: number, d: number): number {
|
|
48
|
+
t = Math.min(t, d);
|
|
49
|
+
return c * (t /= d) * t + b;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
public static easeOutQuad(t: number, b: number, c: number, d: number): number {
|
|
53
|
+
t = Math.min(t, d);
|
|
54
|
+
return -c * (t /= d) * (t - 2) + b;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
public static easeInOutQuad(t: number, b: number, c: number, d: number): number {
|
|
58
|
+
t = Math.min(t, d);
|
|
59
|
+
if ((t /= d / 2) < 1) {
|
|
60
|
+
return c / 2 * t * t + b;
|
|
61
|
+
}
|
|
62
|
+
return -c / 2 * ((--t) * (t - 2) - 1) + b;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
public static easeInCubic(t: number, b: number, c: number, d: number): number {
|
|
66
|
+
t = Math.min(t, d);
|
|
67
|
+
return c * (t /= d) * t * t + b;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
public static easeOutCubic(t: number, b: number, c: number, d: number): number {
|
|
71
|
+
t = Math.min(t, d);
|
|
72
|
+
return c * ((t = t / d - 1) * t * t + 1) + b;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
public static easeInOutCubic(t: number, b: number, c: number, d: number): number {
|
|
76
|
+
t = Math.min(t, d);
|
|
77
|
+
if ((t /= d / 2) < 1) {
|
|
78
|
+
return c / 2 * t * t * t + b;
|
|
79
|
+
}
|
|
80
|
+
return c / 2 * ((t -= 2) * t * t + 2) + b;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
public static easeInQuart(t: number, b: number, c: number, d: number): number {
|
|
84
|
+
t = Math.min(t, d);
|
|
85
|
+
return c * (t /= d) * t * t * t + b;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
public static easeOutQuart(t: number, b: number, c: number, d: number): number {
|
|
89
|
+
t = Math.min(t, d);
|
|
90
|
+
return -c * ((t = t / d - 1) * t * t * t - 1) + b;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
public static easeInOutQuart(t: number, b: number, c: number, d: number): number {
|
|
94
|
+
t = Math.min(t, d);
|
|
95
|
+
if ((t /= d / 2) < 1) {
|
|
96
|
+
return c / 2 * t * t * t * t + b;
|
|
97
|
+
}
|
|
98
|
+
return -c / 2 * ((t -= 2) * t * t * t - 2) + b;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
public static easeInQuint(t: number, b: number, c: number, d: number): number {
|
|
102
|
+
t = Math.min(t, d);
|
|
103
|
+
return c * (t /= d) * t * t * t * t + b;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
public static easeOutQuint(t: number, b: number, c: number, d: number): number {
|
|
107
|
+
t = Math.min(t, d);
|
|
108
|
+
return c * ((t = t / d - 1) * t * t * t * t + 1) + b;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
public static easeInOutQuint(t: number, b: number, c: number, d: number): number {
|
|
112
|
+
t = Math.min(t, d);
|
|
113
|
+
if ((t /= d / 2) < 1) {
|
|
114
|
+
return c / 2 * t * t * t * t * t + b;
|
|
115
|
+
}
|
|
116
|
+
return c / 2 * ((t -= 2) * t * t * t * t + 2) + b;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
public static easeInSine(t: number, b: number, c: number, d: number): number {
|
|
120
|
+
t = Math.min(t, d);
|
|
121
|
+
return -c * Math.cos(t / d * (Math.PI / 2)) + c + b;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
public static easeOutSine(t: number, b: number, c: number, d: number): number {
|
|
126
|
+
t = Math.min(t, d);
|
|
127
|
+
if ((t /= d / 2) < 1) {
|
|
128
|
+
return c / 2 * t * t * t * t * t + b;
|
|
129
|
+
}
|
|
130
|
+
return c / 2 * ((t -= 2) * t * t * t * t + 2) + b;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
public static easeInExpo(t: number, b: number, c: number, d: number): number {
|
|
134
|
+
t = Math.min(t, d);
|
|
135
|
+
return (t == 0) ? b : c * Math.pow(2, 10 * (t / d - 1)) + b;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
public static easeOutExpo(t: number, b: number, c: number, d: number): number {
|
|
139
|
+
t = Math.min(t, d);
|
|
140
|
+
return (t == d) ? b + c : c * (-Math.pow(2, -10 * t / d) + 1) + b;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
public static easeInOutExpo(t: number, b: number, c: number, d: number): number {
|
|
144
|
+
t = Math.min(t, d);
|
|
145
|
+
if (t == 0) {
|
|
146
|
+
return b;
|
|
147
|
+
}
|
|
148
|
+
if (t == d) {
|
|
149
|
+
return b + c;
|
|
150
|
+
}
|
|
151
|
+
if ((t /= d / 2) < 1) {
|
|
152
|
+
return c / 2 * Math.pow(2, 10 * (t - 1)) + b;
|
|
153
|
+
}
|
|
154
|
+
return c / 2 * (-Math.pow(2, -10 * --t) + 2) + b;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
public static easeInCirc(t: number, b: number, c: number, d: number): number {
|
|
158
|
+
t = Math.min(t, d);
|
|
159
|
+
return -c * (Math.sqrt(1 - (t /= d) * t) - 1) + b;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
public static easeOutCirc(t: number, b: number, c: number, d: number): number {
|
|
163
|
+
t = Math.min(t, d);
|
|
164
|
+
return c * Math.sqrt(1 - (t = t / d - 1) * t) + b;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
public static easeInOutCirc(t: number, b: number, c: number, d: number): number {
|
|
168
|
+
t = Math.min(t, d);
|
|
169
|
+
if ((t /= d / 2) < 1) {
|
|
170
|
+
return -c / 2 * (Math.sqrt(1 - t * t) - 1) + b;
|
|
171
|
+
}
|
|
172
|
+
return c / 2 * (Math.sqrt(1 - (t -= 2) * t) + 1) + b;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
public static easeInElastic(t: number, b: number, c: number, d: number): number {
|
|
176
|
+
t = Math.min(t, d);
|
|
177
|
+
let s;
|
|
178
|
+
let p;
|
|
179
|
+
let a = c;
|
|
180
|
+
if (t == 0) {
|
|
181
|
+
return b;
|
|
182
|
+
}
|
|
183
|
+
if ((t /= d) == 1) {
|
|
184
|
+
return b + c;
|
|
185
|
+
}
|
|
186
|
+
p = d * .3;
|
|
187
|
+
if (a < Math.abs(c)) {
|
|
188
|
+
a = c;
|
|
189
|
+
s = p / 4;
|
|
190
|
+
} else {
|
|
191
|
+
s = p / (2 * Math.PI) * Math.asin(c / a);
|
|
192
|
+
}
|
|
193
|
+
return -(a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
public static easeInOutElastic(t: number, b: number, c: number, d: number): number {
|
|
197
|
+
t = Math.min(t, d);
|
|
198
|
+
|
|
199
|
+
let s;
|
|
200
|
+
let p;
|
|
201
|
+
let a = c;
|
|
202
|
+
if (t == 0) {
|
|
203
|
+
return b;
|
|
204
|
+
}
|
|
205
|
+
if ((t /= d / 2) == 2) {
|
|
206
|
+
return b + c;
|
|
207
|
+
}
|
|
208
|
+
p = d * (.3 * 1.5);
|
|
209
|
+
if (a < Math.abs(c)) {
|
|
210
|
+
a = c;
|
|
211
|
+
s = p / 4;
|
|
212
|
+
} else {
|
|
213
|
+
s = p / (2 * Math.PI) * Math.asin(c / a);
|
|
214
|
+
}
|
|
215
|
+
if (t < 1) {
|
|
216
|
+
return -.5 * (a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b;
|
|
217
|
+
}
|
|
218
|
+
return a * Math.pow(2, -10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p) * .5 + c + b;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
public static easeInBack(t: number, b: number, c: number, d: number): number {
|
|
222
|
+
t = Math.min(t, d);
|
|
223
|
+
let s = 1.70158;
|
|
224
|
+
return c * (t /= d) * t * ((s + 1) * t - s) + b;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
public static easeOutBack(t: number, b: number, c: number, d: number): number {
|
|
228
|
+
t = Math.min(t, d);
|
|
229
|
+
let s = 1.70158;
|
|
230
|
+
return c * ((t = t / d - 1) * t * ((s + 1) * t + s) + 1) + b;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
public static easeInOutBack(t: number, b: number, c: number, d: number): number {
|
|
234
|
+
t = Math.min(t, d);
|
|
235
|
+
let s = 1.70158;
|
|
236
|
+
if ((t /= d / 2) < 1) {
|
|
237
|
+
return c / 2 * (t * t * (((s *= (1.525)) + 1) * t - s)) + b;
|
|
238
|
+
}
|
|
239
|
+
return c / 2 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2) + b;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
public static easeInBounce(t: number, b: number, c: number, d: number): number {
|
|
243
|
+
t = Math.min(t, d);
|
|
244
|
+
return TimingFunctions.easeInBounce1(t, b, c, d);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
public static easeOutBounce(t: number, b: number, c: number, d: number): number {
|
|
248
|
+
t = Math.min(t, d);
|
|
249
|
+
return TimingFunctions.easeOutBounce1(t, b, c, d);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
public static easeInBounce1(t: number, b: number, c: number, d: number): number {
|
|
254
|
+
return c - TimingFunctions.easeOutBounce1(d - t, 0, c, d) + b;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
public static easeOutBounce1(t: number, b: number, c: number, d: number): number {
|
|
258
|
+
if ((t /= d) < (1 / 2.75)) {
|
|
259
|
+
return c * (7.5625 * t * t) + b;
|
|
260
|
+
} else if (t < (2 / 2.75)) {
|
|
261
|
+
return c * (7.5625 * (t -= (1.5 / 2.75)) * t + .75) + b;
|
|
262
|
+
} else if (t < (2.5 / 2.75)) {
|
|
263
|
+
return c * (7.5625 * (t -= (2.25 / 2.75)) * t + .9375) + b;
|
|
264
|
+
} else {
|
|
265
|
+
return c * (7.5625 * (t -= (2.625 / 2.75)) * t + .984375) + b;
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
public static easeInOutBounce(t: number, b: number, c: number, d: number): number {
|
|
270
|
+
t = Math.min(t, d);
|
|
271
|
+
if (t < d / 2) {
|
|
272
|
+
return TimingFunctions.easeInBounce1(t * 2, 0, c, d) * .5 + b;
|
|
273
|
+
}
|
|
274
|
+
return TimingFunctions.easeOutBounce1(t * 2 - d, 0, c, d) * .5 + c * .5 + b;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
public static easeInOutSine(t: number, b: number, c: number, d: number): number {
|
|
278
|
+
t = Math.min(t, d);
|
|
279
|
+
return -c / 2 * (Math.cos(Math.PI * t / d) - 1) + b;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MIT License
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2024 Huawei Device Co., Ltd.
|
|
5
|
+
*
|
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
* furnished to do so, subject to the following conditions:
|
|
12
|
+
*
|
|
13
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
* copies or substantial portions of the Software.
|
|
15
|
+
*
|
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
* SOFTWARE.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
export enum TimingFunctionsType {
|
|
26
|
+
linear,
|
|
27
|
+
easeInQuad,
|
|
28
|
+
easeOutQuad,
|
|
29
|
+
easeInOutQuad,
|
|
30
|
+
easeInCubic,
|
|
31
|
+
easeOutCubic,
|
|
32
|
+
easeInOutCubic,
|
|
33
|
+
easeInQuart,
|
|
34
|
+
easeOutQuart,
|
|
35
|
+
easeInOutQuart,
|
|
36
|
+
easeInQuint,
|
|
37
|
+
easeOutQuint,
|
|
38
|
+
easeInOutQuint,
|
|
39
|
+
easeInSine,
|
|
40
|
+
easeOutSine,
|
|
41
|
+
easeInOutSine,
|
|
42
|
+
easeInExpo,
|
|
43
|
+
easeOutExpo,
|
|
44
|
+
easeInOutExpo,
|
|
45
|
+
easeInCirc,
|
|
46
|
+
easeOutCirc,
|
|
47
|
+
easeInOutCirc,
|
|
48
|
+
easeInElastic,
|
|
49
|
+
easeOutElastic,
|
|
50
|
+
easeInOutElastic,
|
|
51
|
+
easeInBack,
|
|
52
|
+
easeOutBack,
|
|
53
|
+
easeInOutBack,
|
|
54
|
+
easeInBounce,
|
|
55
|
+
easeOutBounce,
|
|
56
|
+
easeInOutBounce,
|
|
57
|
+
cubicBezier
|
|
58
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MIT License
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2024 Huawei Device Co., Ltd.
|
|
5
|
+
*
|
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
* furnished to do so, subject to the following conditions:
|
|
12
|
+
*
|
|
13
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
* copies or substantial portions of the Software.
|
|
15
|
+
*
|
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
* SOFTWARE.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
import { TimingFunctionsType } from './TimingFunctionsType';
|
|
26
|
+
|
|
27
|
+
export class TimingFunctionsTypeHandler {
|
|
28
|
+
public static handlerStringType(str: string): TimingFunctionsType {
|
|
29
|
+
let type = str.substring(0, str.indexOf("("))
|
|
30
|
+
if (type == "liner") {
|
|
31
|
+
return TimingFunctionsType.linear
|
|
32
|
+
}
|
|
33
|
+
else if (type == "easeInQuad") {
|
|
34
|
+
return TimingFunctionsType.easeInQuad
|
|
35
|
+
}
|
|
36
|
+
else if (type == "easeOutQuad") {
|
|
37
|
+
return TimingFunctionsType.easeOutQuad
|
|
38
|
+
}
|
|
39
|
+
else if (type == "easeInOutQuad") {
|
|
40
|
+
return TimingFunctionsType.easeInOutQuad
|
|
41
|
+
}
|
|
42
|
+
else if (type == "easeInCubic") {
|
|
43
|
+
return TimingFunctionsType.easeInCubic
|
|
44
|
+
}
|
|
45
|
+
else if (type == "easeOutCubic") {
|
|
46
|
+
return TimingFunctionsType.easeOutCubic
|
|
47
|
+
}
|
|
48
|
+
else if (type == "easeOutElastic") {
|
|
49
|
+
return TimingFunctionsType.easeOutElastic
|
|
50
|
+
}
|
|
51
|
+
else if (type == "easeInOutCubic") {
|
|
52
|
+
return TimingFunctionsType.easeInOutCubic
|
|
53
|
+
}
|
|
54
|
+
else if (type == "easeInQuart") {
|
|
55
|
+
return TimingFunctionsType.easeInQuart
|
|
56
|
+
}
|
|
57
|
+
else if (type == "easeOutQuart") {
|
|
58
|
+
return TimingFunctionsType.easeOutQuart
|
|
59
|
+
}
|
|
60
|
+
else if (type == "easeInQuint") {
|
|
61
|
+
return TimingFunctionsType.easeInQuint
|
|
62
|
+
}
|
|
63
|
+
else if (type == "easeOutQuint") {
|
|
64
|
+
return TimingFunctionsType.easeOutQuint
|
|
65
|
+
}
|
|
66
|
+
else if (type == "easeInOutQuint") {
|
|
67
|
+
return TimingFunctionsType.easeInOutQuint
|
|
68
|
+
}
|
|
69
|
+
else if (type == "easeInSine") {
|
|
70
|
+
return TimingFunctionsType.easeInSine
|
|
71
|
+
}
|
|
72
|
+
else if (type == "easeOutSine") {
|
|
73
|
+
return TimingFunctionsType.easeOutSine
|
|
74
|
+
}
|
|
75
|
+
else if (type == "easeInOutSine") {
|
|
76
|
+
return TimingFunctionsType.easeInOutSine
|
|
77
|
+
}
|
|
78
|
+
else if (type == "easeInExpo") {
|
|
79
|
+
return TimingFunctionsType.easeInExpo
|
|
80
|
+
}
|
|
81
|
+
else if (type == "easeOutExpo") {
|
|
82
|
+
return TimingFunctionsType.easeOutExpo
|
|
83
|
+
}
|
|
84
|
+
else if (type == "easeInOutExpo") {
|
|
85
|
+
return TimingFunctionsType.easeInOutExpo
|
|
86
|
+
}
|
|
87
|
+
else if (type == "easeInCirc") {
|
|
88
|
+
return TimingFunctionsType.easeInCirc
|
|
89
|
+
}
|
|
90
|
+
else if (type == "easeOutCirc") {
|
|
91
|
+
return TimingFunctionsType.easeOutCirc
|
|
92
|
+
}
|
|
93
|
+
else if (type == "easeInOutCirc") {
|
|
94
|
+
return TimingFunctionsType.easeInOutCirc
|
|
95
|
+
}
|
|
96
|
+
else if (type == "easeInElastic") {
|
|
97
|
+
return TimingFunctionsType.easeInElastic
|
|
98
|
+
}
|
|
99
|
+
else if (type == "easeOutElastic") {
|
|
100
|
+
return TimingFunctionsType.easeOutElastic
|
|
101
|
+
}
|
|
102
|
+
else if (type == "easeInOutElastic") {
|
|
103
|
+
return TimingFunctionsType.easeInOutElastic
|
|
104
|
+
}
|
|
105
|
+
else if (type == "easeInBack") {
|
|
106
|
+
return TimingFunctionsType.easeInBack
|
|
107
|
+
}
|
|
108
|
+
else if (type == "easeOutBack") {
|
|
109
|
+
return TimingFunctionsType.easeOutBack
|
|
110
|
+
}
|
|
111
|
+
else if (type == "easeInOutBack") {
|
|
112
|
+
return TimingFunctionsType.easeInOutBack
|
|
113
|
+
}
|
|
114
|
+
else if (type == "easeInBounce") {
|
|
115
|
+
return TimingFunctionsType.easeInBounce
|
|
116
|
+
}
|
|
117
|
+
else if (type == "easeOutBounce") {
|
|
118
|
+
return TimingFunctionsType.easeOutBounce
|
|
119
|
+
}
|
|
120
|
+
else if (type == "easeInOutBounce") {
|
|
121
|
+
return TimingFunctionsType.easeInOutBounce
|
|
122
|
+
}
|
|
123
|
+
else if (type == "cubicBezier") {
|
|
124
|
+
return TimingFunctionsType.cubicBezier
|
|
125
|
+
}
|
|
126
|
+
return TimingFunctionsType.linear
|
|
127
|
+
}
|
|
128
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MIT License
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2024 Huawei Device Co., Ltd.
|
|
5
|
+
*
|
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
* furnished to do so, subject to the following conditions:
|
|
12
|
+
*
|
|
13
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
* copies or substantial portions of the Software.
|
|
15
|
+
*
|
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
* SOFTWARE.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
export * from "./src/main/ets/ReactBindingXPackage"
|
|
26
|
+
export * from "./src/main/ets/ReactBindingXModule"
|
|
Binary file
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
|
|
2
|
+
import { TurboModuleRegistry, TurboModule } from 'react-native';
|
|
3
|
+
|
|
4
|
+
export interface Spec extends TurboModule {
|
|
5
|
+
bind: (options: Object) => string;
|
|
6
|
+
unbind: (options: Object) => void;
|
|
7
|
+
unbindAll: () => void;
|
|
8
|
+
prepare: (options: Object) => void;
|
|
9
|
+
getComputedStyle: (options: Object) => Promise<string>;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export default TurboModuleRegistry.getEnforcing<Spec>('ReactBindingXModule');
|