@tarojs/plugin-platform-harmony-ets 3.7.0-alpha.27 → 4.0.0-alpha.10

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 (239) hide show
  1. package/dist/apis/apis.ts +6 -2
  2. package/dist/apis/base/crypto.ts +4 -0
  3. package/dist/apis/base/debug.ts +5 -0
  4. package/dist/apis/base/index.ts +9 -1
  5. package/dist/apis/base/performance.ts +8 -0
  6. package/dist/apis/base/system.ts +74 -21
  7. package/dist/apis/base/update.ts +5 -0
  8. package/dist/apis/base/weapp/app-event.ts +75 -0
  9. package/dist/apis/base/weapp/life-cycle.ts +21 -0
  10. package/dist/apis/canvas/index.ts +27 -0
  11. package/dist/apis/data-analysis/index.ts +6 -0
  12. package/dist/apis/device/accelerometer.ts +2 -1
  13. package/dist/apis/device/accessibility.ts +4 -0
  14. package/dist/apis/device/battery.ts +2 -2
  15. package/dist/apis/device/bluetooth-ble.ts +19 -0
  16. package/dist/apis/device/bluetooth-peripheral.ts +6 -0
  17. package/dist/apis/device/bluetooth.ts +16 -0
  18. package/dist/apis/device/calendar.ts +5 -0
  19. package/dist/apis/device/clipboard.ts +17 -9
  20. package/dist/apis/device/compass.ts +21 -0
  21. package/dist/apis/device/contact.ts +5 -0
  22. package/dist/apis/device/crypto.ts +4 -0
  23. package/dist/apis/device/gyroscope.ts +7 -0
  24. package/dist/apis/device/iBeacon.ts +10 -0
  25. package/dist/apis/device/index.ts +15 -0
  26. package/dist/apis/device/keyboard.ts +2 -1
  27. package/dist/apis/device/memory.ts +10 -3
  28. package/dist/apis/device/motion.ts +6 -0
  29. package/dist/apis/device/network.ts +26 -9
  30. package/dist/apis/device/nfc.ts +10 -0
  31. package/dist/apis/device/phone.ts +2 -1
  32. package/dist/apis/device/scan.ts +4 -0
  33. package/dist/apis/device/screen.ts +2 -1
  34. package/dist/apis/device/sms.ts +4 -0
  35. package/dist/apis/device/vibrate.ts +19 -11
  36. package/dist/apis/device/wifi.ts +15 -0
  37. package/dist/apis/ext/index.ts +5 -0
  38. package/dist/apis/files/index.ts +2 -1
  39. package/dist/apis/files/manager.ts +2 -1
  40. package/dist/apis/framework/index.ts +3 -8
  41. package/dist/apis/index.ts +27 -17
  42. package/dist/apis/location/index.ts +61 -68
  43. package/dist/apis/media/EditorContext.ts +32 -0
  44. package/dist/apis/media/audio/index.ts +18 -0
  45. package/dist/apis/media/background-audio/index.ts +16 -0
  46. package/dist/apis/media/camera.ts +16 -0
  47. package/dist/apis/media/common.ts +2 -1
  48. package/dist/apis/media/{image.ts → image/index.ts} +4 -3
  49. package/dist/apis/media/index.ts +10 -0
  50. package/dist/apis/media/live.ts +5 -0
  51. package/dist/apis/media/map.ts +4 -0
  52. package/dist/apis/media/media-recorder.ts +4 -0
  53. package/dist/apis/media/recorder.ts +6 -0
  54. package/dist/apis/media/video/VideoContext.ts +68 -0
  55. package/dist/apis/media/{video.ts → video/index.ts} +13 -2
  56. package/dist/apis/media/video-decoder.ts +4 -0
  57. package/dist/apis/media/video-processing.ts +4 -0
  58. package/dist/apis/media/voip.ts +19 -0
  59. package/dist/apis/network/index.ts +3 -0
  60. package/dist/apis/network/mdns.ts +13 -0
  61. package/dist/apis/network/request.ts +7 -6
  62. package/dist/apis/network/tcp.ts +4 -0
  63. package/dist/apis/network/udp.ts +4 -0
  64. package/dist/apis/network/webSocket.ts +2 -6
  65. package/dist/apis/open-api/account.ts +4 -0
  66. package/dist/apis/open-api/address.ts +4 -0
  67. package/dist/apis/open-api/authorize.ts +5 -0
  68. package/dist/apis/open-api/card.ts +5 -0
  69. package/dist/apis/open-api/channels-live.ts +11 -0
  70. package/dist/apis/open-api/customer-service.ts +4 -0
  71. package/dist/apis/open-api/device-voip.ts +5 -0
  72. package/dist/apis/open-api/facial.ts +7 -0
  73. package/dist/apis/open-api/favorites.ts +5 -0
  74. package/dist/apis/open-api/group.ts +4 -0
  75. package/dist/apis/open-api/index.ts +20 -6
  76. package/dist/apis/open-api/invoice.ts +5 -0
  77. package/dist/apis/open-api/license-plate.ts +4 -0
  78. package/dist/apis/open-api/login.ts +6 -0
  79. package/dist/apis/open-api/my-miniprogram.ts +4 -0
  80. package/dist/apis/open-api/privacy.ts +7 -0
  81. package/dist/apis/open-api/red-package.ts +4 -0
  82. package/dist/apis/open-api/settings.ts +5 -0
  83. package/dist/apis/open-api/soter.ts +6 -0
  84. package/dist/apis/open-api/subscribe-message.ts +6 -0
  85. package/dist/apis/open-api/{user-info/index.ts → user-info.ts} +1 -16
  86. package/dist/apis/open-api/werun.ts +5 -0
  87. package/dist/apis/payment/index.ts +6 -0
  88. package/dist/apis/route/index.ts +19 -28
  89. package/dist/apis/share/index.ts +33 -0
  90. package/dist/apis/storage/background-fetch.ts +7 -0
  91. package/dist/apis/storage/cache-manager.ts +4 -0
  92. package/dist/apis/storage/index.ts +158 -88
  93. package/dist/apis/ui/{animation.ts → animation/animation.ts} +73 -31
  94. package/dist/apis/ui/animation/index.ts +7 -0
  95. package/dist/apis/ui/background.ts +4 -19
  96. package/dist/apis/ui/custom-component.ts +8 -0
  97. package/dist/apis/ui/fonts.ts +4 -0
  98. package/dist/apis/ui/index.ts +8 -10
  99. package/dist/apis/ui/interaction/index.ts +45 -59
  100. package/dist/apis/ui/menu.ts +4 -0
  101. package/dist/apis/ui/navigation-bar/index.ts +60 -21
  102. package/dist/apis/ui/pull-down-refresh.ts +10 -4
  103. package/dist/apis/{page → ui/scroll}/index.ts +32 -27
  104. package/dist/apis/ui/sticky.ts +4 -0
  105. package/dist/apis/{tabbar/index.ts → ui/tab-bar.ts} +6 -8
  106. package/dist/apis/ui/window.ts +20 -0
  107. package/dist/apis/utils/handler.ts +4 -4
  108. package/dist/apis/utils/index.ts +1 -1
  109. package/dist/apis/worker/index.ts +4 -0
  110. package/dist/apis/wxml/IntersectionObserver.ts +24 -25
  111. package/dist/apis/wxml/index.ts +7 -2
  112. package/dist/apis/wxml/nodesRef.ts +2 -2
  113. package/dist/apis/wxml/selectorQuery.ts +29 -17
  114. package/dist/components-harmony-ets/button.ets +106 -80
  115. package/dist/components-harmony-ets/canvas.ets +51 -0
  116. package/dist/components-harmony-ets/checkbox.ets +82 -148
  117. package/dist/components-harmony-ets/form.ets +45 -132
  118. package/dist/components-harmony-ets/icon.ets +66 -69
  119. package/dist/components-harmony-ets/image.ets +26 -61
  120. package/dist/components-harmony-ets/index.ets +92 -0
  121. package/dist/components-harmony-ets/innerHtml.ets +7 -70
  122. package/dist/components-harmony-ets/input.ets +60 -146
  123. package/dist/components-harmony-ets/label.ets +86 -92
  124. package/dist/components-harmony-ets/listView.ets +26 -0
  125. package/dist/components-harmony-ets/movableArea.ets +124 -0
  126. package/dist/components-harmony-ets/movableView.ets +93 -0
  127. package/dist/components-harmony-ets/navigationBar.ets +65 -0
  128. package/dist/components-harmony-ets/pageMeta.ets +94 -0
  129. package/dist/components-harmony-ets/picker.ets +172 -198
  130. package/dist/components-harmony-ets/progress.ets +52 -0
  131. package/dist/components-harmony-ets/pseudo.ets +80 -0
  132. package/dist/components-harmony-ets/radio.ets +85 -155
  133. package/dist/components-harmony-ets/richText.ets +15 -87
  134. package/dist/components-harmony-ets/scrollList.ets +94 -0
  135. package/dist/components-harmony-ets/scrollView.ets +81 -149
  136. package/dist/components-harmony-ets/slider.ets +47 -94
  137. package/dist/components-harmony-ets/stickySection.ets +42 -0
  138. package/dist/components-harmony-ets/style.ets +396 -0
  139. package/dist/components-harmony-ets/swiper.ets +51 -151
  140. package/dist/components-harmony-ets/switch.ets +35 -76
  141. package/dist/components-harmony-ets/{index.ts → tag.ts} +6 -0
  142. package/dist/components-harmony-ets/text.ets +131 -76
  143. package/dist/components-harmony-ets/textArea.ets +64 -140
  144. package/dist/components-harmony-ets/utils/AttributeManager.ets +1 -1
  145. package/dist/components-harmony-ets/utils/DynamicCenter.ts +4 -13
  146. package/dist/components-harmony-ets/utils/constant/style.ets +9 -6
  147. package/dist/components-harmony-ets/utils/flexManager.ets +68 -85
  148. package/dist/components-harmony-ets/utils/helper.ets +18 -65
  149. package/dist/components-harmony-ets/utils/htmlParser/HarmonyHTMLParser.ts +1 -2
  150. package/dist/components-harmony-ets/utils/htmlParser/index.ts +1 -1
  151. package/dist/components-harmony-ets/utils/index.ts +55 -51
  152. package/dist/components-harmony-ets/utils/styles.ets +177 -65
  153. package/dist/components-harmony-ets/video.ets +70 -116
  154. package/dist/components-harmony-ets/view.ets +58 -64
  155. package/dist/components-harmony-ets/webView.ets +56 -0
  156. package/dist/index.d.ts +152 -0
  157. package/dist/index.js +230 -60
  158. package/dist/index.js.map +1 -1
  159. package/dist/runtime-ets/bom/document.ts +6 -4
  160. package/dist/runtime-ets/bom/getComputedStyle.ts +2 -2
  161. package/dist/runtime-ets/bom/window.ts +9 -2
  162. package/dist/runtime-ets/current.ts +3 -0
  163. package/dist/runtime-ets/dom/bind.ts +96 -0
  164. package/dist/runtime-ets/dom/class-list.ts +4 -6
  165. package/dist/runtime-ets/dom/comment.ts +1 -2
  166. package/dist/runtime-ets/dom/cssNesting.ts +409 -0
  167. package/dist/runtime-ets/dom/cssStyleDeclaration.ts +30 -20
  168. package/dist/runtime-ets/dom/dataSource.ts +64 -0
  169. package/dist/runtime-ets/dom/document.ts +36 -51
  170. package/dist/runtime-ets/dom/element/canvas.ts +136 -0
  171. package/dist/runtime-ets/dom/element/element.ts +439 -0
  172. package/dist/runtime-ets/dom/element/form.ts +403 -0
  173. package/dist/runtime-ets/dom/element/index.ts +120 -0
  174. package/dist/runtime-ets/dom/element/movableArea.ts +11 -0
  175. package/dist/runtime-ets/dom/element/movableView.ts +242 -0
  176. package/dist/runtime-ets/dom/element/normal.ts +103 -0
  177. package/dist/runtime-ets/dom/element/progress.ts +11 -0
  178. package/dist/runtime-ets/dom/element/scrollView.ts +15 -0
  179. package/dist/runtime-ets/dom/element/text.ts +10 -0
  180. package/dist/runtime-ets/dom/element/video.ts +50 -0
  181. package/dist/runtime-ets/dom/element/webView.ts +68 -0
  182. package/dist/runtime-ets/dom/event.ts +26 -5
  183. package/dist/runtime-ets/dom/eventTarget.ts +3 -3
  184. package/dist/runtime-ets/dom/node.ts +114 -49
  185. package/dist/runtime-ets/dom/stylesheet/covertWeb2Hm.ts +805 -0
  186. package/dist/runtime-ets/dom/stylesheet/index.ts +122 -429
  187. package/dist/runtime-ets/dom/stylesheet/type.ts +93 -17
  188. package/dist/runtime-ets/dom/stylesheet/util.ts +145 -17
  189. package/dist/runtime-ets/index.ts +2 -3
  190. package/dist/runtime-ets/interface/event.ts +3 -2
  191. package/dist/runtime-ets/utils/index.ts +87 -17
  192. package/dist/runtime-ets/utils/info.ts +21 -47
  193. package/dist/runtime-framework/react/app.ts +20 -28
  194. package/dist/runtime-framework/react/hooks.ts +3 -4
  195. package/dist/runtime-framework/react/index.ts +1 -2
  196. package/dist/runtime-framework/react/native-page.ts +421 -0
  197. package/dist/runtime-framework/react/page.ts +5 -17
  198. package/dist/runtime-framework/solid/app.ts +25 -45
  199. package/dist/runtime-framework/solid/connect.ts +21 -3
  200. package/dist/runtime-framework/solid/hooks.ts +17 -12
  201. package/dist/runtime-framework/solid/index.ts +6 -2
  202. package/dist/runtime-framework/solid/page.ts +84 -36
  203. package/dist/runtime-framework/solid/reconciler/props.ts +70 -25
  204. package/dist/runtime-framework/solid/reconciler/render.ts +16 -6
  205. package/dist/runtime-framework/solid/reconciler/use.ts +0 -1
  206. package/dist/runtime-framework/solid/utils/index.ts +0 -2
  207. package/dist/runtime-utils.d.ts +827 -0
  208. package/dist/runtime-utils.js +1633 -549
  209. package/dist/runtime-utils.js.map +1 -1
  210. package/dist/runtime.d.ts +1 -0
  211. package/dist/runtime.js +1633 -549
  212. package/dist/runtime.js.map +1 -1
  213. package/index.js +3 -1
  214. package/package.json +14 -15
  215. package/static/media/cancel.svg +1 -0
  216. package/static/media/circle.svg +1 -0
  217. package/static/media/clear.svg +1 -0
  218. package/static/media/download.svg +1 -0
  219. package/static/media/info.svg +1 -0
  220. package/static/media/info_circle.svg +1 -0
  221. package/static/media/search.svg +1 -0
  222. package/static/media/success.svg +1 -0
  223. package/static/media/success_no_circle.svg +1 -0
  224. package/static/media/taro_arrow_left.svg +1 -0
  225. package/static/media/taro_home.svg +1 -0
  226. package/static/media/waiting.svg +1 -0
  227. package/static/media/warn.svg +1 -0
  228. package/types/harmony.d.ts +4 -0
  229. package/types/index.d.ts +4 -0
  230. package/types/runtime.d.ts +7 -1
  231. package/LICENSE +0 -160
  232. package/dist/components-harmony-ets/base.ets +0 -63
  233. package/dist/components-harmony-ets/element.ets +0 -223
  234. package/dist/components-harmony-ets/utils/constant/icon.ts +0 -19
  235. package/dist/runtime-ets/dom/element.ts +0 -457
  236. package/dist/runtime-ets/dom/text.ts +0 -19
  237. package/dist/runtime-ets/utils/bind.ts +0 -35
  238. package/types/api.d.ts +0 -4
  239. /package/dist/runtime-framework/solid/{contant.ts → constant.ts} +0 -0
@@ -0,0 +1,6 @@
1
+ import { temporarilyNotSupport } from '../utils'
2
+
3
+ // 录音
4
+ export const stopRecord = /* @__PURE__ */ temporarilyNotSupport('stopRecord')
5
+ export const startRecord = /* @__PURE__ */ temporarilyNotSupport('startRecord')
6
+ export const getRecorderManager = /* @__PURE__ */ temporarilyNotSupport('getRecorderManager')
@@ -0,0 +1,68 @@
1
+ // @ts-nocheck
2
+ import { document } from '@tarojs/runtime'
3
+
4
+ import { temporarilyNotSupport } from '../../utils'
5
+
6
+ import type { TaroVideoElement } from '@tarojs/runtime'
7
+ import type Taro from '@tarojs/taro/types'
8
+
9
+ export class VideoContext implements Taro.VideoContext {
10
+ id: string
11
+
12
+ video: TaroVideoElement
13
+
14
+ controller: VideoController
15
+
16
+ constructor (id: string) {
17
+ this.id = id
18
+ this.video = document.getElementById(id)
19
+
20
+ if (this.video) {
21
+ this.controller = this.video.controller
22
+ }
23
+ }
24
+
25
+ play () {
26
+ if (!this.controller) return
27
+
28
+ this.controller.play()
29
+ }
30
+
31
+ pause () {
32
+ if (!this.controller) return
33
+
34
+ this.controller.pause()
35
+ }
36
+
37
+ stop () {
38
+ if (!this.controller) return
39
+
40
+ this.controller.stop()
41
+ }
42
+
43
+ seek (position: number) {
44
+ if (!this.controller) return
45
+
46
+ this.controller.setCurrentTime(position)
47
+ }
48
+
49
+ requestFullScreen () {
50
+ if (!this.controller) return
51
+
52
+ this.controller.requestFullscreen(true)
53
+ }
54
+
55
+ exitFullScreen () {
56
+ if (!this.controller) return
57
+
58
+ this.controller.exitFullscreen()
59
+ }
60
+
61
+ requestBackgroundPlayback = temporarilyNotSupport('VideoContext.requestBackgroundPlayback')
62
+ exitBackgroundPlayback = temporarilyNotSupport('VideoContext.exitBackgroundPlayback')
63
+ exitPictureInPicture = temporarilyNotSupport('VideoContext.exitPictureInPicture')
64
+ hideStatusBar = temporarilyNotSupport('VideoContext.hideStatusBar')
65
+ playbackRate = temporarilyNotSupport('VideoContext.playbackRate')
66
+ sendDanmu = temporarilyNotSupport('VideoContext.sendDanmu')
67
+ showStatusBar = temporarilyNotSupport('VideoContext.showStatusBar')
68
+ }
@@ -22,9 +22,12 @@
22
22
  // ❌ VideoContext.stop
23
23
 
24
24
  import mediaLibrary from '@ohos.multimedia.mediaLibrary'
25
- import Taro from '@tarojs/taro'
26
25
 
27
- import { callAsyncFail, callAsyncSuccess, validateParams } from '../utils'
26
+ import { callAsyncFail, callAsyncSuccess, temporarilyNotSupport, validateParams } from '../../utils'
27
+ import { VideoContext } from './VideoContext'
28
+
29
+ import type { TaroAny } from '@tarojs/runtime'
30
+ import type Taro from '@tarojs/taro/types'
28
31
 
29
32
  interface IChooseVideoOptionOHOS {
30
33
  type: string
@@ -41,6 +44,10 @@ const saveVideoToPhotosAlbumSchema = {
41
44
  filePath: 'String'
42
45
  }
43
46
 
47
+ export const createVideoContext: typeof Taro.createVideoContext = (id: string, _: TaroAny) => {
48
+ return new VideoContext(id)
49
+ }
50
+
44
51
  // TODO: 1.返回属性补全
45
52
  // TODO: 2.只支持从相册选择,补充摄像头拍摄功能,需要HarmonyOS提供选择组件
46
53
  export const chooseVideo: typeof Taro.chooseVideo = function (options = {}) {
@@ -63,6 +70,10 @@ export const chooseVideo: typeof Taro.chooseVideo = function (options = {}) {
63
70
  })
64
71
  }
65
72
 
73
+ export const compressVideo = /* @__PURE__ */ temporarilyNotSupport('compressVideo')
74
+ export const getVideoInfo = /* @__PURE__ */ temporarilyNotSupport('getVideoInfo')
75
+ export const openVideoEditor = /* @__PURE__ */ temporarilyNotSupport('openVideoEditor')
76
+
66
77
  export const saveVideoToPhotosAlbum: typeof Taro.saveVideoToPhotosAlbum = function (options) {
67
78
  return new Promise((resolve, reject) => {
68
79
  try {
@@ -0,0 +1,4 @@
1
+ import { temporarilyNotSupport } from '../utils'
2
+
3
+ // 视频解码器
4
+ export const createVideoDecoder = /* @__PURE__ */ temporarilyNotSupport('createVideoDecoder')
@@ -0,0 +1,4 @@
1
+ import { temporarilyNotSupport } from '../utils'
2
+
3
+ // 音视频合成
4
+ export const createMediaContainer = /* @__PURE__ */ temporarilyNotSupport('createMediaContainer')
@@ -0,0 +1,19 @@
1
+ import { temporarilyNotSupport } from '../utils'
2
+
3
+ // 实时语音
4
+ export const updateVoIPChatMuteConfig = /* @__PURE__ */ temporarilyNotSupport('updateVoIPChatMuteConfig')
5
+ export const subscribeVoIPVideoMembers = /* @__PURE__ */ temporarilyNotSupport('subscribeVoIPVideoMembers')
6
+ export const setEnable1v1Chat = /* @__PURE__ */ temporarilyNotSupport('setEnable1v1Chat')
7
+ export const onVoIPVideoMembersChanged = /* @__PURE__ */ temporarilyNotSupport('onVoIPVideoMembersChanged')
8
+ export const onVoIPChatStateChanged = /* @__PURE__ */ temporarilyNotSupport('onVoIPChatStateChanged')
9
+ export const onVoIPChatSpeakersChanged = /* @__PURE__ */ temporarilyNotSupport('onVoIPChatSpeakersChanged')
10
+ export const onVoIPChatMembersChanged = /* @__PURE__ */ temporarilyNotSupport('onVoIPChatMembersChanged')
11
+ export const onVoIPChatInterrupted = /* @__PURE__ */ temporarilyNotSupport('onVoIPChatInterrupted')
12
+ export const offVoIPChatSpeakersChanged = /* @__PURE__ */ temporarilyNotSupport('offVoIPChatSpeakersChanged')
13
+ export const offVoIPVideoMembersChanged = /* @__PURE__ */ temporarilyNotSupport('offVoIPVideoMembersChanged')
14
+ export const offVoIPChatStateChanged = /* @__PURE__ */ temporarilyNotSupport('offVoIPChatStateChanged')
15
+ export const offVoIPChatMembersChanged = /* @__PURE__ */ temporarilyNotSupport('offVoIPChatMembersChanged')
16
+ export const offVoIPChatInterrupted = /* @__PURE__ */ temporarilyNotSupport('offVoIPChatInterrupted')
17
+ export const joinVoIPChat = /* @__PURE__ */ temporarilyNotSupport('joinVoIPChat')
18
+ export const join1v1Chat = /* @__PURE__ */ temporarilyNotSupport('join1v1Chat')
19
+ export const exitVoIPChat = /* @__PURE__ */ temporarilyNotSupport('exitVoIPChat')
@@ -1,4 +1,7 @@
1
1
  export * from './downloadFile'
2
+ export * from './mdns'
2
3
  export * from './request'
4
+ export * from './tcp'
5
+ export * from './udp'
3
6
  export * from './uploadFile'
4
7
  export * from './webSocket'
@@ -0,0 +1,13 @@
1
+ import { temporarilyNotSupport } from '../utils'
2
+
3
+ // mDNS
4
+ export const stopLocalServiceDiscovery = /* @__PURE__ */ temporarilyNotSupport('stopLocalServiceDiscovery')
5
+ export const startLocalServiceDiscovery = /* @__PURE__ */ temporarilyNotSupport('startLocalServiceDiscovery')
6
+ export const onLocalServiceResolveFail = /* @__PURE__ */ temporarilyNotSupport('onLocalServiceResolveFail')
7
+ export const onLocalServiceLost = /* @__PURE__ */ temporarilyNotSupport('onLocalServiceLost')
8
+ export const onLocalServiceFound = /* @__PURE__ */ temporarilyNotSupport('onLocalServiceFound')
9
+ export const onLocalServiceDiscoveryStop = /* @__PURE__ */ temporarilyNotSupport('onLocalServiceDiscoveryStop')
10
+ export const offLocalServiceResolveFail = /* @__PURE__ */ temporarilyNotSupport('offLocalServiceResolveFail')
11
+ export const offLocalServiceLost = /* @__PURE__ */ temporarilyNotSupport('offLocalServiceLost')
12
+ export const offLocalServiceFound = /* @__PURE__ */ temporarilyNotSupport('offLocalServiceFound')
13
+ export const offLocalServiceDiscoveryStop = /* @__PURE__ */ temporarilyNotSupport('offLocalServiceDiscoveryStop')
@@ -6,11 +6,12 @@
6
6
  // ✅ RequestTask.onHeadersReceived
7
7
 
8
8
  import http from '@ohos.net.http'
9
- import { isString, isUndefined } from '@tarojs/shared'
10
- import Taro from '@tarojs/taro'
9
+ import { isString } from '@tarojs/shared'
11
10
 
12
11
  import { callAsyncFail, callAsyncSuccess, validateParams } from '../utils'
13
12
 
13
+ import type Taro from '@tarojs/taro/types'
14
+
14
15
  const METHOD: string [] = ['OPTIONS', 'GET', 'HEAD', 'POST', 'PUT', 'DELETE', 'TRACE', 'CONNECT']
15
16
 
16
17
  interface IRequestResultOHOS {
@@ -58,10 +59,10 @@ export const request: typeof Taro.request = function (options) {
58
59
  }
59
60
 
60
61
  // 检查 Header 是否有 Referer
61
- if (isUndefined(header.Referer)) {
62
- const error = { errMsg: 'request fail parameter error: the header doesn‘t support Referer property' }
63
- callAsyncFail(reject, error, options)
64
- }
62
+ // if (isUndefined(header.Referer)) {
63
+ // const error = { errMsg: 'request fail parameter error: the header doesn‘t support Referer property' }
64
+ // callAsyncFail(reject, error, options)
65
+ // }
65
66
 
66
67
  // 检查 method 是否正确
67
68
  if (method) {
@@ -0,0 +1,4 @@
1
+ import { temporarilyNotSupport } from '../utils'
2
+
3
+ // TCP 通信
4
+ export const createTCPSocket = /* @__PURE__ */ temporarilyNotSupport('createTCPSocket')
@@ -0,0 +1,4 @@
1
+ import { temporarilyNotSupport } from '../utils'
2
+
3
+ // UDP 通信
4
+ export const createUDPSocket = /* @__PURE__ */ temporarilyNotSupport('createUDPSocket')
@@ -18,14 +18,10 @@
18
18
  // ❌ wx.closeSocket
19
19
 
20
20
  import webSocket from '@ohos.net.webSocket'
21
- import Taro from '@tarojs/taro'
22
21
 
23
22
  import { callAsyncFail, callAsyncSuccess, validateParams } from '../utils'
24
- import { IAsyncParams } from '../utils/types'
25
23
 
26
- interface ISendSocketOptions extends IAsyncParams {
27
- data: string
28
- }
24
+ import type Taro from '@tarojs/taro/types'
29
25
 
30
26
  const connectSocketSchema = {
31
27
  url: 'String'
@@ -108,7 +104,7 @@ export const connectSocket: typeof Taro.connectSocket = function (options) {
108
104
  onOpenCallback(!err ? value : err)
109
105
  })
110
106
  }
111
- SocketTaskWX.send = function (sendOptions: ISendSocketOptions) {
107
+ SocketTaskWX.send = function (sendOptions: Taro.SocketTask.SendOption) {
112
108
  return new Promise((resolve, reject) => {
113
109
  const { data } = sendOptions
114
110
  try {
@@ -0,0 +1,4 @@
1
+ import { temporarilyNotSupport } from '../utils'
2
+
3
+ // 帐号信息
4
+ export const getAccountInfoSync = /* @__PURE__ */ temporarilyNotSupport('getAccountInfoSync')
@@ -0,0 +1,4 @@
1
+ import { temporarilyNotSupport } from '../utils'
2
+
3
+ // 收货地址
4
+ export const chooseAddress = /* @__PURE__ */ temporarilyNotSupport('chooseAddress')
@@ -0,0 +1,5 @@
1
+ import { temporarilyNotSupport } from '../utils'
2
+
3
+ // 授权
4
+ export const authorizeForMiniProgram = /* @__PURE__ */ temporarilyNotSupport('authorizeForMiniProgram')
5
+ export const authorize = /* @__PURE__ */ temporarilyNotSupport('authorize')
@@ -0,0 +1,5 @@
1
+ import { temporarilyNotSupport } from '../utils'
2
+
3
+ // 卡券
4
+ export const openCard = /* @__PURE__ */ temporarilyNotSupport('openCard')
5
+ export const addCard = /* @__PURE__ */ temporarilyNotSupport('addCard')
@@ -0,0 +1,11 @@
1
+ import { temporarilyNotSupport } from '../utils'
2
+
3
+ // 视频号
4
+ export const reserveChannelsLive = /* @__PURE__ */ temporarilyNotSupport('reserveChannelsLive')
5
+ export const openChannelsUserProfile = /* @__PURE__ */ temporarilyNotSupport('openChannelsUserProfile')
6
+ export const openChannelsLive = /* @__PURE__ */ temporarilyNotSupport('openChannelsLive')
7
+ export const openChannelsEvent = /* @__PURE__ */ temporarilyNotSupport('openChannelsEvent')
8
+ export const openChannelsActivity = /* @__PURE__ */ temporarilyNotSupport('openChannelsActivity')
9
+ export const getChannelsShareKey = /* @__PURE__ */ temporarilyNotSupport('getChannelsShareKey')
10
+ export const getChannelsLiveNoticeInfo = /* @__PURE__ */ temporarilyNotSupport('getChannelsLiveNoticeInfo')
11
+ export const getChannelsLiveInfo = /* @__PURE__ */ temporarilyNotSupport('getChannelsLiveInfo')
@@ -0,0 +1,4 @@
1
+ import { temporarilyNotSupport } from '../utils'
2
+
3
+ // 微信客服
4
+ export const openCustomerServiceChat = /* @__PURE__ */ temporarilyNotSupport('openCustomerServiceChat')
@@ -0,0 +1,5 @@
1
+ import { temporarilyNotSupport } from '../utils'
2
+
3
+ // 设备(组)音视频通话
4
+ export const requestDeviceVoIP = /* @__PURE__ */ temporarilyNotSupport('requestDeviceVoIP')
5
+ export const getDeviceVoIPList = /* @__PURE__ */ temporarilyNotSupport('getDeviceVoIPList')
@@ -0,0 +1,7 @@
1
+ import { temporarilyNotSupport } from '../utils'
2
+
3
+ // 过往接口
4
+ export const checkIsSupportFacialRecognition = /* @__PURE__ */ temporarilyNotSupport('checkIsSupportFacialRecognition')
5
+ export const startFacialRecognitionVerify = /* @__PURE__ */ temporarilyNotSupport('startFacialRecognitionVerify')
6
+ export const startFacialRecognitionVerifyAndUploadVideo = /* @__PURE__ */ temporarilyNotSupport('startFacialRecognitionVerifyAndUploadVideo')
7
+ export const faceVerifyForPay = /* @__PURE__ */ temporarilyNotSupport('faceVerifyForPay')
@@ -0,0 +1,5 @@
1
+ import { temporarilyNotSupport } from '../utils'
2
+
3
+ // 收藏
4
+ export const addVideoToFavorites = /* @__PURE__ */ temporarilyNotSupport('addVideoToFavorites')
5
+ export const addFileToFavorites = /* @__PURE__ */ temporarilyNotSupport('addFileToFavorites')
@@ -0,0 +1,4 @@
1
+ import { temporarilyNotSupport } from '../utils'
2
+
3
+ // 微信群
4
+ export const getGroupEnterInfo = /* @__PURE__ */ temporarilyNotSupport('getGroupEnterInfo')
@@ -1,7 +1,21 @@
1
- import { temporarilyNotSupport } from '../utils'
2
-
3
- export const login = temporarilyNotSupport('login')
4
- export const getAccountInfoSync = temporarilyNotSupport('getAccountInfoSync')
5
- export const requestSubscribeMessage = temporarilyNotSupport('requestSubscribeMessage')
6
-
1
+ export * from './account'
2
+ export * from './address'
3
+ export * from './authorize'
4
+ export * from './card'
5
+ export * from './channels-live'
6
+ export * from './customer-service'
7
+ export * from './device-voip'
8
+ export * from './facial'
9
+ export * from './favorites'
10
+ export * from './group'
11
+ export * from './invoice'
12
+ export * from './license-plate'
13
+ export * from './login'
14
+ export * from './my-miniprogram'
15
+ export * from './privacy'
16
+ export * from './red-package'
17
+ export * from './settings'
18
+ export * from './soter'
19
+ export * from './subscribe-message'
7
20
  export * from './user-info'
21
+ export * from './werun'
@@ -0,0 +1,5 @@
1
+ import { temporarilyNotSupport } from '../utils'
2
+
3
+ // 发票
4
+ export const chooseInvoiceTitle = /* @__PURE__ */ temporarilyNotSupport('chooseInvoiceTitle')
5
+ export const chooseInvoice = /* @__PURE__ */ temporarilyNotSupport('chooseInvoice')
@@ -0,0 +1,4 @@
1
+ import { temporarilyNotSupport } from '../utils'
2
+
3
+ // 车牌
4
+ export const chooseLicensePlate = /* @__PURE__ */ temporarilyNotSupport('chooseLicensePlate')
@@ -0,0 +1,6 @@
1
+ import { temporarilyNotSupport } from '../utils'
2
+
3
+ // 帐号信息
4
+ export const pluginLogin = /* @__PURE__ */ temporarilyNotSupport('pluginLogin')
5
+ export const login = /* @__PURE__ */ temporarilyNotSupport('login')
6
+ export const checkSession = /* @__PURE__ */ temporarilyNotSupport('checkSession')
@@ -0,0 +1,4 @@
1
+ import { temporarilyNotSupport } from '../utils'
2
+
3
+ // 我的小程序
4
+ export const checkIsAddedToMyMiniProgram = /* @__PURE__ */ temporarilyNotSupport('checkIsAddedToMyMiniProgram')
@@ -0,0 +1,7 @@
1
+ import { temporarilyNotSupport } from '../utils'
2
+
3
+ // 隐私信息授权
4
+ export const requirePrivacyAuthorize = /* @__PURE__ */ temporarilyNotSupport('requirePrivacyAuthorize')
5
+ export const openPrivacyContract = /* @__PURE__ */ temporarilyNotSupport('openPrivacyContract')
6
+ export const onNeedPrivacyAuthorization = /* @__PURE__ */ temporarilyNotSupport('onNeedPrivacyAuthorization')
7
+ export const getPrivacySetting = /* @__PURE__ */ temporarilyNotSupport('getPrivacySetting')
@@ -0,0 +1,4 @@
1
+ import { temporarilyNotSupport } from '../utils'
2
+
3
+ // 微信红包
4
+ export const showRedPackage = /* @__PURE__ */ temporarilyNotSupport('showRedPackage')
@@ -0,0 +1,5 @@
1
+ import { temporarilyNotSupport } from '../utils'
2
+
3
+ // 设置
4
+ export const openSetting = /* @__PURE__ */ temporarilyNotSupport('openSetting')
5
+ export const getSetting = /* @__PURE__ */ temporarilyNotSupport('getSetting')
@@ -0,0 +1,6 @@
1
+ import { temporarilyNotSupport } from '../utils'
2
+
3
+ // 生物认证
4
+ export const startSoterAuthentication = /* @__PURE__ */ temporarilyNotSupport('startSoterAuthentication')
5
+ export const checkIsSupportSoterAuthentication = /* @__PURE__ */ temporarilyNotSupport('checkIsSupportSoterAuthentication')
6
+ export const checkIsSoterEnrolledInDevice = /* @__PURE__ */ temporarilyNotSupport('checkIsSoterEnrolledInDevice')
@@ -0,0 +1,6 @@
1
+ import { temporarilyNotSupport } from '../utils'
2
+
3
+ // 订阅消息
4
+ export const requestSubscribeMessage = /* @__PURE__ */ temporarilyNotSupport('requestSubscribeMessage')
5
+ // 订阅设备消息
6
+ export const requestSubscribeDeviceMessage = /* @__PURE__ */ temporarilyNotSupport('requestSubscribeDeviceMessage')
@@ -6,7 +6,7 @@
6
6
  */
7
7
 
8
8
  // import hmsJSAccount from '@hmscore/hms-jsb-account'
9
- import { temporarilyNotSupport } from '../../utils'
9
+ import { temporarilyNotSupport } from '../utils'
10
10
 
11
11
  /**
12
12
  * 通过Scope数组获取已登录的对应帐号信息(依赖login行为)
@@ -53,21 +53,6 @@ export const getUserProfile = temporarilyNotSupport('getUserProfile')
53
53
  // })
54
54
  // }
55
55
 
56
- /**
57
- * 提前向用户发起授权请求
58
- */
59
- export const authorize = temporarilyNotSupport('authorize')
60
-
61
- /**
62
- * 获取用户的当前设置
63
- */
64
- export const getSetting = temporarilyNotSupport('getSetting')
65
-
66
- /**
67
- * 调起客户端小程序设置界面
68
- */
69
- export const openSetting = temporarilyNotSupport('openSetting')
70
-
71
56
  // function generateUserInfo (hmsAuthInfo) {
72
57
  // const userInfo = {
73
58
  // nickName: String,
@@ -0,0 +1,5 @@
1
+ import { temporarilyNotSupport } from '../utils'
2
+
3
+ // 微信运动
4
+ export const shareToWeRun = /* @__PURE__ */ temporarilyNotSupport('shareToWeRun')
5
+ export const getWeRunData = /* @__PURE__ */ temporarilyNotSupport('getWeRunData')
@@ -0,0 +1,6 @@
1
+ import { temporarilyNotSupport } from '../utils'
2
+
3
+ // 支付
4
+ export const requestPayment = /* @__PURE__ */ temporarilyNotSupport('requestPayment')
5
+ export const requestPluginPayment = /* @__PURE__ */ temporarilyNotSupport('requestPluginPayment')
6
+ export const requestOrderPayment = /* @__PURE__ */ temporarilyNotSupport('requestOrderPayment')
@@ -1,28 +1,11 @@
1
1
  import router from '@ohos.router'
2
- // eslint-disable-next-line import/no-duplicates
3
- import { window } from '@tarojs/runtime'
4
- // eslint-disable-next-line import/no-duplicates
5
- import { eventCenter } from '@tarojs/runtime/dist/runtime.esm'
2
+ import { window } from '@tarojs/runtime' // eslint-disable-line import/no-duplicates
3
+ import { eventCenter } from '@tarojs/runtime/dist/runtime.esm' // eslint-disable-line import/no-duplicates
6
4
  import { queryToJson } from '@tarojs/shared'
7
5
 
8
6
  import { callAsyncFail, callAsyncSuccess } from '../utils'
9
- import { IAsyncParams } from '../utils/types'
10
7
 
11
- import type Taro from '@tarojs/api'
12
-
13
- const launchOptions: Taro.getLaunchOptionsSync.LaunchOptions = {
14
- path: '',
15
- query: {},
16
- scene: 0,
17
- shareTicket: '',
18
- referrerInfo: {}
19
- }
20
-
21
- function initLaunchOptions (options = {}) {
22
- Object.assign(launchOptions, options)
23
- }
24
-
25
- eventCenter.once('__taroRouterLaunch', initLaunchOptions)
8
+ import type Taro from '@tarojs/taro/types'
26
9
 
27
10
  const TARO_TABBAR_PAGE_PATH = 'taro_tabbar'
28
11
  function isTabPage (url: string): boolean {
@@ -33,6 +16,21 @@ function parseURL (raw = ''): [string, Record<string, unknown>] {
33
16
  const [urlStr, queryStr = ''] = raw.split('?')
34
17
  const query: Record<string, unknown> = queryToJson(queryStr)
35
18
  let url = urlStr.replace(/^\//, '')
19
+
20
+ // 处理相对路径
21
+ if (url.indexOf('.') === 0) {
22
+ const page = router.getState()
23
+ const parts = page.path.split('/')
24
+ parts.pop()
25
+ url.split('/').forEach((item) => {
26
+ if (item === '.') {
27
+ return
28
+ }
29
+ item === '..' ? parts.pop() : parts.push(item)
30
+ })
31
+ url = parts.join('/')
32
+ }
33
+
36
34
  if (isTabPage(url)) {
37
35
  query.$page = url
38
36
  url = TARO_TABBAR_PAGE_PATH
@@ -40,10 +38,6 @@ function parseURL (raw = ''): [string, Record<string, unknown>] {
40
38
  return [url, query]
41
39
  }
42
40
 
43
- // 生命周期
44
- export const getLaunchOptionsSync = () => launchOptions
45
- export const getEnterOptionsSync = () => launchOptions
46
-
47
41
  const getRouterFunc = (method): typeof Taro.navigateTo => {
48
42
  const methodName = method === 'navigateTo' ? 'pushUrl' : 'replaceUrl'
49
43
 
@@ -74,10 +68,7 @@ const getRouterFunc = (method): typeof Taro.navigateTo => {
74
68
  export const navigateTo = getRouterFunc('navigateTo')
75
69
  export const redirectTo = getRouterFunc('redirectTo')
76
70
 
77
- interface INavigateBackParams extends IAsyncParams {
78
- url?: string
79
- }
80
- export function navigateBack (options: INavigateBackParams): Promise<any> {
71
+ export function navigateBack (options: Taro.navigateBack.Option & { url?: string }): Promise<any> {
81
72
  return new Promise(resolve => {
82
73
  if (!options?.url) {
83
74
  router.back()
@@ -0,0 +1,33 @@
1
+ import { permanentlyNotSupport, temporarilyNotSupport } from '../utils'
2
+
3
+ // 转发
4
+
5
+ /** 更新转发属性 */
6
+ export const updateShareMenu = /* @__PURE__ */ temporarilyNotSupport('updateShareMenu')
7
+
8
+ /** 显示当前页面的转发按钮 */
9
+ export const showShareMenu = /* @__PURE__ */ temporarilyNotSupport('showShareMenu')
10
+
11
+ /** 打开分享图片弹窗,可以将图片发送给朋友、收藏或下载 */
12
+ export const showShareImageMenu = /* @__PURE__ */ temporarilyNotSupport('showShareImageMenu')
13
+
14
+ /** 转发视频到聊天 */
15
+ export const shareVideoMessage = /* @__PURE__ */ temporarilyNotSupport('shareVideoMessage')
16
+
17
+ /** 转发文件到聊天 */
18
+ export const shareFileMessage = /* @__PURE__ */ temporarilyNotSupport('shareFileMessage')
19
+
20
+ /** 监听用户点击右上角菜单的「复制链接」按钮时触发的事件 */
21
+ export const onCopyUrl = /* @__PURE__ */ temporarilyNotSupport('onCopyUrl')
22
+
23
+ /** 移除用户点击右上角菜单的「复制链接」按钮时触发的事件的监听函数 */
24
+ export const offCopyUrl = /* @__PURE__ */ temporarilyNotSupport('offCopyUrl')
25
+
26
+ /** 隐藏当前页面的转发按钮 */
27
+ export const hideShareMenu = /* @__PURE__ */ temporarilyNotSupport('hideShareMenu')
28
+
29
+ /** 获取转发详细信息 */
30
+ export const getShareInfo = /* @__PURE__ */ temporarilyNotSupport('getShareInfo')
31
+
32
+ /** 验证私密消息。 */
33
+ export const authPrivateMessage = /* @__PURE__ */ permanentlyNotSupport('authPrivateMessage')
@@ -0,0 +1,7 @@
1
+ import { temporarilyNotSupport } from '../utils'
2
+
3
+ // 周期性更新
4
+ export const setBackgroundFetchToken = /* @__PURE__ */ temporarilyNotSupport('setBackgroundFetchToken')
5
+ export const onBackgroundFetchData = /* @__PURE__ */ temporarilyNotSupport('onBackgroundFetchData')
6
+ export const getBackgroundFetchToken = /* @__PURE__ */ temporarilyNotSupport('getBackgroundFetchToken')
7
+ export const getBackgroundFetchData = /* @__PURE__ */ temporarilyNotSupport('getBackgroundFetchData')
@@ -0,0 +1,4 @@
1
+ import { temporarilyNotSupport } from '../utils'
2
+
3
+ // 周期性更新
4
+ export const createCacheManager = /* @__PURE__ */ temporarilyNotSupport('createCacheManager')