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

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 (176) 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 +1 -1
  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 +18 -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 +1 -1
  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/motion.ts +6 -0
  28. package/dist/apis/device/network.ts +26 -9
  29. package/dist/apis/device/nfc.ts +10 -0
  30. package/dist/apis/device/phone.ts +2 -1
  31. package/dist/apis/device/scan.ts +4 -0
  32. package/dist/apis/device/screen.ts +2 -1
  33. package/dist/apis/device/sms.ts +4 -0
  34. package/dist/apis/device/vibrate.ts +19 -11
  35. package/dist/apis/device/wifi.ts +15 -0
  36. package/dist/apis/ext/index.ts +5 -0
  37. package/dist/apis/files/index.ts +2 -1
  38. package/dist/apis/files/manager.ts +2 -1
  39. package/dist/apis/framework/index.ts +5 -6
  40. package/dist/apis/location/index.ts +61 -68
  41. package/dist/apis/media/EditorContext.ts +32 -0
  42. package/dist/apis/media/audio/index.ts +18 -0
  43. package/dist/apis/media/background-audio/index.ts +16 -0
  44. package/dist/apis/media/camera.ts +16 -0
  45. package/dist/apis/media/common.ts +2 -1
  46. package/dist/apis/media/{image.ts → image/index.ts} +3 -2
  47. package/dist/apis/media/index.ts +10 -0
  48. package/dist/apis/media/live.ts +5 -0
  49. package/dist/apis/media/map.ts +4 -0
  50. package/dist/apis/media/media-recorder.ts +4 -0
  51. package/dist/apis/media/recorder.ts +6 -0
  52. package/dist/apis/media/video/VideoContext.ts +19 -0
  53. package/dist/apis/media/{video.ts → video/index.ts} +12 -2
  54. package/dist/apis/media/video-decoder.ts +4 -0
  55. package/dist/apis/media/video-processing.ts +4 -0
  56. package/dist/apis/media/voip.ts +19 -0
  57. package/dist/apis/network/index.ts +3 -0
  58. package/dist/apis/network/mdns.ts +13 -0
  59. package/dist/apis/network/request.ts +2 -1
  60. package/dist/apis/network/tcp.ts +4 -0
  61. package/dist/apis/network/udp.ts +4 -0
  62. package/dist/apis/network/webSocket.ts +2 -6
  63. package/dist/apis/open-api/account.ts +4 -0
  64. package/dist/apis/open-api/address.ts +4 -0
  65. package/dist/apis/open-api/authorize.ts +5 -0
  66. package/dist/apis/open-api/card.ts +5 -0
  67. package/dist/apis/open-api/channels-live.ts +11 -0
  68. package/dist/apis/open-api/customer-service.ts +4 -0
  69. package/dist/apis/open-api/device-voip.ts +5 -0
  70. package/dist/apis/open-api/facial.ts +7 -0
  71. package/dist/apis/open-api/favorites.ts +5 -0
  72. package/dist/apis/open-api/group.ts +4 -0
  73. package/dist/apis/open-api/index.ts +20 -6
  74. package/dist/apis/open-api/invoice.ts +5 -0
  75. package/dist/apis/open-api/license-plate.ts +4 -0
  76. package/dist/apis/open-api/login.ts +6 -0
  77. package/dist/apis/open-api/my-miniprogram.ts +4 -0
  78. package/dist/apis/open-api/privacy.ts +7 -0
  79. package/dist/apis/open-api/red-package.ts +4 -0
  80. package/dist/apis/open-api/settings.ts +5 -0
  81. package/dist/apis/open-api/soter.ts +6 -0
  82. package/dist/apis/open-api/subscribe-message.ts +6 -0
  83. package/dist/apis/open-api/{user-info/index.ts → user-info.ts} +1 -16
  84. package/dist/apis/open-api/werun.ts +5 -0
  85. package/dist/apis/payment/index.ts +6 -0
  86. package/dist/apis/route/index.ts +4 -28
  87. package/dist/apis/share/index.ts +33 -0
  88. package/dist/apis/storage/background-fetch.ts +7 -0
  89. package/dist/apis/storage/cache-manager.ts +4 -0
  90. package/dist/apis/storage/index.ts +20 -18
  91. package/dist/apis/ui/{animation.ts → animation/animation.ts} +2 -2
  92. package/dist/apis/ui/animation/index.ts +7 -0
  93. package/dist/apis/ui/background.ts +2 -18
  94. package/dist/apis/ui/custom-component.ts +8 -0
  95. package/dist/apis/ui/fonts.ts +4 -0
  96. package/dist/apis/ui/index.ts +8 -10
  97. package/dist/apis/ui/interaction/index.ts +3 -0
  98. package/dist/apis/ui/menu.ts +4 -0
  99. package/dist/apis/ui/navigation-bar/index.ts +60 -21
  100. package/dist/apis/ui/pull-down-refresh.ts +1 -1
  101. package/dist/apis/{page → ui/scroll}/index.ts +27 -22
  102. package/dist/apis/ui/sticky.ts +4 -0
  103. package/dist/apis/{tabbar/index.ts → ui/tab-bar.ts} +3 -5
  104. package/dist/apis/ui/window.ts +20 -0
  105. package/dist/apis/utils/handler.ts +4 -4
  106. package/dist/apis/worker/index.ts +4 -0
  107. package/dist/apis/wxml/IntersectionObserver.ts +12 -21
  108. package/dist/apis/wxml/index.ts +5 -2
  109. package/dist/apis/wxml/nodesRef.ts +2 -2
  110. package/dist/apis/wxml/selectorQuery.ts +3 -4
  111. package/dist/components-harmony-ets/button.ets +90 -64
  112. package/dist/components-harmony-ets/checkbox.ets +53 -98
  113. package/dist/components-harmony-ets/form.ets +16 -112
  114. package/dist/components-harmony-ets/icon.ets +59 -46
  115. package/dist/components-harmony-ets/image.ets +15 -40
  116. package/dist/components-harmony-ets/innerHtml.ets +6 -74
  117. package/dist/components-harmony-ets/input.ets +58 -128
  118. package/dist/components-harmony-ets/label.ets +43 -69
  119. package/dist/components-harmony-ets/picker.ets +114 -137
  120. package/dist/components-harmony-ets/radio.ets +55 -103
  121. package/dist/components-harmony-ets/richText.ets +17 -41
  122. package/dist/components-harmony-ets/scrollView.ets +69 -101
  123. package/dist/components-harmony-ets/slider.ets +35 -58
  124. package/dist/components-harmony-ets/swiper.ets +24 -135
  125. package/dist/components-harmony-ets/switch.ets +25 -55
  126. package/dist/components-harmony-ets/text.ets +42 -46
  127. package/dist/components-harmony-ets/textArea.ets +39 -107
  128. package/dist/components-harmony-ets/utils/constant/style.ets +9 -6
  129. package/dist/components-harmony-ets/utils/flexManager.ets +3 -88
  130. package/dist/components-harmony-ets/utils/helper.ets +2 -62
  131. package/dist/components-harmony-ets/utils/index.ts +1 -1
  132. package/dist/components-harmony-ets/utils/styles.ets +6 -9
  133. package/dist/components-harmony-ets/video.ets +63 -92
  134. package/dist/components-harmony-ets/view.ets +65 -40
  135. package/dist/index.js +33 -4
  136. package/dist/index.js.map +1 -1
  137. package/dist/runtime-ets/bom/getComputedStyle.ts +1 -1
  138. package/dist/runtime-ets/dom/bind.ts +80 -0
  139. package/dist/runtime-ets/dom/class-list.ts +2 -4
  140. package/dist/runtime-ets/dom/comment.ts +1 -2
  141. package/dist/runtime-ets/dom/cssStyleDeclaration.ts +1 -1
  142. package/dist/runtime-ets/dom/dataSource.ts +64 -0
  143. package/dist/runtime-ets/dom/document.ts +14 -43
  144. package/dist/runtime-ets/dom/element/element.ts +162 -0
  145. package/dist/runtime-ets/dom/element/form.ts +397 -0
  146. package/dist/runtime-ets/dom/element/index.ts +89 -0
  147. package/dist/runtime-ets/dom/element/normal.ts +75 -0
  148. package/dist/runtime-ets/dom/element/scrollView.ts +14 -0
  149. package/dist/runtime-ets/dom/element/text.ts +17 -0
  150. package/dist/runtime-ets/dom/element/video.ts +49 -0
  151. package/dist/runtime-ets/dom/event.ts +24 -1
  152. package/dist/runtime-ets/dom/eventTarget.ts +2 -1
  153. package/dist/runtime-ets/dom/node.ts +74 -44
  154. package/dist/runtime-ets/dom/stylesheet/index.ts +136 -23
  155. package/dist/runtime-ets/dom/stylesheet/type.ts +4 -3
  156. package/dist/runtime-ets/dom/stylesheet/util.ts +71 -1
  157. package/dist/runtime-ets/index.ts +0 -1
  158. package/dist/runtime-ets/utils/bind.ts +3 -14
  159. package/dist/runtime-ets/utils/index.ts +12 -7
  160. package/dist/runtime-ets/utils/info.ts +22 -50
  161. package/dist/runtime-framework/react/app.ts +3 -6
  162. package/dist/runtime-framework/react/page.ts +2 -9
  163. package/dist/runtime-framework/solid/page.ts +0 -6
  164. package/dist/runtime-utils.js +1150 -339
  165. package/dist/runtime-utils.js.map +1 -1
  166. package/dist/runtime.js +1150 -339
  167. package/dist/runtime.js.map +1 -1
  168. package/package.json +8 -8
  169. package/types/runtime.d.ts +4 -0
  170. package/LICENSE +0 -160
  171. package/dist/components-harmony-ets/base.ets +0 -63
  172. package/dist/components-harmony-ets/element.ets +0 -223
  173. package/dist/components-harmony-ets/utils/constant/icon.ts +0 -19
  174. package/dist/runtime-ets/dom/element.ts +0 -457
  175. package/dist/runtime-ets/dom/text.ts +0 -19
  176. package/types/api.d.ts +0 -4
@@ -19,13 +19,12 @@ export function getEnv () {
19
19
  return ENV_TYPE.HARMONY
20
20
  }
21
21
 
22
- export const getCurrentInstance = () => Current
22
+ export { Current }
23
23
 
24
- export const nextTick = (cb: (...args: any[]) => any, ctx?: Record<string, any>) => {
25
- setTimeout(function () {
26
- ctx ? cb.call(ctx) : cb()
27
- }, 1)
28
- }
24
+ // TODO
25
+ export const getCurrentPages = () => []
26
+
27
+ export const getCurrentInstance = () => Current
29
28
 
30
29
  export const requirePlugin = temporarilyNotSupport('requirePlugin')
31
30
 
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck
1
2
  // HarmonyOS 文档: https://developer.harmonyos.com/cn/docs/documentation/doc-references/js-apis-geolocation-0000001199568865#section13752433138
2
3
  // WX 文档: https://developers.weixin.qq.com/miniprogram/dev/api/location/wx.onLocationChange.html
3
4
  // ✅ wx.offLocationChange
@@ -15,49 +16,20 @@
15
16
  // ❌ wx.startLocationUpdate
16
17
 
17
18
  import geoLocationManager from '@ohos.geoLocationManager'
18
- import Taro from '@tarojs/taro'
19
19
 
20
- import { callAsyncFail, callAsyncSuccess, validateParams } from '../utils'
20
+ import { callAsyncFail, callAsyncSuccess, temporarilyNotSupport, validateParams } from '../utils'
21
+ import { MethodHandler } from '../utils/handler'
21
22
 
22
- interface IGetOHOSGeolocationParams {
23
- type?: string
24
- altitude?: boolean
25
- isHighAccuracy?: boolean
26
- highAccuracyExpireTime?: number
27
- priority?: number // 数值为固定几种
28
- scenario?: number // 数值为固定几种
29
- maxAccuracy?: number // 表示精度信息,单位是米。
30
- timeoutMs?: number
31
- }
32
-
33
- interface ILocationRequest {
34
- priority?: number
35
- scenario?: number // 勘误:注意 Harmony OS 这个参数是必填
36
- timeInterval?: number
37
- distanceInterval?: number
38
- maxAccuracy?: number
39
- }
40
-
41
- interface ILocationSuccessDataOHOS {
42
- latitude: number
43
- longitude: number
44
- altitude: number
45
- accuracy: number
46
- speed: number
47
- timeStamp: number
48
- direction: number
49
- timeSinceBoot: number
50
- additions: Array<string>
51
- additionSize: number
52
- }
23
+ import type Taro from '@tarojs/taro/types'
53
24
 
54
- interface ILocationSuccessOHOS {
55
- code: number
56
- data: ILocationSuccessDataOHOS
57
- }
25
+ // 位置
26
+ export const stopLocationUpdate = /* @__PURE__ */ temporarilyNotSupport('stopLocationUpdate')
27
+ export const startLocationUpdateBackground = /* @__PURE__ */ temporarilyNotSupport('startLocationUpdateBackground')
28
+ export const startLocationUpdate = /* @__PURE__ */ temporarilyNotSupport('startLocationUpdate')
29
+ export const openLocation = /* @__PURE__ */ temporarilyNotSupport('openLocation')
58
30
 
59
- function formatLocation (location: ILocationSuccessDataOHOS) {
60
- const locationWX = {
31
+ function formatLocation (location: Location) {
32
+ const wxLocate = {
61
33
  latitude: location.latitude,
62
34
  longitude: location.longitude,
63
35
  altitude: location.altitude,
@@ -66,7 +38,7 @@ function formatLocation (location: ILocationSuccessDataOHOS) {
66
38
  verticalAccuracy: 0, // OHOS 不支持返回此参数,直接设置为默认值
67
39
  horizontalAccuracy: 0 // OHOS 不支持返回此参数,直接设置为默认值
68
40
  }
69
- return locationWX
41
+ return wxLocate
70
42
  }
71
43
  // TODO:增加参数校验
72
44
  // const getLocationSchema = {
@@ -84,19 +56,18 @@ export const getLocation: typeof Taro.getLocation = function (options = {}) {
84
56
  * 二者参数不一致
85
57
  */
86
58
  const { type, altitude, isHighAccuracy, highAccuracyExpireTime } = options
87
- const params: IGetOHOSGeolocationParams = {
88
- type,
89
- altitude,
90
- isHighAccuracy,
91
- highAccuracyExpireTime
92
- }
93
59
  try {
94
- return geoLocationManager.getCurrentLocation(params).then((location: ILocationSuccessOHOS) => {
60
+ return geoLocationManager.getCurrentLocation({
61
+ type,
62
+ altitude,
63
+ isHighAccuracy,
64
+ highAccuracyExpireTime
65
+ }).then((location: Location) => {
95
66
  if (location.code !== 0) {
96
67
  callAsyncFail(reject, location, options)
97
68
  } else {
98
- const locationWX = formatLocation(location.data)
99
- callAsyncSuccess(resolve, locationWX, options)
69
+ const wxLocate = formatLocation(location.data)
70
+ callAsyncSuccess(resolve, wxLocate, options)
100
71
  }
101
72
  }).catch(error => {
102
73
  callAsyncFail(reject, error, options)
@@ -108,26 +79,48 @@ export const getLocation: typeof Taro.getLocation = function (options = {}) {
108
79
  }
109
80
 
110
81
  export const onLocationChange: typeof Taro.onLocationChange = function (callback) {
111
- validateParams('onLocationChange', [callback], ['Function'])
112
- const requestInfo: ILocationRequest = {}
113
- geoLocationManager.on('locationChange', requestInfo, (location: ILocationSuccessDataOHOS) => {
114
- if (location) {
115
- const locationWX = formatLocation(location)
116
- callback(locationWX)
117
- }
118
- })
82
+ const name = 'onLocationChange'
83
+ const handle = new MethodHandler<Partial<Taro.onLocationChange.CallbackResult>>({ name, complete: callback })
84
+ try {
85
+ validateParams(name, [callback], ['Function'])
86
+ geoLocationManager.on('locationChange', {}, (location: Location) => {
87
+ if (location) {
88
+ const wxLocate = formatLocation(location)
89
+ callback(wxLocate)
90
+ }
91
+ })
92
+ } catch (error) {
93
+ handle.fail({
94
+ errMsg: error
95
+ })
96
+ }
119
97
  }
120
98
 
121
- export const offLocationChange: typeof Taro.offLocationChangeError = function (callback) {
122
- validateParams('offLocationChange', [callback], ['Function'])
123
- geoLocationManager.off('locationChange', (location: ILocationSuccessOHOS) => {
124
- const status = {
125
- errCode: 200,
126
- errMsg: location ? 'offLocationChange is off' : 'offLocationChange err'
127
- }
99
+ export const offLocationChange: typeof Taro.offLocationChange = function (callback) {
100
+ const name = 'offLocationChange'
101
+ const handle = new MethodHandler<Partial<Taro.onLocationChange.CallbackResult>>({ name, complete: callback })
102
+ try {
103
+ validateParams(name, [callback], ['Function'])
104
+ geoLocationManager.off('locationChange', (location: Location) => {
105
+ const status = {
106
+ errCode: 200,
107
+ errMsg: location ? 'offLocationChange is off' : 'offLocationChange err'
108
+ }
128
109
 
129
- if (callback) {
130
- callback(status)
131
- }
132
- })
110
+ if (callback) {
111
+ callback(status)
112
+ }
113
+ })
114
+ } catch (error) {
115
+ handle.fail({
116
+ errMsg: error
117
+ })
118
+ }
133
119
  }
120
+
121
+ export const onLocationChangeError = /* @__PURE__ */ temporarilyNotSupport('onLocationChangeError')
122
+ export const offLocationChangeError = /* @__PURE__ */ temporarilyNotSupport('offLocationChangeError')
123
+
124
+ export const choosePoi = /* @__PURE__ */ temporarilyNotSupport('choosePoi')
125
+ export const chooseLocation = /* @__PURE__ */ temporarilyNotSupport('chooseLocation')
126
+ export const getFuzzyLocation = /* @__PURE__ */ temporarilyNotSupport('getFuzzyLocation')
@@ -0,0 +1,32 @@
1
+ import { temporarilyNotSupport } from '../utils'
2
+
3
+ import type Taro from '@tarojs/taro/types'
4
+
5
+ // 富文本
6
+ export class EditorContext implements Taro.EditorContext {
7
+ blur = temporarilyNotSupport('EditorContext.blur')
8
+
9
+ clear = temporarilyNotSupport('EditorContext.clear')
10
+
11
+ format = temporarilyNotSupport('EditorContext.format')
12
+
13
+ getContents = temporarilyNotSupport('EditorContext.getContents')
14
+
15
+ getSelectionText = temporarilyNotSupport('EditorContext.getSelectionText')
16
+
17
+ insertDivider = temporarilyNotSupport('EditorContext.insertDivider')
18
+
19
+ insertImage = temporarilyNotSupport('EditorContext.insertImage')
20
+
21
+ insertText = temporarilyNotSupport('EditorContext.insertText')
22
+
23
+ redo = temporarilyNotSupport('EditorContext.redo')
24
+
25
+ removeFormat = temporarilyNotSupport('EditorContext.removeFormat')
26
+
27
+ scrollIntoView = temporarilyNotSupport('EditorContext.scrollIntoView')
28
+
29
+ setContents = temporarilyNotSupport('EditorContext.setContents')
30
+
31
+ undo = temporarilyNotSupport('EditorContext.undo')
32
+ }
@@ -0,0 +1,18 @@
1
+ import { temporarilyNotSupport } from '../../utils'
2
+
3
+ // 音频
4
+
5
+ export const stopVoice = /* @__PURE__ */ temporarilyNotSupport('stopVoice')
6
+ export const setInnerAudioOption = /* @__PURE__ */ temporarilyNotSupport('setInnerAudioOption')
7
+ export const playVoice = /* @__PURE__ */ temporarilyNotSupport('playVoice')
8
+ export const pauseVoice = /* @__PURE__ */ temporarilyNotSupport('pauseVoice')
9
+ export const getAvailableAudioSources = /* @__PURE__ */ temporarilyNotSupport('getAvailableAudioSources')
10
+ export const createWebAudioContext = /* @__PURE__ */ temporarilyNotSupport('createWebAudioContext')
11
+ export const createMediaAudioPlayer = /* @__PURE__ */ temporarilyNotSupport('createMediaAudioPlayer')
12
+
13
+ /**
14
+ * 创建内部 audio 上下文 InnerAudioContext 对象。
15
+ */
16
+ export const createInnerAudioContext = /* @__PURE__ */ temporarilyNotSupport('createInnerAudioContext')
17
+
18
+ export const createAudioContext = /* @__PURE__ */ temporarilyNotSupport('createAudioContext')
@@ -0,0 +1,16 @@
1
+ import { temporarilyNotSupport } from '../../utils'
2
+
3
+ // 背景音频
4
+ export const stopBackgroundAudio = /* @__PURE__ */ temporarilyNotSupport('stopBackgroundAudio')
5
+ export const seekBackgroundAudio = /* @__PURE__ */ temporarilyNotSupport('seekBackgroundAudio')
6
+ export const playBackgroundAudio = /* @__PURE__ */ temporarilyNotSupport('playBackgroundAudio')
7
+ export const pauseBackgroundAudio = /* @__PURE__ */ temporarilyNotSupport('pauseBackgroundAudio')
8
+ export const onBackgroundAudioStop = /* @__PURE__ */ temporarilyNotSupport('onBackgroundAudioStop')
9
+ export const onBackgroundAudioPlay = /* @__PURE__ */ temporarilyNotSupport('onBackgroundAudioPlay')
10
+ export const onBackgroundAudioPause = /* @__PURE__ */ temporarilyNotSupport('onBackgroundAudioPause')
11
+ export const getBackgroundAudioPlayerState = /* @__PURE__ */ temporarilyNotSupport('getBackgroundAudioPlayerState')
12
+
13
+ /**
14
+ * 获取全局唯一的背景音频管理器
15
+ */
16
+ export const getBackgroundAudioManager = /* @__PURE__ */ temporarilyNotSupport('getBackgroundAudioManager')
@@ -0,0 +1,16 @@
1
+ import { temporarilyNotSupport } from '../utils'
2
+
3
+ import type Taro from '@tarojs/taro/types'
4
+
5
+ // 相机
6
+ class CameraContext implements Taro.CameraContext {
7
+ onCameraFrame = temporarilyNotSupport('CameraContext.onCameraFrame') as unknown as Taro.CameraContext['onCameraFrame']
8
+ setZoom = temporarilyNotSupport('CameraContext.setZoom')
9
+ startRecord = temporarilyNotSupport('CameraContext.startRecord')
10
+ stopRecord = temporarilyNotSupport('CameraContext.stopRecord')
11
+ takePhoto = temporarilyNotSupport('CameraContext.takePhoto')
12
+ }
13
+
14
+ export const createCameraContext: typeof Taro.createCameraContext = (_?: string) => {
15
+ return new CameraContext()
16
+ }
@@ -4,10 +4,11 @@
4
4
  // ✅ wx.chooseMedia
5
5
 
6
6
  import mediaLibrary from '@ohos.multimedia.mediaLibrary'
7
- import Taro from '@tarojs/taro'
8
7
 
9
8
  import { callAsyncFail, callAsyncSuccess, validateParams } from '../utils'
10
9
 
10
+ import type Taro from '@tarojs/taro/types'
11
+
11
12
  interface IPreviewImagesOptionsOHOS {
12
13
  images: Array<string>
13
14
  index: number
@@ -12,9 +12,10 @@
12
12
  import picker from '@ohos.file.picker'
13
13
  import image from '@ohos.multimedia.image'
14
14
  import { isNull } from '@tarojs/shared'
15
- import Taro from '@tarojs/taro'
16
15
 
17
- import { callAsyncFail, callAsyncSuccess, temporarilyNotSupport, validateParams } from '../utils'
16
+ import { callAsyncFail, callAsyncSuccess, temporarilyNotSupport, validateParams } from '../../utils'
17
+
18
+ import type Taro from '@tarojs/taro/types'
18
19
 
19
20
  interface IPackingOptionOHOS {
20
21
  format: string
@@ -1,3 +1,13 @@
1
+ export * from './audio'
2
+ export * from './background-audio'
3
+ export * from './camera'
1
4
  export * from './common'
2
5
  export * from './image'
6
+ export * from './live'
7
+ export * from './map'
8
+ export * from './media-recorder'
9
+ export * from './recorder'
3
10
  export * from './video'
11
+ export * from './video-decoder'
12
+ export * from './video-processing'
13
+ export * from './voip'
@@ -0,0 +1,5 @@
1
+ import { temporarilyNotSupport } from '../utils'
2
+
3
+ // 实时音视频
4
+ export const createLivePusherContext = /* @__PURE__ */ temporarilyNotSupport('createLivePusherContext')
5
+ export const createLivePlayerContext = /* @__PURE__ */ temporarilyNotSupport('createLivePlayerContext')
@@ -0,0 +1,4 @@
1
+ import { temporarilyNotSupport } from '../utils'
2
+
3
+ // 地图
4
+ export const createMapContext = /* @__PURE__ */ temporarilyNotSupport('createMapContext')
@@ -0,0 +1,4 @@
1
+ import { temporarilyNotSupport } from '../utils'
2
+
3
+ // 画面录制器
4
+ export const createMediaRecorder = /* @__PURE__ */ temporarilyNotSupport('createMediaRecorder')
@@ -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,19 @@
1
+ import { temporarilyNotSupport } from '../../utils'
2
+
3
+ import type Taro from '@tarojs/taro/types'
4
+
5
+ export class VideoContext implements Taro.VideoContext {
6
+ exitBackgroundPlayback = temporarilyNotSupport('VideoContext.exitBackgroundPlayback')
7
+ exitFullScreen = temporarilyNotSupport('VideoContext.exitFullScreen')
8
+ exitPictureInPicture = temporarilyNotSupport('VideoContext.exitPictureInPicture')
9
+ hideStatusBar = temporarilyNotSupport('VideoContext.hideStatusBar')
10
+ pause = temporarilyNotSupport('VideoContext.pause')
11
+ play = temporarilyNotSupport('VideoContext.play')
12
+ playbackRate = temporarilyNotSupport('VideoContext.playbackRate')
13
+ requestBackgroundPlayback = temporarilyNotSupport('VideoContext.requestBackgroundPlayback')
14
+ requestFullScreen = temporarilyNotSupport('VideoContext.requestFullScreen')
15
+ seek = temporarilyNotSupport('VideoContext.seek')
16
+ sendDanmu = temporarilyNotSupport('VideoContext.sendDanmu')
17
+ showStatusBar = temporarilyNotSupport('VideoContext.showStatusBar')
18
+ stop = temporarilyNotSupport('VideoContext.stop')
19
+ }
@@ -22,9 +22,11 @@
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 Taro from '@tarojs/taro/types'
28
30
 
29
31
  interface IChooseVideoOptionOHOS {
30
32
  type: string
@@ -41,6 +43,10 @@ const saveVideoToPhotosAlbumSchema = {
41
43
  filePath: 'String'
42
44
  }
43
45
 
46
+ export const createVideoContext: typeof Taro.createVideoContext = () => {
47
+ return new VideoContext()
48
+ }
49
+
44
50
  // TODO: 1.返回属性补全
45
51
  // TODO: 2.只支持从相册选择,补充摄像头拍摄功能,需要HarmonyOS提供选择组件
46
52
  export const chooseVideo: typeof Taro.chooseVideo = function (options = {}) {
@@ -63,6 +69,10 @@ export const chooseVideo: typeof Taro.chooseVideo = function (options = {}) {
63
69
  })
64
70
  }
65
71
 
72
+ export const compressVideo = /* @__PURE__ */ temporarilyNotSupport('compressVideo')
73
+ export const getVideoInfo = /* @__PURE__ */ temporarilyNotSupport('getVideoInfo')
74
+ export const openVideoEditor = /* @__PURE__ */ temporarilyNotSupport('openVideoEditor')
75
+
66
76
  export const saveVideoToPhotosAlbum: typeof Taro.saveVideoToPhotosAlbum = function (options) {
67
77
  return new Promise((resolve, reject) => {
68
78
  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')
@@ -7,10 +7,11 @@
7
7
 
8
8
  import http from '@ohos.net.http'
9
9
  import { isString, isUndefined } from '@tarojs/shared'
10
- import Taro from '@tarojs/taro'
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 {
@@ -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')