@tarojs/plugin-platform-harmony-ets 4.0.8-beta.0 → 4.0.8-beta.3

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.
Files changed (207) hide show
  1. package/dist/apis/apis.d.ts +19 -0
  2. package/dist/apis/base/crypto.d.ts +1 -0
  3. package/dist/apis/base/debug.d.ts +3 -0
  4. package/dist/apis/base/index.d.ts +10 -0
  5. package/dist/apis/base/performance.d.ts +5 -0
  6. package/dist/apis/base/system.d.ts +3 -0
  7. package/dist/apis/base/update.d.ts +2 -0
  8. package/dist/apis/base/weapp/app-event.d.ts +19 -0
  9. package/dist/apis/base/weapp/life-cycle.d.ts +3 -0
  10. package/dist/apis/canvas/index.d.ts +10 -0
  11. package/dist/apis/data-analysis/index.d.ts +4 -0
  12. package/dist/apis/device/accelerometer.d.ts +17 -0
  13. package/dist/apis/device/accessibility.d.ts +1 -0
  14. package/dist/apis/device/battery.d.ts +3 -0
  15. package/dist/apis/device/bluetooth-ble.d.ts +16 -0
  16. package/dist/apis/device/bluetooth-peripheral.d.ts +3 -0
  17. package/dist/apis/device/bluetooth.d.ts +13 -0
  18. package/dist/apis/device/calendar.d.ts +2 -0
  19. package/dist/apis/device/clipboard.d.ts +9 -0
  20. package/dist/apis/device/compass.d.ts +16 -0
  21. package/dist/apis/device/contact.d.ts +2 -0
  22. package/dist/apis/device/crypto.d.ts +1 -0
  23. package/dist/apis/device/gyroscope.d.ts +4 -0
  24. package/dist/apis/device/iBeacon.d.ts +7 -0
  25. package/dist/apis/device/index.d.ts +24 -0
  26. package/dist/apis/device/keyboard.d.ts +5 -0
  27. package/dist/apis/device/memory.d.ts +2 -0
  28. package/dist/apis/device/motion.d.ts +4 -0
  29. package/dist/apis/device/network.d.ts +14 -0
  30. package/dist/apis/device/nfc.d.ts +7 -0
  31. package/dist/apis/device/phone.d.ts +2 -0
  32. package/dist/apis/device/scan.d.ts +1 -0
  33. package/dist/apis/device/screen.d.ts +10 -0
  34. package/dist/apis/device/sms.d.ts +1 -0
  35. package/dist/apis/device/vibrate.d.ts +3 -0
  36. package/dist/apis/device/wifi.d.ts +12 -0
  37. package/dist/apis/ext/index.d.ts +2 -0
  38. package/dist/apis/files/index.d.ts +32 -0
  39. package/dist/apis/files/manager.d.ts +28 -0
  40. package/dist/apis/framework/index.d.ts +18 -0
  41. package/dist/apis/index.d.ts +22 -0
  42. package/dist/apis/location/index.d.ts +13 -0
  43. package/dist/apis/media/EditorContext.d.ts +16 -0
  44. package/dist/apis/media/audio/index.d.ts +12 -0
  45. package/dist/apis/media/background-audio/index.d.ts +12 -0
  46. package/dist/apis/media/camera.d.ts +2 -0
  47. package/dist/apis/media/common.d.ts +3 -0
  48. package/dist/apis/media/image/index.d.ts +6 -0
  49. package/dist/apis/media/index.d.ts +13 -0
  50. package/dist/apis/media/live.d.ts +2 -0
  51. package/dist/apis/media/map.d.ts +1 -0
  52. package/dist/apis/media/media-recorder.d.ts +1 -0
  53. package/dist/apis/media/recorder.d.ts +3 -0
  54. package/dist/apis/media/video/index.d.ts +7 -0
  55. package/dist/apis/media/video-decoder.d.ts +1 -0
  56. package/dist/apis/media/video-processing.d.ts +1 -0
  57. package/dist/apis/media/voip.d.ts +16 -0
  58. package/dist/apis/navigate/index.d.ts +5 -0
  59. package/dist/apis/network/downloadFile.d.ts +2 -0
  60. package/dist/apis/network/index.d.ts +7 -0
  61. package/dist/apis/network/mdns.d.ts +10 -0
  62. package/dist/apis/network/request.d.ts +2 -0
  63. package/dist/apis/network/tcp.d.ts +1 -0
  64. package/dist/apis/network/udp.d.ts +1 -0
  65. package/dist/apis/network/uploadFile.d.ts +2 -0
  66. package/dist/apis/network/webSocket.d.ts +2 -0
  67. package/dist/apis/open-api/account.d.ts +1 -0
  68. package/dist/apis/open-api/address.d.ts +1 -0
  69. package/dist/apis/open-api/authorize.d.ts +2 -0
  70. package/dist/apis/open-api/card.d.ts +2 -0
  71. package/dist/apis/open-api/channels-live.d.ts +8 -0
  72. package/dist/apis/open-api/customer-service.d.ts +1 -0
  73. package/dist/apis/open-api/device-voip.d.ts +2 -0
  74. package/dist/apis/open-api/facial.d.ts +4 -0
  75. package/dist/apis/open-api/favorites.d.ts +2 -0
  76. package/dist/apis/open-api/group.d.ts +1 -0
  77. package/dist/apis/open-api/index.d.ts +21 -0
  78. package/dist/apis/open-api/invoice.d.ts +2 -0
  79. package/dist/apis/open-api/license-plate.d.ts +1 -0
  80. package/dist/apis/open-api/login.d.ts +3 -0
  81. package/dist/apis/open-api/my-miniprogram.d.ts +1 -0
  82. package/dist/apis/open-api/privacy.d.ts +4 -0
  83. package/dist/apis/open-api/red-package.d.ts +1 -0
  84. package/dist/apis/open-api/settings.d.ts +2 -0
  85. package/dist/apis/open-api/soter.d.ts +3 -0
  86. package/dist/apis/open-api/subscribe-message.d.ts +2 -0
  87. package/dist/apis/open-api/user-info.d.ts +15 -0
  88. package/dist/apis/open-api/werun.d.ts +2 -0
  89. package/dist/apis/payment/index.d.ts +3 -0
  90. package/dist/apis/route/index.d.ts +10 -0
  91. package/dist/apis/share/index.d.ts +20 -0
  92. package/dist/apis/storage/background-fetch.d.ts +4 -0
  93. package/dist/apis/storage/cache-manager.d.ts +1 -0
  94. package/dist/apis/storage/index.d.ts +19 -0
  95. package/dist/apis/ui/animation/animation.d.ts +56 -0
  96. package/dist/apis/ui/animation/index.d.ts +3 -0
  97. package/dist/apis/ui/background.d.ts +2 -0
  98. package/dist/apis/ui/custom-component.d.ts +2 -0
  99. package/dist/apis/ui/fonts.d.ts +1 -0
  100. package/dist/apis/ui/index.d.ts +12 -0
  101. package/dist/apis/ui/interaction/index.d.ts +8 -0
  102. package/dist/apis/ui/menu.d.ts +1 -0
  103. package/dist/apis/ui/navigation-bar/index.d.ts +6 -0
  104. package/dist/apis/ui/pull-down-refresh.d.ts +3 -0
  105. package/dist/apis/ui/scroll/index.d.ts +5 -0
  106. package/dist/apis/ui/sticky.d.ts +1 -0
  107. package/dist/apis/ui/tab-bar.d.ts +9 -0
  108. package/dist/apis/ui/window.d.ts +14 -0
  109. package/dist/apis/utils/handler.d.ts +46 -0
  110. package/dist/apis/utils/index.d.ts +17 -0
  111. package/dist/apis/utils/permissions.d.ts +5 -0
  112. package/dist/apis/utils/types.d.ts +11 -0
  113. package/dist/apis/utils/validate.d.ts +39 -0
  114. package/dist/apis/worker/index.d.ts +1 -0
  115. package/dist/apis/wxml/IntersectionObserver.d.ts +12 -0
  116. package/dist/apis/wxml/index.d.ts +7 -0
  117. package/dist/apis/wxml/nodesRef.d.ts +14 -0
  118. package/dist/apis/wxml/selectorQuery.d.ts +39 -0
  119. package/dist/components/components-harmony-ets/tag.d.ts +53 -0
  120. package/dist/components/components-harmony-ets/utils/DynamicCenter.d.ts +7 -0
  121. package/dist/components/components-harmony-ets/utils/events.d.ts +3 -0
  122. package/dist/components/components-harmony-ets/utils/htmlParser/HarmonyHTMLParser.d.ts +11 -0
  123. package/dist/components/components-harmony-ets/utils/htmlParser/index.d.ts +3 -0
  124. package/dist/components/components-harmony-ets/utils/index.d.ts +11 -0
  125. package/dist/components/components-react.d.ts +7 -0
  126. package/dist/components/components-react.js +2 -41
  127. package/dist/components/components-react.js.map +1 -1
  128. package/dist/components/index.d.ts +119 -0
  129. package/dist/index.d.ts +6 -148
  130. package/dist/index.js +12 -8
  131. package/dist/index.js.map +1 -1
  132. package/dist/program/arkTS.d.ts +40 -0
  133. package/dist/program/harmony.d.ts +36 -0
  134. package/dist/program/jsUI.d.ts +60 -0
  135. package/dist/runtime-ets/bom/URL.d.ts +2 -0
  136. package/dist/runtime-ets/bom/document.d.ts +2 -0
  137. package/dist/runtime-ets/bom/getComputedStyle.d.ts +1 -0
  138. package/dist/runtime-ets/bom/history.d.ts +1 -0
  139. package/dist/runtime-ets/bom/location.d.ts +1 -0
  140. package/dist/runtime-ets/bom/navigator.d.ts +1 -0
  141. package/dist/runtime-ets/bom/raf.d.ts +1 -0
  142. package/dist/runtime-ets/bom/window.d.ts +20 -0
  143. package/dist/runtime-ets/constant.d.ts +17 -0
  144. package/dist/runtime-ets/current.d.ts +4 -0
  145. package/dist/runtime-ets/dom/bind.d.ts +4 -0
  146. package/dist/runtime-ets/dom/class-list.d.ts +15 -0
  147. package/dist/runtime-ets/dom/comment.d.ts +5 -0
  148. package/dist/runtime-ets/dom/cssNesting.d.ts +7 -0
  149. package/dist/runtime-ets/dom/cssStyleDeclaration.d.ts +14 -0
  150. package/dist/runtime-ets/dom/document.d.ts +20 -0
  151. package/dist/runtime-ets/dom/element/element.ts +49 -42
  152. package/dist/runtime-ets/dom/element/index.d.ts +14 -0
  153. package/dist/runtime-ets/dom/element/movableArea.d.ts +5 -0
  154. package/dist/runtime-ets/dom/element/progress.d.ts +5 -0
  155. package/dist/runtime-ets/dom/element/text.d.ts +5 -0
  156. package/dist/runtime-ets/dom/element/webView.d.ts +15 -0
  157. package/dist/runtime-ets/dom/event-source.d.ts +1 -0
  158. package/dist/runtime-ets/dom/event.d.ts +24 -0
  159. package/dist/runtime-ets/dom/eventTarget.d.ts +17 -0
  160. package/dist/runtime-ets/dom/node.d.ts +62 -0
  161. package/dist/runtime-ets/dom/stylesheet/covertWeb2Hm.d.ts +3 -0
  162. package/dist/runtime-ets/dom/stylesheet/covertWeb2Hm.ts +1 -0
  163. package/dist/runtime-ets/dom/stylesheet/index.d.ts +83 -0
  164. package/dist/runtime-ets/emitter/emitter.d.ts +1 -0
  165. package/dist/runtime-ets/env.d.ts +1 -0
  166. package/dist/runtime-ets/index.d.ts +22 -0
  167. package/dist/runtime-ets/interface/event.d.ts +9 -0
  168. package/dist/runtime-ets/interface/index.d.ts +6 -0
  169. package/dist/runtime-ets/utils/index.d.ts +26 -0
  170. package/dist/runtime-ets/utils/info.d.ts +11 -0
  171. package/dist/runtime-ets/utils/router.d.ts +1 -0
  172. package/dist/runtime-framework/react/app.d.ts +12 -0
  173. package/dist/runtime-framework/react/connect.d.ts +1 -0
  174. package/dist/runtime-framework/react/constant.d.ts +5 -0
  175. package/dist/runtime-framework/react/hooks.d.ts +31 -0
  176. package/dist/runtime-framework/react/hooks.ts +1 -0
  177. package/dist/runtime-framework/react/index.d.ts +5 -0
  178. package/dist/runtime-framework/react/native-page.d.ts +8 -0
  179. package/dist/runtime-framework/react/native-page.ts +6 -6
  180. package/dist/runtime-framework/react/page.d.ts +13 -0
  181. package/dist/runtime-framework/react/utils/index.d.ts +7 -0
  182. package/dist/runtime-framework/react/utils/is.d.ts +10 -0
  183. package/dist/runtime-framework/solid/app.d.ts +10 -0
  184. package/dist/runtime-framework/solid/connect.d.ts +4 -0
  185. package/dist/runtime-framework/solid/constant.d.ts +5 -0
  186. package/dist/runtime-framework/solid/hooks.d.ts +31 -0
  187. package/dist/runtime-framework/solid/hooks.ts +1 -0
  188. package/dist/runtime-framework/solid/index.d.ts +4 -0
  189. package/dist/runtime-framework/solid/page.d.ts +13 -0
  190. package/dist/runtime-framework/solid/reconciler/h.d.ts +8 -0
  191. package/dist/runtime-framework/solid/reconciler/index.d.ts +3 -0
  192. package/dist/runtime-framework/solid/reconciler/props.d.ts +7 -0
  193. package/dist/runtime-framework/solid/reconciler/props.ts +1 -1
  194. package/dist/runtime-framework/solid/reconciler/render.d.ts +16 -0
  195. package/dist/runtime-framework/solid/reconciler/use.d.ts +1 -0
  196. package/dist/runtime-framework/solid/utils/index.d.ts +16 -0
  197. package/dist/runtime-framework/solid/utils/is.d.ts +10 -0
  198. package/dist/runtime-utils.d.ts +4 -818
  199. package/dist/runtime-utils.js +394 -394
  200. package/dist/runtime-utils.js.map +1 -1
  201. package/dist/runtime.js +394 -394
  202. package/dist/runtime.js.map +1 -1
  203. package/dist/template.d.ts +43 -0
  204. package/dist/utils/api-loader.d.ts +1 -0
  205. package/dist/utils/constants.d.ts +4 -0
  206. package/dist/utils/index.d.ts +3 -0
  207. package/package.json +13 -12
@@ -0,0 +1,5 @@
1
+ import { TaroTextNode } from './node';
2
+ declare class TaroComment extends TaroTextNode {
3
+ constructor(data: string);
4
+ }
5
+ export { TaroComment };
@@ -0,0 +1,7 @@
1
+ import type { ReactElement } from 'react';
2
+ export type NestingStyle = {
3
+ node: ReactElement;
4
+ selectors: string[];
5
+ declaration: Record<string, any>;
6
+ }[];
7
+ export declare function __combine_nesting_style__(react_tree: ReactElement, styles?: NestingStyle | null): ReactElement<any, string | import("react").JSXElementConstructor<any>>;
@@ -0,0 +1,14 @@
1
+ import { TaroElement } from './element/element';
2
+ declare class CSSStyleDeclaration {
3
+ el: TaroElement;
4
+ constructor(el: TaroElement);
5
+ get _st(): import("./stylesheet").default;
6
+ get cssText(): string;
7
+ set cssText(value: string);
8
+ setProperty(prop: string, value: any): void;
9
+ getPropertyValue(prop: string): string | number;
10
+ removeProperty(prop: string): string | number;
11
+ }
12
+ type ICSSStyleDeclaration = CSSStyleDeclaration & Record<string, any>;
13
+ declare function createCSSStyleDeclaration(node: TaroElement): CSSStyleDeclaration;
14
+ export { createCSSStyleDeclaration, CSSStyleDeclaration, ICSSStyleDeclaration };
@@ -0,0 +1,20 @@
1
+ import { TaroComment } from './comment';
2
+ import { TaroElement } from './element/element';
3
+ import { TaroNode, TaroTextNode } from './node';
4
+ import type { Window } from '../bom/window';
5
+ declare class TaroDocument extends TaroNode {
6
+ documentElement: TaroElement;
7
+ head: TaroElement;
8
+ body: TaroElement;
9
+ cookie: string;
10
+ private _win;
11
+ constructor(window: Window);
12
+ get defaultView(): Window;
13
+ createElement(tagName: string): TaroElement;
14
+ createTextNode(value: string): TaroTextNode;
15
+ createComment(data: string): TaroComment;
16
+ getElementById<T extends TaroElement>(id: string | undefined | null): T | null;
17
+ querySelector(selectors: string): TaroElement | null;
18
+ querySelectorAll(selectors: string): TaroElement[];
19
+ }
20
+ export { TaroDocument };
@@ -33,14 +33,13 @@ export class TaroElement<
33
33
  > extends TaroNode {
34
34
  public _innerHTML = ''
35
35
  public _nodeInfo: TaroAny = {
36
- layer: 0 // 渲染层级
36
+ layer: 0, // 渲染层级
37
37
  }
38
38
 
39
39
  public _hm_instance: TaroAny
40
40
  public weak_hm_instance: WeakRef<TaroAny>
41
41
  public use_weak_hm_instance: boolean = true
42
42
 
43
-
44
43
  public get hm_instance(): TaroAny {
45
44
  if (this.use_weak_hm_instance && this.weak_hm_instance) {
46
45
  return this.weak_hm_instance?.deref()
@@ -56,17 +55,16 @@ export class TaroElement<
56
55
  this._hm_instance = instance
57
56
  }
58
57
 
59
-
60
- public get _instance () {
58
+ public get _instance() {
61
59
  return this.hm_instance
62
60
  }
63
61
 
64
- public set _instance (value) {
62
+ public set _instance(value) {
65
63
  this.hm_instance = value
66
64
  if (this._nodeInfo.aboutToAppear) {
67
65
  let task
68
66
  // eslint-disable-next-line no-cond-assign
69
- while (task = this._nodeInfo.aboutToAppear.shift()) {
67
+ while ((task = this._nodeInfo.aboutToAppear.shift())) {
70
68
  task()
71
69
  }
72
70
  }
@@ -159,7 +157,7 @@ export class TaroElement<
159
157
  id: this._nid,
160
158
  tagName: this.tagName,
161
159
  attribute: name,
162
- value
160
+ value,
163
161
  })
164
162
  } else {
165
163
  const attributeTriggerValue: TaroAny = ATTRIBUTES_CALLBACK_TRIGGER_MAP[name]
@@ -266,7 +264,7 @@ export class TaroElement<
266
264
  if (!this._pseudo_before) {
267
265
  this._pseudo_before = new StyleSheet()
268
266
  }
269
- Object.keys(value).forEach(key => {
267
+ Object.keys(value).forEach((key) => {
270
268
  this._pseudo_before!.hmStyle[key] = value[key]
271
269
  })
272
270
  } else {
@@ -281,7 +279,7 @@ export class TaroElement<
281
279
  if (!this._pseudo_after) {
282
280
  this._pseudo_after = new StyleSheet()
283
281
  }
284
- Object.keys(value).forEach(key => {
282
+ Object.keys(value).forEach((key) => {
285
283
  this._pseudo_after!.hmStyle[key] = value[key]
286
284
  })
287
285
  } else {
@@ -299,7 +297,7 @@ export class TaroElement<
299
297
  if (!this._pseudo_class[name]) {
300
298
  this._pseudo_class[name] = new StyleSheet()
301
299
  }
302
- Object.keys(value).forEach(key => {
300
+ Object.keys(value).forEach((key) => {
303
301
  this._pseudo_class[name]!.hmStyle[key] = value[key]
304
302
  })
305
303
  } else {
@@ -307,7 +305,7 @@ export class TaroElement<
307
305
  }
308
306
  }
309
307
 
310
- get currentLayerNode () {
308
+ get currentLayerNode() {
311
309
  if (!this._page) return null
312
310
  if (typeof this._page.tabBarCurrentIndex !== 'undefined') {
313
311
  this._page.layerNode ||= []
@@ -320,7 +318,7 @@ export class TaroElement<
320
318
  }
321
319
  }
322
320
 
323
- get currentLayerParents () {
321
+ get currentLayerParents() {
324
322
  if (!this._page) return null
325
323
  if (typeof this._page.tabBarCurrentIndex !== 'undefined') {
326
324
  this._page.layerParents ||= {}
@@ -337,7 +335,7 @@ export class TaroElement<
337
335
  // 1、appendChild的时候会判断是否需要设置层级
338
336
  // 2、taro-react的setProperty,在处理属性变化的时候,会判断是否需要设置层级
339
337
  // 3、removeChild的时候,会判断是否需要移除层级
340
- public setLayer (value: number) {
338
+ public setLayer(value: number) {
341
339
  if (!this.parentNode) return // 没有父节点,不需要设置层级关系
342
340
 
343
341
  const currentPage = getPageById(this.getAttribute('__fixed'))
@@ -359,7 +357,7 @@ export class TaroElement<
359
357
  generateLayerParentIds(_parentRecord, this)
360
358
  currentLayerParents[this.getStrNid()] = _parentRecord
361
359
  } else {
362
- const idx = currentLayerNode.childNodes.findIndex(n => n.getStrNid() === this.getStrNid())
360
+ const idx = currentLayerNode.childNodes.findIndex((n) => n.getStrNid() === this.getStrNid())
363
361
  currentLayerNode.childNodes.splice(idx, 1)
364
362
  currentLayerNode.notifyDataDelete(idx)
365
363
 
@@ -385,7 +383,7 @@ export class TaroElement<
385
383
  delete currentLayerParents[this.getStrNid()]
386
384
  this.setLayer(0)
387
385
  } else {
388
- Object.keys(currentLayerParents).forEach(fixedId => {
386
+ Object.keys(currentLayerParents).forEach((fixedId) => {
389
387
  const parentIds = currentLayerParents[fixedId]
390
388
  if (parentIds[this.getStrNid()]) {
391
389
  // 需要移除fixedId
@@ -401,7 +399,7 @@ export class TaroElement<
401
399
  }
402
400
 
403
401
  // 设置动画
404
- public setAnimation (playing) {
402
+ public setAnimation(playing) {
405
403
  if (!this._instance) {
406
404
  if (!this._nodeInfo.aboutToAppear) {
407
405
  this._nodeInfo.aboutToAppear = []
@@ -436,41 +434,50 @@ export class TaroElement<
436
434
  this.parentNode.notifyDataDelete(idx)
437
435
 
438
436
  // 下一帧播放,等实例被移除掉,再重新插入
439
- setTimeout(() => {
440
- // insert
441
- this.parentNode?.childNodes.splice(idx, 0, this)
442
- this.parentNode?.notifyDataAdd(idx)
443
-
444
- // 执行动画
445
- if (playing) {
446
- this.playAnimation()
447
- }
448
- }, playing ? 0 : 100)
437
+ setTimeout(
438
+ () => {
439
+ // insert
440
+ this.parentNode?.childNodes.splice(idx, 0, this)
441
+ this.parentNode?.notifyDataAdd(idx)
442
+
443
+ // 执行动画
444
+ if (playing) {
445
+ this.playAnimation()
446
+ }
447
+ },
448
+ playing ? 0 : 100
449
+ )
449
450
  }
450
451
  }
451
452
 
452
- private playAnimation () {
453
+ private playAnimation() {
453
454
  const {
454
- animationDuration = 0, animationDelay = 0, animationIterationCount = 1, animationName: keyframes,
455
- animationTimingFunction
455
+ animationDuration = 0,
456
+ animationDelay = 0,
457
+ animationIterationCount = 1,
458
+ animationName: keyframes,
459
+ animationTimingFunction,
456
460
  } = this._st.hmStyle
457
461
 
458
462
  if (keyframes) {
459
463
  let cur_percentage = 0
460
- this._instance.getUIContext()?.keyframeAnimateTo({
461
- delay: animationDelay,
462
- iterations: animationIterationCount,
463
- }, keyframes.map(item => {
464
- const duration = (item.percentage - cur_percentage) * animationDuration
465
- cur_percentage = item.percentage
466
- return {
467
- duration: duration,
468
- curve: item.event.animationTimingFunction || animationTimingFunction,
469
- event: () => {
470
- this._instance.overwriteStyle = item.event
464
+ this._instance.getUIContext()?.keyframeAnimateTo(
465
+ {
466
+ delay: animationDelay,
467
+ iterations: animationIterationCount,
468
+ },
469
+ keyframes.map((item) => {
470
+ const duration = (item.percentage - cur_percentage) * animationDuration
471
+ cur_percentage = item.percentage
472
+ return {
473
+ duration: duration,
474
+ curve: item.event.animationTimingFunction || animationTimingFunction,
475
+ event: () => {
476
+ this._instance.overwriteStyle = item.event
477
+ },
471
478
  }
472
- }
473
- }))
479
+ })
480
+ )
474
481
  }
475
482
  }
476
483
  }
@@ -0,0 +1,14 @@
1
+ import { TaroCanvasElement } from './canvas';
2
+ import { TaroElement } from './element';
3
+ import { FormElement, TaroCheckboxElement, TaroCheckboxGroupElement, TaroFormElement, TaroInputElement, TaroPickerElement, TaroRadioElement, TaroRadioGroupElement, TaroSliderElement, TaroSwitchElement, TaroTextAreaElement } from './form';
4
+ import { TaroMovableAreaElement } from './movableArea';
5
+ import { isTaroMovableViewElement, TaroMovableViewElement } from './movableView';
6
+ import { TaroButtonElement, TaroIconElement, TaroImageElement, TaroLabelElement, TaroNavigationBarElement, TaroOtherElement, TaroPageMetaElement, TaroRichTextElement, TaroSwiperElement, TaroSwiperItemElement, TaroViewElement } from './normal';
7
+ import { TaroProgressElement } from './progress';
8
+ import { TaroScrollViewElement } from './scrollView';
9
+ import { TaroTextElement } from './text';
10
+ import { TaroVideoElement } from './video';
11
+ import { TaroInnerHtmlElement, TaroWebViewElement } from './webView';
12
+ export declare function initHarmonyElement(): void;
13
+ export { FormElement, TaroButtonElement, TaroCanvasElement, TaroCheckboxElement, TaroCheckboxGroupElement, TaroElement, TaroFormElement, TaroIconElement, TaroImageElement, TaroInnerHtmlElement, TaroInputElement, TaroLabelElement, TaroMovableAreaElement, TaroMovableViewElement, TaroNavigationBarElement, TaroOtherElement, TaroPageMetaElement, TaroPickerElement, TaroProgressElement, TaroRadioElement, TaroRadioGroupElement, TaroRichTextElement, TaroScrollViewElement, TaroSliderElement, TaroSwiperElement, TaroSwiperItemElement, TaroSwitchElement, TaroTextAreaElement, TaroTextElement, TaroVideoElement, TaroViewElement, TaroWebViewElement };
14
+ export { isTaroMovableViewElement };
@@ -0,0 +1,5 @@
1
+ import { TaroElement } from './element';
2
+ import type { MovableAreaProps } from '@tarojs/components/types';
3
+ export declare class TaroMovableAreaElement extends TaroElement<MovableAreaProps> {
4
+ constructor();
5
+ }
@@ -0,0 +1,5 @@
1
+ import { TaroElement } from './element';
2
+ import type { ProgressProps } from '@tarojs/components/types';
3
+ export declare class TaroProgressElement extends TaroElement<ProgressProps> {
4
+ constructor();
5
+ }
@@ -0,0 +1,5 @@
1
+ import { TaroElement } from './element';
2
+ import type { TextProps } from '@tarojs/components/types';
3
+ export declare class TaroTextElement extends TaroElement<TextProps> {
4
+ constructor();
5
+ }
@@ -0,0 +1,15 @@
1
+ import web_webview from '@ohos.web.webview';
2
+ import { TaroElement } from './element';
3
+ import type { WebViewProps } from '@tarojs/components/types';
4
+ export declare class TaroInnerHtmlElement extends TaroElement {
5
+ constructor();
6
+ }
7
+ export declare class TaroWebViewElement extends TaroElement<WebViewProps> {
8
+ ports: web_webview.WebMessagePort[];
9
+ nativePort: web_webview.WebMessagePort | null;
10
+ message: web_webview.WebMessageExt;
11
+ controller: web_webview.WebviewController;
12
+ constructor();
13
+ postMessage(value: string): void;
14
+ handleMessageFromWeb(result: web_webview.WebMessageExt): any;
15
+ }
@@ -0,0 +1 @@
1
+ export { eventSource } from '@tarojs/runtime/dist/runtime.esm';
@@ -0,0 +1,24 @@
1
+ import { TaroElement } from './element/element';
2
+ import type { EventOptions } from '../interface';
3
+ export declare class TaroEvent<T = any> {
4
+ type: string;
5
+ bubbles: boolean;
6
+ cancelable: boolean;
7
+ _stop: boolean;
8
+ _end: boolean;
9
+ defaultPrevented: boolean;
10
+ target: TaroElement;
11
+ currentTarget: TaroElement;
12
+ /** 额外的信息 */
13
+ detail: T;
14
+ button: number;
15
+ timeStamp: number;
16
+ mpEvent: TaroEvent | undefined;
17
+ constructor(type: string, opts: EventOptions, event?: TaroEvent);
18
+ stopPropagation(): void;
19
+ stopImmediatePropagation(): void;
20
+ preventDefault(): void;
21
+ }
22
+ export declare function createEvent(event: TaroEvent | string, type?: string, node?: TaroElement): TaroEvent<any> | undefined;
23
+ export declare function eventHandler(event: any, type: string, node: TaroElement): void;
24
+ export declare function createTaroEvent(type: string, opts?: Partial<EventOptions>, node?: TaroElement): TaroEvent<any>;
@@ -0,0 +1,17 @@
1
+ import { Events } from '../emitter/emitter';
2
+ import { TaroEvent } from './event';
3
+ import type { EventHandler } from '../interface';
4
+ interface IOptions {
5
+ capture?: boolean;
6
+ once?: boolean;
7
+ passive?: boolean;
8
+ }
9
+ type fn = (...args: any[]) => any;
10
+ declare class TaroEventTarget extends Events {
11
+ __listeners: Record<string, EventHandler[]>;
12
+ addEventListener(type: string, listener: fn, options?: IOptions): void;
13
+ removeEventListener(type: string, listener: fn): void;
14
+ dispatchEvent(event: TaroEvent): boolean;
15
+ private _stopPropagation;
16
+ }
17
+ export { TaroEventTarget };
@@ -0,0 +1,62 @@
1
+ import TaroDataSourceElement from './dataSource';
2
+ import type { StandardProps } from '@tarojs/components/types';
3
+ import type { TaroAny } from '../interface';
4
+ import type { TaroDocument } from './document';
5
+ import type { TaroElement } from './element/element';
6
+ export declare enum NodeType {
7
+ ELEMENT_NODE = 1,
8
+ ATTRIBUTE_NODE = 2,
9
+ TEXT_NODE = 3,
10
+ CDATA_SECTION_NODE = 4,
11
+ ENTITY_REFERENCE_NODE = 5,
12
+ PROCESSING_INSTRUCTION_NODE = 7,
13
+ COMMENT_NODE = 8,
14
+ DOCUMENT_NODE = 9,
15
+ DOCUMENT_TYPE_NODE = 10,
16
+ DOCUMENT_FRAGMENT_NODE = 11
17
+ }
18
+ export declare class TaroNode extends TaroDataSourceElement {
19
+ readonly nodeName: string;
20
+ readonly nodeType: NodeType;
21
+ childNodes: TaroNode[];
22
+ parentNode: TaroNode | null;
23
+ _nid: number;
24
+ _doc: TaroDocument | null;
25
+ _instance?: TaroAny;
26
+ private _textContent;
27
+ _updateTrigger: number;
28
+ _isCompileMode: boolean;
29
+ _isDynamicNode: boolean;
30
+ _nativeUpdateTrigger: number;
31
+ constructor(nodeName: string, nodeType?: NodeType);
32
+ totalCount(): number;
33
+ getData(index: number): TaroElement<StandardProps>;
34
+ getStrNid(): string;
35
+ getNumNid(id: any): number;
36
+ findIndex(refChild?: TaroNode): number;
37
+ updateTextNode(): void;
38
+ updateComponent(): void;
39
+ get uid(): string;
40
+ get firstChild(): TaroNode | null;
41
+ get lastChild(): TaroNode | null;
42
+ get nextSibling(): TaroNode | null;
43
+ get previousSibling(): TaroNode | null;
44
+ get parentElement(): TaroElement | null;
45
+ get textContent(): string;
46
+ set textContent(value: string);
47
+ get nodeValue(): string | null;
48
+ set nodeValue(value: string | null);
49
+ get ownerDocument(): TaroDocument | null;
50
+ hasChildNodes(): boolean;
51
+ connectParentNode(child: TaroNode): void;
52
+ appendChild(child: TaroNode): TaroNode;
53
+ insertBefore(newNode: TaroNode, referenceNode?: TaroNode): TaroNode;
54
+ replaceChild(newChild: TaroNode, oldChild: TaroNode): TaroNode;
55
+ removeChild(child: TaroNode): TaroNode;
56
+ dispose(): void;
57
+ }
58
+ export declare class TaroTextNode extends TaroNode {
59
+ constructor(value?: string, nodeName?: string, nodeType?: NodeType);
60
+ get data(): string;
61
+ set data(value: string);
62
+ }
@@ -0,0 +1,3 @@
1
+ import { CSSProperties } from 'react';
2
+ import { TaroElement } from '../element/element';
3
+ export default function convertWebStyle2HmStyle(webStyle: CSSProperties, node?: TaroElement): Record<string, any>;
@@ -1,4 +1,5 @@
1
1
  // @ts-nocheck
2
+ /* eslint-disable complexity */
2
3
 
3
4
  import { CSSProperties } from 'react'
4
5
 
@@ -0,0 +1,83 @@
1
+ import type { HarmonyStyle, HarmonyType, TaroStyleType, TaroTextStyleType } from './type';
2
+ export { HarmonyStyle, HarmonyType, TaroStyleType, TaroTextStyleType };
3
+ export default class StyleSheet {
4
+ hmStyle: HarmonyStyle;
5
+ get display(): "none" | "block" | "flex" | undefined;
6
+ get position(): "fixed" | "relative" | "absolute" | undefined;
7
+ get padding(): string;
8
+ get paddingTop(): any;
9
+ get paddingBottom(): any;
10
+ get paddingLeft(): any;
11
+ get paddingRight(): any;
12
+ get margin(): string;
13
+ get marginTop(): any;
14
+ get marginBottom(): any;
15
+ get marginLeft(): any;
16
+ get marginRight(): any;
17
+ get top(): any;
18
+ get left(): any;
19
+ get right(): any;
20
+ get bottom(): any;
21
+ get flex(): string;
22
+ get flexBasis(): string | number | undefined;
23
+ get flexGrow(): number;
24
+ get flexShrink(): number;
25
+ get alignSelf(): string;
26
+ get flexDirection(): string;
27
+ get justifyContent(): string;
28
+ get alignItems(): string;
29
+ get alignContent(): string;
30
+ get flexWrap(): string;
31
+ get width(): any;
32
+ get height(): any;
33
+ get minHeight(): any;
34
+ get maxHeight(): any;
35
+ get minWidth(): any;
36
+ get maxWidth(): any;
37
+ get background(): string;
38
+ get backgroundColor(): any;
39
+ get backgroundImage(): any;
40
+ get backgroundRepeat(): "repeat-x" | "repeat-y" | "no-repeat" | "repeat" | undefined;
41
+ get backgroundSize(): string | undefined;
42
+ get backgroundPosition(): string | undefined;
43
+ get border(): string;
44
+ get borderWidth(): any;
45
+ get borderLeftWidth(): any;
46
+ get borderRightWidth(): any;
47
+ get borderTopWidth(): any;
48
+ get borderBottomWidth(): any;
49
+ get borderColor(): any;
50
+ get borderLeftColor(): any;
51
+ get borderRightColor(): any;
52
+ get borderTopColor(): any;
53
+ get borderBottomColor(): any;
54
+ get borderStyle(): string;
55
+ get borderLeftStyle(): string;
56
+ get borderRightStyle(): string;
57
+ get borderTopStyle(): string;
58
+ get borderBottomStyle(): string;
59
+ get borderRadius(): any;
60
+ get borderTopLeftRadius(): any;
61
+ get borderTopRightRadius(): any;
62
+ get borderBottomLeftRadius(): any;
63
+ get borderBottomRightRadius(): any;
64
+ get zIndex(): number | undefined;
65
+ get opacity(): any;
66
+ get overflow(): "visible" | "hidden";
67
+ get focus(): boolean;
68
+ get color(): any;
69
+ get fontSize(): any;
70
+ get fontWeight(): any;
71
+ get fontStyle(): "" | "normal" | "italic";
72
+ get fontFamily(): any;
73
+ get textAlign(): "" | "center" | "left" | "right";
74
+ get verticalAlign(): "" | "bottom" | "middle" | "top";
75
+ get lineHeight(): any;
76
+ get letterSpacing(): string | number | undefined;
77
+ get textDecoration(): "none" | "" | "underline" | "overline" | "line-through";
78
+ get textOverflow(): "none" | "clip" | "ellipsis" | "marquee" | undefined;
79
+ get WebkitLineClamp(): number;
80
+ get transform(): HarmonyType.Transform.Transform | undefined;
81
+ get transformOrigin(): HarmonyType.Transform.Origin | undefined;
82
+ get content(): any;
83
+ }
@@ -0,0 +1 @@
1
+ export { eventCenter, Events, EventsType } from '@tarojs/runtime/dist/runtime.esm';
@@ -0,0 +1 @@
1
+ export { env } from '@tarojs/runtime/dist/runtime.esm';
@@ -0,0 +1,22 @@
1
+ export * from './current';
2
+ export { hooks } from '@tarojs/shared';
3
+ export * from './bom/document';
4
+ export * from './bom/getComputedStyle';
5
+ export * from './bom/history';
6
+ export * from './bom/location';
7
+ export * from './bom/navigator';
8
+ export * from './bom/raf';
9
+ export * from './bom/URL';
10
+ export * from './bom/window';
11
+ export * from './dom/element';
12
+ export * from './dom/event';
13
+ export * from './dom/event-source';
14
+ export * from './dom/node';
15
+ export * from './dom/stylesheet';
16
+ export * from './dom/cssNesting';
17
+ export * from './env';
18
+ export * from './constant';
19
+ export * from './emitter/emitter';
20
+ export * from './utils';
21
+ export * from './interface';
22
+ export { Instance, PageProps, ReactPageComponent, ReactPageInstance, ReactAppInstance, PageLifeCycle, PageInstance, AppInstance, } from '@tarojs/runtime/dist/runtime.esm';
@@ -0,0 +1,9 @@
1
+ export interface EventOptions {
2
+ bubbles: boolean;
3
+ cancelable: boolean;
4
+ [x: string]: any;
5
+ }
6
+ export interface EventHandler<T = any, R = void> {
7
+ (...args: T[]): R;
8
+ _stop?: boolean;
9
+ }
@@ -0,0 +1,6 @@
1
+ export * from './event';
2
+ export { PageConfig, TFunc } from '@tarojs/runtime/dist/runtime.esm';
3
+ export type TaroAny = any;
4
+ export type TaroFunc = (...args: TaroAny[]) => TaroAny;
5
+ export type TaroIndent = string | number | boolean | undefined | null;
6
+ export type TaroObject = Record<string | number | symbol, TaroAny>;
@@ -0,0 +1,26 @@
1
+ import type { CSSProperties } from 'react';
2
+ import type { TaroElement } from '../dom/element/element';
3
+ import type { TaroNode } from '../dom/node';
4
+ export declare function isElement(node: TaroNode): node is TaroElement;
5
+ /**
6
+ * 往上寻找组件树直到 root,寻找是否有祖先组件绑定了同类型的事件
7
+ * @param node 当前组件
8
+ * @param type 事件类型
9
+ */
10
+ export declare function isParentBinded(node: TaroElement | null, type: string): boolean;
11
+ export declare function convertNumber2PX(value: number): string | number;
12
+ export declare function convertNumber2VP(value: number, unit?: string): string | number;
13
+ export declare function parseClasses(classNames?: string): string[];
14
+ export declare function calcStaticStyle(styleSheet: Record<string, CSSProperties>, classNames?: string): CSSProperties;
15
+ export declare function calcDynamicStyle(style: CSSProperties): CSSProperties;
16
+ export declare function __env__(safeAreaType: string, fallback?: string | number): string | number | undefined;
17
+ export declare function getPageScrollerOrNode(scrollerOrNode: any, page: any): any;
18
+ export declare function ObjectKeys(obj: object): string[];
19
+ export declare function ObjectAssign(...objects: any[]): any;
20
+ export declare function callFn(fn: any, ctx: any, ...args: any): any;
21
+ export declare function bindFn(fn: any, ctx: any, ...args: any): any;
22
+ export declare function findChildNodeWithDFS<T extends TaroElement = TaroElement>(node: TaroElement, selector: string | ((ele: T) => boolean), selectAll: true): T[] | null;
23
+ export declare function findChildNodeWithDFS<T extends TaroElement = TaroElement>(node: TaroElement, selector: string | ((ele: T) => boolean), selectAll?: false): T | null;
24
+ export declare function findChildNodeWithDFS<T extends TaroElement = TaroElement>(node: TaroElement, selector: string | ((ele: T) => boolean), selectAll: boolean): T[] | T | null;
25
+ export * from './info';
26
+ export * from './router';
@@ -0,0 +1,11 @@
1
+ import type { TaroElement } from '../dom/element/element';
2
+ export declare const AREA_CHANGE_EVENT_NAME = "areaChange";
3
+ export declare const VISIBLE_CHANGE_EVENT_NAME = "visibleChange";
4
+ export declare function createEventOnName(eventName: string): string;
5
+ export declare function createEventTapName(eventName: string): string;
6
+ export declare const disconnectEvent: (node: TaroElement, eventName: string) => null | undefined;
7
+ export declare function getComponentEventCallback(node: TaroElement, eventName: string, callback?: (data: any) => void): ((...eventResult: any[]) => void) | null;
8
+ export declare function setNodeEventCallbackAndTriggerComponentUpdate(node: TaroElement, eventName: string, callback: Function, isAsync?: boolean): Promise<void>;
9
+ export declare function bindAttributesCallback(node: TaroElement, _: string, callback: Function): void;
10
+ export declare function triggerAttributesCallback(node: any, attributeName: any): void;
11
+ export declare function initComponentNodeInfo(node: TaroElement): void;
@@ -0,0 +1 @@
1
+ export { addLeadingSlash, getCurrentPage, getHomePage, hasBasename, stripBasename, stripSuffix, stripTrailing } from '@tarojs/runtime/dist/runtime.esm';
@@ -0,0 +1,12 @@
1
+ /// <reference types="types/runtime" />
2
+ import type { AppInstance } from '@tarojs/runtime';
3
+ import type React from 'react';
4
+ interface IReactMeta {
5
+ PageContext: React.Context<string>;
6
+ R: typeof React;
7
+ Container: any;
8
+ }
9
+ export declare const ReactMeta: IReactMeta;
10
+ export declare function connectReactPage(R: typeof React, id: string, getCtx: () => any): (Page: any) => React.ComponentClass<any>;
11
+ export declare function createReactApp(App: any, react: any, dom: any, config?: any): AppInstance;
12
+ export {};
@@ -0,0 +1 @@
1
+ export declare function setReconciler(ReactDOM: any): void;
@@ -0,0 +1,5 @@
1
+ export declare const ON_SHOW = "onShow";
2
+ export declare const ON_HIDE = "onHide";
3
+ export declare const ON_LOAD = "onLoad";
4
+ export declare const ON_UNLOAD = "onUnload";
5
+ export declare const ON_READY = "onReady";