@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.
- package/dist/apis/apis.ts +6 -2
- package/dist/apis/base/crypto.ts +4 -0
- package/dist/apis/base/debug.ts +5 -0
- package/dist/apis/base/index.ts +9 -1
- package/dist/apis/base/performance.ts +8 -0
- package/dist/apis/base/system.ts +1 -1
- package/dist/apis/base/update.ts +5 -0
- package/dist/apis/base/weapp/app-event.ts +75 -0
- package/dist/apis/base/weapp/life-cycle.ts +21 -0
- package/dist/apis/canvas/index.ts +18 -0
- package/dist/apis/data-analysis/index.ts +6 -0
- package/dist/apis/device/accelerometer.ts +2 -1
- package/dist/apis/device/accessibility.ts +4 -0
- package/dist/apis/device/battery.ts +2 -2
- package/dist/apis/device/bluetooth-ble.ts +19 -0
- package/dist/apis/device/bluetooth-peripheral.ts +6 -0
- package/dist/apis/device/bluetooth.ts +16 -0
- package/dist/apis/device/calendar.ts +5 -0
- package/dist/apis/device/clipboard.ts +1 -1
- package/dist/apis/device/compass.ts +21 -0
- package/dist/apis/device/contact.ts +5 -0
- package/dist/apis/device/crypto.ts +4 -0
- package/dist/apis/device/gyroscope.ts +7 -0
- package/dist/apis/device/iBeacon.ts +10 -0
- package/dist/apis/device/index.ts +15 -0
- package/dist/apis/device/keyboard.ts +2 -1
- package/dist/apis/device/motion.ts +6 -0
- package/dist/apis/device/network.ts +26 -9
- package/dist/apis/device/nfc.ts +10 -0
- package/dist/apis/device/phone.ts +2 -1
- package/dist/apis/device/scan.ts +4 -0
- package/dist/apis/device/screen.ts +2 -1
- package/dist/apis/device/sms.ts +4 -0
- package/dist/apis/device/vibrate.ts +19 -11
- package/dist/apis/device/wifi.ts +15 -0
- package/dist/apis/ext/index.ts +5 -0
- package/dist/apis/files/index.ts +2 -1
- package/dist/apis/files/manager.ts +2 -1
- package/dist/apis/framework/index.ts +5 -6
- package/dist/apis/location/index.ts +61 -68
- package/dist/apis/media/EditorContext.ts +32 -0
- package/dist/apis/media/audio/index.ts +18 -0
- package/dist/apis/media/background-audio/index.ts +16 -0
- package/dist/apis/media/camera.ts +16 -0
- package/dist/apis/media/common.ts +2 -1
- package/dist/apis/media/{image.ts → image/index.ts} +3 -2
- package/dist/apis/media/index.ts +10 -0
- package/dist/apis/media/live.ts +5 -0
- package/dist/apis/media/map.ts +4 -0
- package/dist/apis/media/media-recorder.ts +4 -0
- package/dist/apis/media/recorder.ts +6 -0
- package/dist/apis/media/video/VideoContext.ts +19 -0
- package/dist/apis/media/{video.ts → video/index.ts} +12 -2
- package/dist/apis/media/video-decoder.ts +4 -0
- package/dist/apis/media/video-processing.ts +4 -0
- package/dist/apis/media/voip.ts +19 -0
- package/dist/apis/network/index.ts +3 -0
- package/dist/apis/network/mdns.ts +13 -0
- package/dist/apis/network/request.ts +2 -1
- package/dist/apis/network/tcp.ts +4 -0
- package/dist/apis/network/udp.ts +4 -0
- package/dist/apis/network/webSocket.ts +2 -6
- package/dist/apis/open-api/account.ts +4 -0
- package/dist/apis/open-api/address.ts +4 -0
- package/dist/apis/open-api/authorize.ts +5 -0
- package/dist/apis/open-api/card.ts +5 -0
- package/dist/apis/open-api/channels-live.ts +11 -0
- package/dist/apis/open-api/customer-service.ts +4 -0
- package/dist/apis/open-api/device-voip.ts +5 -0
- package/dist/apis/open-api/facial.ts +7 -0
- package/dist/apis/open-api/favorites.ts +5 -0
- package/dist/apis/open-api/group.ts +4 -0
- package/dist/apis/open-api/index.ts +20 -6
- package/dist/apis/open-api/invoice.ts +5 -0
- package/dist/apis/open-api/license-plate.ts +4 -0
- package/dist/apis/open-api/login.ts +6 -0
- package/dist/apis/open-api/my-miniprogram.ts +4 -0
- package/dist/apis/open-api/privacy.ts +7 -0
- package/dist/apis/open-api/red-package.ts +4 -0
- package/dist/apis/open-api/settings.ts +5 -0
- package/dist/apis/open-api/soter.ts +6 -0
- package/dist/apis/open-api/subscribe-message.ts +6 -0
- package/dist/apis/open-api/{user-info/index.ts → user-info.ts} +1 -16
- package/dist/apis/open-api/werun.ts +5 -0
- package/dist/apis/payment/index.ts +6 -0
- package/dist/apis/route/index.ts +4 -28
- package/dist/apis/share/index.ts +33 -0
- package/dist/apis/storage/background-fetch.ts +7 -0
- package/dist/apis/storage/cache-manager.ts +4 -0
- package/dist/apis/storage/index.ts +20 -18
- package/dist/apis/ui/{animation.ts → animation/animation.ts} +2 -2
- package/dist/apis/ui/animation/index.ts +7 -0
- package/dist/apis/ui/background.ts +2 -18
- package/dist/apis/ui/custom-component.ts +8 -0
- package/dist/apis/ui/fonts.ts +4 -0
- package/dist/apis/ui/index.ts +8 -10
- package/dist/apis/ui/interaction/index.ts +3 -0
- package/dist/apis/ui/menu.ts +4 -0
- package/dist/apis/ui/navigation-bar/index.ts +60 -21
- package/dist/apis/ui/pull-down-refresh.ts +1 -1
- package/dist/apis/{page → ui/scroll}/index.ts +27 -22
- package/dist/apis/ui/sticky.ts +4 -0
- package/dist/apis/{tabbar/index.ts → ui/tab-bar.ts} +3 -5
- package/dist/apis/ui/window.ts +20 -0
- package/dist/apis/utils/handler.ts +4 -4
- package/dist/apis/worker/index.ts +4 -0
- package/dist/apis/wxml/IntersectionObserver.ts +12 -21
- package/dist/apis/wxml/index.ts +5 -2
- package/dist/apis/wxml/nodesRef.ts +2 -2
- package/dist/apis/wxml/selectorQuery.ts +3 -4
- package/dist/components-harmony-ets/button.ets +90 -64
- package/dist/components-harmony-ets/checkbox.ets +53 -98
- package/dist/components-harmony-ets/form.ets +16 -112
- package/dist/components-harmony-ets/icon.ets +59 -46
- package/dist/components-harmony-ets/image.ets +15 -40
- package/dist/components-harmony-ets/innerHtml.ets +6 -74
- package/dist/components-harmony-ets/input.ets +58 -128
- package/dist/components-harmony-ets/label.ets +43 -69
- package/dist/components-harmony-ets/picker.ets +114 -137
- package/dist/components-harmony-ets/radio.ets +55 -103
- package/dist/components-harmony-ets/richText.ets +17 -41
- package/dist/components-harmony-ets/scrollView.ets +69 -101
- package/dist/components-harmony-ets/slider.ets +35 -58
- package/dist/components-harmony-ets/swiper.ets +24 -135
- package/dist/components-harmony-ets/switch.ets +25 -55
- package/dist/components-harmony-ets/text.ets +42 -46
- package/dist/components-harmony-ets/textArea.ets +39 -107
- package/dist/components-harmony-ets/utils/constant/style.ets +9 -6
- package/dist/components-harmony-ets/utils/flexManager.ets +3 -88
- package/dist/components-harmony-ets/utils/helper.ets +2 -62
- package/dist/components-harmony-ets/utils/index.ts +1 -1
- package/dist/components-harmony-ets/utils/styles.ets +6 -9
- package/dist/components-harmony-ets/video.ets +63 -92
- package/dist/components-harmony-ets/view.ets +65 -40
- package/dist/index.js +33 -4
- package/dist/index.js.map +1 -1
- package/dist/runtime-ets/bom/getComputedStyle.ts +1 -1
- package/dist/runtime-ets/dom/bind.ts +80 -0
- package/dist/runtime-ets/dom/class-list.ts +2 -4
- package/dist/runtime-ets/dom/comment.ts +1 -2
- package/dist/runtime-ets/dom/cssStyleDeclaration.ts +1 -1
- package/dist/runtime-ets/dom/dataSource.ts +64 -0
- package/dist/runtime-ets/dom/document.ts +14 -43
- package/dist/runtime-ets/dom/element/element.ts +162 -0
- package/dist/runtime-ets/dom/element/form.ts +397 -0
- package/dist/runtime-ets/dom/element/index.ts +89 -0
- package/dist/runtime-ets/dom/element/normal.ts +75 -0
- package/dist/runtime-ets/dom/element/scrollView.ts +14 -0
- package/dist/runtime-ets/dom/element/text.ts +17 -0
- package/dist/runtime-ets/dom/element/video.ts +49 -0
- package/dist/runtime-ets/dom/event.ts +24 -1
- package/dist/runtime-ets/dom/eventTarget.ts +2 -1
- package/dist/runtime-ets/dom/node.ts +74 -44
- package/dist/runtime-ets/dom/stylesheet/index.ts +136 -23
- package/dist/runtime-ets/dom/stylesheet/type.ts +4 -3
- package/dist/runtime-ets/dom/stylesheet/util.ts +71 -1
- package/dist/runtime-ets/index.ts +0 -1
- package/dist/runtime-ets/utils/bind.ts +3 -14
- package/dist/runtime-ets/utils/index.ts +12 -7
- package/dist/runtime-ets/utils/info.ts +22 -50
- package/dist/runtime-framework/react/app.ts +3 -6
- package/dist/runtime-framework/react/page.ts +2 -9
- package/dist/runtime-framework/solid/page.ts +0 -6
- package/dist/runtime-utils.js +1150 -339
- package/dist/runtime-utils.js.map +1 -1
- package/dist/runtime.js +1150 -339
- package/dist/runtime.js.map +1 -1
- package/package.json +8 -8
- package/types/runtime.d.ts +4 -0
- package/LICENSE +0 -160
- package/dist/components-harmony-ets/base.ets +0 -63
- package/dist/components-harmony-ets/element.ets +0 -223
- package/dist/components-harmony-ets/utils/constant/icon.ts +0 -19
- package/dist/runtime-ets/dom/element.ts +0 -457
- package/dist/runtime-ets/dom/text.ts +0 -19
- 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
|
|
22
|
+
export { Current }
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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
|
-
|
|
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
|
-
|
|
55
|
-
|
|
56
|
-
|
|
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:
|
|
60
|
-
const
|
|
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
|
|
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(
|
|
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
|
|
99
|
-
callAsyncSuccess(resolve,
|
|
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
|
-
|
|
112
|
-
const
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
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.
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
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
|
-
|
|
130
|
-
|
|
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 '
|
|
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
|
package/dist/apis/media/index.ts
CHANGED
|
@@ -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,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 '
|
|
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,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')
|
|
@@ -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 {
|
|
@@ -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
|
-
|
|
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:
|
|
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,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,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')
|
|
@@ -1,7 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
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,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')
|