@tarojs/plugin-platform-harmony-cpp 4.0.8-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +270 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.js +1318 -0
- package/dist/runtime/apis/apis.ts +20 -0
- package/dist/runtime/apis/base/crypto.ts +4 -0
- package/dist/runtime/apis/base/debug.ts +5 -0
- package/dist/runtime/apis/base/index.ts +13 -0
- package/dist/runtime/apis/base/performance.ts +8 -0
- package/dist/runtime/apis/base/system.ts +181 -0
- package/dist/runtime/apis/base/update.ts +5 -0
- package/dist/runtime/apis/base/weapp/app-event.ts +75 -0
- package/dist/runtime/apis/base/weapp/life-cycle.ts +21 -0
- package/dist/runtime/apis/canvas/index.ts +27 -0
- package/dist/runtime/apis/data-analysis/index.ts +6 -0
- package/dist/runtime/apis/device/accelerometer.ts +79 -0
- package/dist/runtime/apis/device/accessibility.ts +4 -0
- package/dist/runtime/apis/device/battery.ts +24 -0
- package/dist/runtime/apis/device/bluetooth-ble.ts +19 -0
- package/dist/runtime/apis/device/bluetooth-peripheral.ts +6 -0
- package/dist/runtime/apis/device/bluetooth.ts +16 -0
- package/dist/runtime/apis/device/calendar.ts +5 -0
- package/dist/runtime/apis/device/clipboard.ts +85 -0
- package/dist/runtime/apis/device/compass.ts +21 -0
- package/dist/runtime/apis/device/contact.ts +5 -0
- package/dist/runtime/apis/device/crypto.ts +4 -0
- package/dist/runtime/apis/device/gyroscope.ts +77 -0
- package/dist/runtime/apis/device/iBeacon.ts +10 -0
- package/dist/runtime/apis/device/index.ts +24 -0
- package/dist/runtime/apis/device/keyboard.ts +63 -0
- package/dist/runtime/apis/device/memory.ts +11 -0
- package/dist/runtime/apis/device/motion.ts +6 -0
- package/dist/runtime/apis/device/network.ts +123 -0
- package/dist/runtime/apis/device/nfc.ts +10 -0
- package/dist/runtime/apis/device/phone.ts +44 -0
- package/dist/runtime/apis/device/scan.ts +4 -0
- package/dist/runtime/apis/device/screen.ts +80 -0
- package/dist/runtime/apis/device/sms.ts +4 -0
- package/dist/runtime/apis/device/vibrate.ts +32 -0
- package/dist/runtime/apis/device/wifi.ts +15 -0
- package/dist/runtime/apis/ext/index.ts +5 -0
- package/dist/runtime/apis/files/index.ts +136 -0
- package/dist/runtime/apis/files/manager.ts +942 -0
- package/dist/runtime/apis/framework/index.ts +48 -0
- package/dist/runtime/apis/harmony/task-pool.ts +39 -0
- package/dist/runtime/apis/index.ts +61 -0
- package/dist/runtime/apis/location/index.ts +133 -0
- package/dist/runtime/apis/media/EditorContext.ts +32 -0
- package/dist/runtime/apis/media/audio/index.ts +36 -0
- package/dist/runtime/apis/media/background-audio/index.ts +16 -0
- package/dist/runtime/apis/media/camera.ts +16 -0
- package/dist/runtime/apis/media/common.ts +58 -0
- package/dist/runtime/apis/media/image/index.ts +291 -0
- package/dist/runtime/apis/media/index.ts +13 -0
- package/dist/runtime/apis/media/live.ts +5 -0
- package/dist/runtime/apis/media/map.ts +4 -0
- package/dist/runtime/apis/media/media-recorder.ts +4 -0
- package/dist/runtime/apis/media/recorder.ts +6 -0
- package/dist/runtime/apis/media/video/VideoContext.ts +67 -0
- package/dist/runtime/apis/media/video/index.ts +45 -0
- package/dist/runtime/apis/media/video-decoder.ts +4 -0
- package/dist/runtime/apis/media/video-processing.ts +4 -0
- package/dist/runtime/apis/media/voip.ts +19 -0
- package/dist/runtime/apis/navigate/index.ts +8 -0
- package/dist/runtime/apis/network/downloadFile.ts +85 -0
- package/dist/runtime/apis/network/index.ts +7 -0
- package/dist/runtime/apis/network/mdns.ts +13 -0
- package/dist/runtime/apis/network/request.ts +140 -0
- package/dist/runtime/apis/network/tcp.ts +4 -0
- package/dist/runtime/apis/network/udp.ts +4 -0
- package/dist/runtime/apis/network/uploadFile.ts +105 -0
- package/dist/runtime/apis/network/webSocket.ts +126 -0
- package/dist/runtime/apis/open-api/account.ts +4 -0
- package/dist/runtime/apis/open-api/address.ts +4 -0
- package/dist/runtime/apis/open-api/authorize.ts +5 -0
- package/dist/runtime/apis/open-api/card.ts +5 -0
- package/dist/runtime/apis/open-api/channels-live.ts +11 -0
- package/dist/runtime/apis/open-api/customer-service.ts +4 -0
- package/dist/runtime/apis/open-api/device-voip.ts +5 -0
- package/dist/runtime/apis/open-api/facial.ts +7 -0
- package/dist/runtime/apis/open-api/favorites.ts +5 -0
- package/dist/runtime/apis/open-api/group.ts +4 -0
- package/dist/runtime/apis/open-api/index.ts +21 -0
- package/dist/runtime/apis/open-api/invoice.ts +5 -0
- package/dist/runtime/apis/open-api/license-plate.ts +4 -0
- package/dist/runtime/apis/open-api/login.ts +6 -0
- package/dist/runtime/apis/open-api/my-miniprogram.ts +4 -0
- package/dist/runtime/apis/open-api/privacy.ts +7 -0
- package/dist/runtime/apis/open-api/red-package.ts +4 -0
- package/dist/runtime/apis/open-api/settings.ts +5 -0
- package/dist/runtime/apis/open-api/soter.ts +6 -0
- package/dist/runtime/apis/open-api/subscribe-message.ts +6 -0
- package/dist/runtime/apis/open-api/user-info.ts +70 -0
- package/dist/runtime/apis/open-api/werun.ts +5 -0
- package/dist/runtime/apis/payment/index.ts +6 -0
- package/dist/runtime/apis/route/index.ts +88 -0
- package/dist/runtime/apis/share/index.ts +33 -0
- package/dist/runtime/apis/storage/background-fetch.ts +7 -0
- package/dist/runtime/apis/storage/cache-manager.ts +4 -0
- package/dist/runtime/apis/storage/index.ts +203 -0
- package/dist/runtime/apis/ui/animation/animation.ts +264 -0
- package/dist/runtime/apis/ui/animation/index.ts +7 -0
- package/dist/runtime/apis/ui/background.ts +20 -0
- package/dist/runtime/apis/ui/custom-component.ts +1 -0
- package/dist/runtime/apis/ui/fonts.ts +4 -0
- package/dist/runtime/apis/ui/index.ts +12 -0
- package/dist/runtime/apis/ui/interaction/index.ts +198 -0
- package/dist/runtime/apis/ui/menu.ts +4 -0
- package/dist/runtime/apis/ui/navigation-bar/index.ts +72 -0
- package/dist/runtime/apis/ui/pull-down-refresh.ts +47 -0
- package/dist/runtime/apis/ui/scroll/index.ts +82 -0
- package/dist/runtime/apis/ui/sticky.ts +4 -0
- package/dist/runtime/apis/ui/tab-bar.ts +144 -0
- package/dist/runtime/apis/ui/window.ts +20 -0
- package/dist/runtime/apis/utils/constant.ts +1 -0
- package/dist/runtime/apis/utils/handler.ts +117 -0
- package/dist/runtime/apis/utils/index.ts +105 -0
- package/dist/runtime/apis/utils/permissions.ts +6 -0
- package/dist/runtime/apis/utils/types.ts +12 -0
- package/dist/runtime/apis/utils/unit.ts +104 -0
- package/dist/runtime/apis/utils/validate.ts +87 -0
- package/dist/runtime/apis/worker/index.ts +4 -0
- package/dist/runtime/apis/wxml/index.ts +17 -0
- package/dist/runtime/apis/wxml/intersectionObserver.ts +100 -0
- package/dist/runtime/apis/wxml/nodesRef.ts +58 -0
- package/dist/runtime/apis/wxml/selectorQuery.ts +221 -0
- package/dist/runtime/apischunk/index.d.ts +1606 -0
- package/dist/runtime/apischunk/index.js +5054 -0
- package/dist/runtime/components/deprecated.ets +43 -0
- package/dist/runtime/components/index.ets +49 -0
- package/dist/runtime/components/innerHtml.ets +16 -0
- package/dist/runtime/components/navigationBar.ets +65 -0
- package/dist/runtime/components/pageMeta.ets +94 -0
- package/dist/runtime/components/richText.ets +24 -0
- package/dist/runtime/components/slider.ets +119 -0
- package/dist/runtime/components/style.ets +286 -0
- package/dist/runtime/components/switch.ets +73 -0
- package/dist/runtime/components/tag.ts +58 -0
- package/dist/runtime/components/utils/AttributeManager.ets +252 -0
- package/dist/runtime/components/utils/DynamicCenter.ts +41 -0
- package/dist/runtime/components/utils/constant/event.ets +25 -0
- package/dist/runtime/components/utils/constant/style.ets +91 -0
- package/dist/runtime/components/utils/events.ts +26 -0
- package/dist/runtime/components/utils/flexManager.ets +49 -0
- package/dist/runtime/components/utils/helper.ets +51 -0
- package/dist/runtime/components/utils/htmlParser/HarmonyHTMLParser.ts +100 -0
- package/dist/runtime/components/utils/htmlParser/index.ts +58 -0
- package/dist/runtime/components/utils/index.ts +77 -0
- package/dist/runtime/components/utils/styles.ets +41 -0
- package/dist/runtime/components/video.ets +119 -0
- package/dist/runtime/components/webView.ets +55 -0
- package/dist/runtime/components/xComponent.ets +89 -0
- package/dist/runtime/framework/app.ts +248 -0
- package/dist/runtime/framework/connect.ts +24 -0
- package/dist/runtime/framework/constant.ts +3 -0
- package/dist/runtime/framework/hooks.ts +100 -0
- package/dist/runtime/framework/index.ts +15 -0
- package/dist/runtime/framework/native-page.ts +511 -0
- package/dist/runtime/framework/page.ts +256 -0
- package/dist/runtime/framework/utils/index.ts +17 -0
- package/dist/runtime/framework/utils/is.ts +26 -0
- package/dist/runtime/framework-reconciler/componentTree.ts +81 -0
- package/dist/runtime/framework-reconciler/constant.ts +86 -0
- package/dist/runtime/framework-reconciler/domInput.ts +90 -0
- package/dist/runtime/framework-reconciler/event.ts +108 -0
- package/dist/runtime/framework-reconciler/index.ts +99 -0
- package/dist/runtime/framework-reconciler/inputValueTracking.ts +106 -0
- package/dist/runtime/framework-reconciler/props.ts +132 -0
- package/dist/runtime/framework-reconciler/reconciler.ts +202 -0
- package/dist/runtime/framework-reconciler/render.ts +139 -0
- package/dist/runtime/framework-reconciler/workTags.ts +53 -0
- package/dist/runtime/runtime-cpp/bom/URL.ts +2 -0
- package/dist/runtime/runtime-cpp/bom/document.ts +45 -0
- package/dist/runtime/runtime-cpp/bom/history.ts +1 -0
- package/dist/runtime/runtime-cpp/bom/location.ts +1 -0
- package/dist/runtime/runtime-cpp/bom/navigator.ts +1 -0
- package/dist/runtime/runtime-cpp/bom/raf.ts +1 -0
- package/dist/runtime/runtime-cpp/bom/window.ts +57 -0
- package/dist/runtime/runtime-cpp/constant.ts +29 -0
- package/dist/runtime/runtime-cpp/current.ts +48 -0
- package/dist/runtime/runtime-cpp/dom/class-list.ts +41 -0
- package/dist/runtime/runtime-cpp/dom/comment.ts +9 -0
- package/dist/runtime/runtime-cpp/dom/dataSource.ts +87 -0
- package/dist/runtime/runtime-cpp/dom/document.ts +113 -0
- package/dist/runtime/runtime-cpp/dom/element/canvas.ts +285 -0
- package/dist/runtime/runtime-cpp/dom/element/element.ts +262 -0
- package/dist/runtime/runtime-cpp/dom/element/form.ts +371 -0
- package/dist/runtime/runtime-cpp/dom/element/index.ts +129 -0
- package/dist/runtime/runtime-cpp/dom/element/movable.ts +250 -0
- package/dist/runtime/runtime-cpp/dom/element/normal.ts +123 -0
- package/dist/runtime/runtime-cpp/dom/element/scroll_view.ts +32 -0
- package/dist/runtime/runtime-cpp/dom/element/text.ts +9 -0
- package/dist/runtime/runtime-cpp/dom/element/video.ts +66 -0
- package/dist/runtime/runtime-cpp/dom/element/web_view.ts +72 -0
- package/dist/runtime/runtime-cpp/dom/event-source.ts +1 -0
- package/dist/runtime/runtime-cpp/dom/event.ts +187 -0
- package/dist/runtime/runtime-cpp/dom/eventTarget.ts +81 -0
- package/dist/runtime/runtime-cpp/dom/node.ts +307 -0
- package/dist/runtime/runtime-cpp/dom/style.ts +44 -0
- package/dist/runtime/runtime-cpp/dom/stylesheet/index.ts +379 -0
- package/dist/runtime/runtime-cpp/dom/stylesheet/type.ts +212 -0
- package/dist/runtime/runtime-cpp/dom/stylesheet/util.ts +186 -0
- package/dist/runtime/runtime-cpp/emitter/emitter.ts +29 -0
- package/dist/runtime/runtime-cpp/env.ts +1 -0
- package/dist/runtime/runtime-cpp/harmony-library.ts +1 -0
- package/dist/runtime/runtime-cpp/index.ts +79 -0
- package/dist/runtime/runtime-cpp/interface/event.ts +10 -0
- package/dist/runtime/runtime-cpp/interface/index.ts +7 -0
- package/dist/runtime/runtime-cpp/next-tick.ts +14 -0
- package/dist/runtime/runtime-cpp/system.ts +213 -0
- package/dist/runtime/runtime-cpp/utils/index.ts +63 -0
- package/dist/runtime/runtime-cpp/utils/info.ts +123 -0
- package/dist/runtime/runtime-cpp/utils/page.ts +12 -0
- package/dist/runtime/runtime-cpp/utils/router.ts +1 -0
- package/dist/runtime/runtime-harmony/apis/helper.ets +33 -0
- package/dist/runtime/runtime-harmony/apis/network/common.ets +41 -0
- package/dist/runtime/runtime-harmony/apis/network/downloadFile.ets +327 -0
- package/dist/runtime/runtime-harmony/apis/network/index.ets +58 -0
- package/dist/runtime/runtime-harmony/apis/network/request.ets +206 -0
- package/dist/runtime/runtime-harmony/apis/network/uploadFile.ets +190 -0
- package/dist/runtime/runtime-harmony/apis/route.ets +110 -0
- package/dist/runtime/runtime-harmony/apis/taskpool.ets +149 -0
- package/dist/runtime/runtime-harmony/index.ets +41 -0
- package/dist/runtime/runtime-harmony/utils.ts +53 -0
- package/index.js +4 -0
- package/package.json +93 -0
- package/static/@taro-oh/library-4.0.8-beta.3.har +0 -0
- package/types/compile.d.ts +50 -0
- package/types/components.d.ts +49 -0
- package/types/define.d.ts +61 -0
- package/types/harmony.d.ts +28 -0
- package/types/runtime.d.ts +66 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { TaroAny } from '@tarojs/runtime'
|
|
2
|
+
|
|
3
|
+
export function setParamFromObj (obj: Record<string, string | number>, params: TaroAny) {
|
|
4
|
+
if (!obj) return params
|
|
5
|
+
|
|
6
|
+
Object.keys(obj).forEach(key => {
|
|
7
|
+
params[key] = obj[key]
|
|
8
|
+
})
|
|
9
|
+
|
|
10
|
+
return params
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function assignObject (target: TaroAny, source: TaroAny) {
|
|
14
|
+
return Object.assign(target, source)
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function safeDecode (str) {
|
|
18
|
+
try {
|
|
19
|
+
return decodeURIComponent(str)
|
|
20
|
+
} catch (e) {
|
|
21
|
+
return str
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function queryToJson(str) {
|
|
26
|
+
const qp = str.split('&')
|
|
27
|
+
const ret = {}
|
|
28
|
+
let name
|
|
29
|
+
let val
|
|
30
|
+
for (let i = 0, l = qp.length, item; i < l; ++i) {
|
|
31
|
+
item = qp[i]
|
|
32
|
+
if (item.length) {
|
|
33
|
+
const s = item.indexOf('=')
|
|
34
|
+
if (s < 0) {
|
|
35
|
+
name = safeDecode(item)
|
|
36
|
+
val = ''
|
|
37
|
+
} else {
|
|
38
|
+
name = safeDecode(item.slice(0, s))
|
|
39
|
+
val = safeDecode(item.slice(s + 1))
|
|
40
|
+
}
|
|
41
|
+
if (typeof ret[name] === 'string') {
|
|
42
|
+
// inline'd type check
|
|
43
|
+
ret[name] = [ret[name]]
|
|
44
|
+
}
|
|
45
|
+
if (Array.isArray(ret[name])) {
|
|
46
|
+
ret[name].push(val)
|
|
47
|
+
} else {
|
|
48
|
+
ret[name] = val
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return ret // Object
|
|
53
|
+
}
|
package/index.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@tarojs/plugin-platform-harmony-cpp",
|
|
3
|
+
"version": "4.0.8-beta.3",
|
|
4
|
+
"description": "鸿蒙系统插件 C-API 版本",
|
|
5
|
+
"author": "O2Team",
|
|
6
|
+
"homepage": "https://gitee.com/openharmony-sig/taro",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"main": "index.js",
|
|
9
|
+
"keywords": [
|
|
10
|
+
"taro",
|
|
11
|
+
"harmony"
|
|
12
|
+
],
|
|
13
|
+
"files": [
|
|
14
|
+
"index.js",
|
|
15
|
+
"dist",
|
|
16
|
+
"static",
|
|
17
|
+
"types"
|
|
18
|
+
],
|
|
19
|
+
"types": "types/index.d.ts",
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "git+https://gitee.com/openharmony-sig/taro.git"
|
|
23
|
+
},
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"@babel/core": "^7.24.7",
|
|
26
|
+
"@babel/preset-env": "^7.24.4",
|
|
27
|
+
"@tarojs/parse-css-to-stylesheet": "^1.1.8",
|
|
28
|
+
"fast-glob": "^3.3.2",
|
|
29
|
+
"react": "^18.3.1",
|
|
30
|
+
"react-dom": "^18.3.1",
|
|
31
|
+
"react-reconciler": "0.29.0",
|
|
32
|
+
"scheduler": "^0.23.2",
|
|
33
|
+
"@tarojs/react": "4.0.8-beta.3",
|
|
34
|
+
"@tarojs/runner-utils": "4.0.8-beta.3",
|
|
35
|
+
"@tarojs/service": "4.0.8-beta.3"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"rollup": "^3.29.4",
|
|
39
|
+
"rollup-plugin-dts": "^6.2.1",
|
|
40
|
+
"rollup-plugin-node-externals": "^5.1.3",
|
|
41
|
+
"@rollup/plugin-commonjs": "^25.0.8",
|
|
42
|
+
"@rollup/plugin-json": "^6.1.0",
|
|
43
|
+
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
44
|
+
"@rollup/plugin-typescript": "^11.1.6",
|
|
45
|
+
"@types/conventional-commits-parser": "^3.0.0",
|
|
46
|
+
"conventional-commits-parser": "^3.0.0",
|
|
47
|
+
"postcss": "^8.4.38",
|
|
48
|
+
"prettier": "^2.8.8",
|
|
49
|
+
"solid-js": "^1.8.17",
|
|
50
|
+
"terser": "^5.31.1",
|
|
51
|
+
"ts-node": "^10.9.2",
|
|
52
|
+
"tsconfig-paths": "^3.15.0",
|
|
53
|
+
"tslib": "^2.6.3",
|
|
54
|
+
"typescript": "~5.4.5",
|
|
55
|
+
"vite": "^4.2.0",
|
|
56
|
+
"@tarojs/components": "4.0.8-beta.3",
|
|
57
|
+
"@tarojs/helper": "4.0.8-beta.3",
|
|
58
|
+
"@tarojs/plugin-framework-react": "4.0.8-beta.3",
|
|
59
|
+
"@tarojs/plugin-platform-harmony-ets": "4.0.8-beta.3",
|
|
60
|
+
"@tarojs/runtime": "4.0.8-beta.3",
|
|
61
|
+
"@tarojs/react": "4.0.8-beta.3",
|
|
62
|
+
"@tarojs/shared": "4.0.8-beta.3",
|
|
63
|
+
"rollup-plugin-copy": "4.0.8-beta.3",
|
|
64
|
+
"@tarojs/taro": "4.0.8-beta.3",
|
|
65
|
+
"@tarojs/vite-runner": "4.0.8-beta.3"
|
|
66
|
+
},
|
|
67
|
+
"peerDependencies": {
|
|
68
|
+
"less": "^4.2.0",
|
|
69
|
+
"sass": "^1.75.0",
|
|
70
|
+
"stylus": "^0.63.0",
|
|
71
|
+
"@tarojs/components": "4.0.8-beta.3",
|
|
72
|
+
"@tarojs/plugin-platform-harmony-ets": "4.0.8-beta.3",
|
|
73
|
+
"@tarojs/helper": "4.0.8-beta.3",
|
|
74
|
+
"@tarojs/react": "4.0.8-beta.3",
|
|
75
|
+
"@tarojs/shared": "4.0.8-beta.3",
|
|
76
|
+
"@tarojs/runtime": "4.0.8-beta.3",
|
|
77
|
+
"@tarojs/taro": "4.0.8-beta.3",
|
|
78
|
+
"@tarojs/vite-runner": "4.0.8-beta.3",
|
|
79
|
+
"@tarojs/plugin-framework-react": "4.0.8-beta.3"
|
|
80
|
+
},
|
|
81
|
+
"scripts": {
|
|
82
|
+
"prebuild": "rimraf --impl=move-remove dist",
|
|
83
|
+
"build": "pnpm run rollup",
|
|
84
|
+
"prod": "pnpm run build",
|
|
85
|
+
"build:library": "pnpm run tsx --files ./scripts/build",
|
|
86
|
+
"changelog": "pnpm run tsx --files ./scripts/ohpm-changelog",
|
|
87
|
+
"dev": "pnpm run rollup -w",
|
|
88
|
+
"ohpm-publish": "pnpm run tsx --files ./scripts/ohpm-publish",
|
|
89
|
+
"remove:reference": "pnpm run tsx --files ./scripts/reference",
|
|
90
|
+
"rollup": "rollup --config rollup.config.ts --configPlugin @rollup/plugin-typescript",
|
|
91
|
+
"tsx": "ts-node --skipIgnore"
|
|
92
|
+
}
|
|
93
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { TaroHarmonyPageMeta } from '@tarojs/vite-runner/dist/harmony/template/page'
|
|
2
|
+
|
|
3
|
+
import type AppParser from '@tarojs/vite-runner/dist/harmony/template/app'
|
|
4
|
+
import type PageParser from '@tarojs/vite-runner/dist/harmony/template/page'
|
|
5
|
+
import type RenderParser, { IChildComponent } from '@tarojs/vite-runner/dist/harmony/template/render'
|
|
6
|
+
|
|
7
|
+
declare module '@tarojs/taro/types/compile/viteCompilerContext' {
|
|
8
|
+
interface ViteHarmonyCompilerContext {
|
|
9
|
+
components?: TaroHarmonyPageMeta[]
|
|
10
|
+
|
|
11
|
+
extraComponents?: string[]
|
|
12
|
+
|
|
13
|
+
loaderMeta: {
|
|
14
|
+
modifyEntryFile?: (this: PageParser, scope: string, rawId: string, rawCode: string, page: TPageMeta) => void
|
|
15
|
+
modifyHarmonyRenderChild?: (this: RenderParser, list: IChildComponent[]) => void
|
|
16
|
+
modifyHarmonyRenderCode?: (this: RenderParser, code: string) => string
|
|
17
|
+
modifyInstantiate?: (this: AppParser | PageParser, code: string, type: string, page: TPageMeta) => string
|
|
18
|
+
enableParseJSXStyle?: boolean
|
|
19
|
+
parseJSXStyleMapCache?: WeakMap<ResolvedConfig, Map<string, string>>
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
declare module '@tarojs/taro/types/compile' {
|
|
25
|
+
interface IHarmonyConfig<T extends CompilerTypes = 'vite'> {
|
|
26
|
+
disableComponentReplace?: boolean
|
|
27
|
+
|
|
28
|
+
[key: string]: any
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
declare module '@tarojs/vite-runner/dist/harmony/template' {
|
|
33
|
+
import type Parser from '@tarojs/vite-runner/dist/harmony/template/page'
|
|
34
|
+
import type { TaroHarmonyPageMeta } from '@tarojs/vite-runner/dist/harmony/template/page'
|
|
35
|
+
|
|
36
|
+
declare class PageParser extends Parser {
|
|
37
|
+
public appPath: typeof Parser.prototype['appPath']
|
|
38
|
+
public appConfig: typeof Parser.prototype['appConfig']
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
declare type TAppMeta = TaroHarmonyPageMeta & {
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
declare type TPageMeta = TaroHarmonyPageMeta & {
|
|
45
|
+
entryOption: TaroHarmonyPageMeta['config'] | false
|
|
46
|
+
config: {
|
|
47
|
+
entryOption: TaroHarmonyPageMeta['config'] | false
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import '@tarojs/components'
|
|
2
|
+
import { ComponentType } from 'react'
|
|
3
|
+
import { StandardProps } from '@tarojs/components/types/common'
|
|
4
|
+
import { ScrollViewProps } from '@tarojs/components/types/ScrollView'
|
|
5
|
+
|
|
6
|
+
declare module '@tarojs/components/types/props' {
|
|
7
|
+
export interface ImageProps {
|
|
8
|
+
// 本地占位图
|
|
9
|
+
placeHolder?: any
|
|
10
|
+
// 本地兜底图
|
|
11
|
+
errorHolder?: any
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
interface ListProps extends StandardProps {
|
|
15
|
+
stickyHeader?: boolean
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface ListItemProps extends StandardProps {
|
|
19
|
+
space?: number
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface FlowItemProps extends StandardProps {
|
|
23
|
+
reuseId?: string
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface WaterFlowProps extends ScrollViewProps {
|
|
27
|
+
cacheCount?: number
|
|
28
|
+
lowerThresholdCount?: number
|
|
29
|
+
upperThresholdCount?: number
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface FlowSectionProps extends StandardProps {
|
|
33
|
+
column?: number
|
|
34
|
+
rowGap?: number | string
|
|
35
|
+
columnGap?: number | string
|
|
36
|
+
margin?: {
|
|
37
|
+
marginTop?: number | string
|
|
38
|
+
marginRight?: number | string
|
|
39
|
+
marginBottom?: number | string
|
|
40
|
+
marginLeft?: number | string
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export const List: ComponentType<ListProps>
|
|
45
|
+
export const ListItem: ComponentType<ListItemProps>
|
|
46
|
+
export const FlowItem: ComponentType<FlowItemProps>
|
|
47
|
+
export const WaterFlow: ComponentType<WaterFlowProps>
|
|
48
|
+
export const FlowSection: ComponentType<FlowSectionProps>
|
|
49
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/// <reference types="@tarojs/plugin-platform-harmony-ets/types" />
|
|
2
|
+
/// <reference path="./harmony.d.ts" />
|
|
3
|
+
/// <reference path="./components.d.ts" />
|
|
4
|
+
|
|
5
|
+
import '@tarojs/taro'
|
|
6
|
+
|
|
7
|
+
declare module '@tarojs/taro' {
|
|
8
|
+
interface PageConfig {
|
|
9
|
+
/** 是否是首页 */
|
|
10
|
+
isHome?: boolean
|
|
11
|
+
/** 是否开启 React 18,默认开启 */
|
|
12
|
+
isUseReact18?: boolean
|
|
13
|
+
/** 页面导出组件名 */
|
|
14
|
+
componentName?: string
|
|
15
|
+
/** 固定窗口尺寸 */
|
|
16
|
+
windowArea?: {
|
|
17
|
+
width?: number
|
|
18
|
+
height?: number
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
interface PageResizeObject {
|
|
22
|
+
/** 屏幕旋转状态 */
|
|
23
|
+
deviceOrientation?: 'portrait' | 'landscape'
|
|
24
|
+
/** 尺寸信息 */
|
|
25
|
+
size: {
|
|
26
|
+
windowWidth: number
|
|
27
|
+
windowHeight: number
|
|
28
|
+
screenWidth?: number
|
|
29
|
+
screenHeight?: number
|
|
30
|
+
}
|
|
31
|
+
/** 折叠屏信息:0 表示设备当前折叠显示模式未知;1 表示设备当前全屏显示;2 表示设备当前主屏幕显示;3 表示设备当前子屏幕显示;4 表示设备当前双屏协同显示 */
|
|
32
|
+
foldDisplayMode: number
|
|
33
|
+
/** 是否可分栏 */
|
|
34
|
+
canSplit: bool
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
interface TaroStatic {
|
|
38
|
+
/** 尺寸转换
|
|
39
|
+
* @supported global
|
|
40
|
+
*/
|
|
41
|
+
pxTransform(size: number, designWidth?: number): number | string
|
|
42
|
+
/** Harmony 专属,刷新 Audio 状态 */
|
|
43
|
+
refreshAudioSession(): void
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
declare global {
|
|
48
|
+
function $r(resourcePath: string): any
|
|
49
|
+
function getUIContext(): any
|
|
50
|
+
function canIUse(name: string): boolean
|
|
51
|
+
const Observed: any
|
|
52
|
+
const SwiperController: any
|
|
53
|
+
const Visibility: any
|
|
54
|
+
type DataChangeListener = any
|
|
55
|
+
type GestureEvent = any
|
|
56
|
+
type VideoController = any
|
|
57
|
+
|
|
58
|
+
interface IDataSource {
|
|
59
|
+
_isDynamicNode?: boolean
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/// <reference types="@tarojs/plugin-platform-harmony-ets/types/harmony" />
|
|
2
|
+
declare module '@jd-oh/*'
|
|
3
|
+
declare module '@taro-oh/*'
|
|
4
|
+
declare module '@hmscore/*'
|
|
5
|
+
declare module '@ohos.*'
|
|
6
|
+
declare module '@system.*'
|
|
7
|
+
declare module '@kit.*'
|
|
8
|
+
|
|
9
|
+
declare module '@kit.AbilityKit' {
|
|
10
|
+
namespace common {
|
|
11
|
+
type BaseContext = any
|
|
12
|
+
export { BaseContext }
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
declare module '@ohos.base' {
|
|
16
|
+
export = any
|
|
17
|
+
}
|
|
18
|
+
declare module '@ohos.web.webview' {
|
|
19
|
+
export = any
|
|
20
|
+
}
|
|
21
|
+
declare module '@ohos.window' {
|
|
22
|
+
export = any
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
declare module 'libTaroHarmonyLibrary.so' {
|
|
26
|
+
export = any
|
|
27
|
+
// export * from '../cpp/types/taro-native-node/index.d.ts'
|
|
28
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/// <reference types="@tarojs/runtime" />
|
|
2
|
+
|
|
3
|
+
declare module '@tarojs/runtime' {
|
|
4
|
+
function initHarmonyElement()
|
|
5
|
+
function initStyleSheetConfig(size: any, navHeight: any)
|
|
6
|
+
enum NodeType {
|
|
7
|
+
ELEMENT_NODE = 1,
|
|
8
|
+
ATTRIBUTE_NODE = 2,
|
|
9
|
+
TEXT_NODE = 3,
|
|
10
|
+
CDATA_SECTION_NODE = 4,
|
|
11
|
+
ENTITY_REFERENCE_NODE = 5,
|
|
12
|
+
PROCESSING_INSTRUCTION_NODE = 7,
|
|
13
|
+
COMMENT_NODE = 8,
|
|
14
|
+
DOCUMENT_NODE = 9,
|
|
15
|
+
DOCUMENT_TYPE_NODE = 10,
|
|
16
|
+
DOCUMENT_FRAGMENT_NODE = 11
|
|
17
|
+
}
|
|
18
|
+
type TFunc = (...args: any[]) => any
|
|
19
|
+
type TaroRichTextElement = any
|
|
20
|
+
type EventOptions = any
|
|
21
|
+
const context: {
|
|
22
|
+
resolver: Promise.resolve
|
|
23
|
+
value: any
|
|
24
|
+
}
|
|
25
|
+
const TaroWindowUtil: {
|
|
26
|
+
resolver: Promise.resolve
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const uiContext: typeof context
|
|
30
|
+
declare const Current: {
|
|
31
|
+
app: AppInstance | null
|
|
32
|
+
entryAsync: AppInstance | null
|
|
33
|
+
isDebug: boolean
|
|
34
|
+
uiContext: any
|
|
35
|
+
router: Router | null
|
|
36
|
+
taro: any
|
|
37
|
+
contextPromise: Promise<any>
|
|
38
|
+
uiContextPromise: Promise<any>
|
|
39
|
+
nativeModule: any
|
|
40
|
+
createHarmonyElement: null
|
|
41
|
+
page: PageInstance | null
|
|
42
|
+
preloadData?: any
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function getPageById(pageId: string): any
|
|
46
|
+
function setPageById(inst: any, id: string): any
|
|
47
|
+
function removePageById(pageId: string): any
|
|
48
|
+
|
|
49
|
+
// cpp/types/taro-native-node/index.d.ts
|
|
50
|
+
const TaroNativeModule: any
|
|
51
|
+
const systemContext: {
|
|
52
|
+
resolve: Promise.resolve
|
|
53
|
+
reject: Promise.reject
|
|
54
|
+
densityPixels: number
|
|
55
|
+
safeArea: any
|
|
56
|
+
statusBarHeight: number
|
|
57
|
+
windowWidth: number
|
|
58
|
+
windowHeight: number
|
|
59
|
+
}
|
|
60
|
+
const systemPromise: typeof context
|
|
61
|
+
const TaroWindowUtil: typeof TaroWindowUtil
|
|
62
|
+
|
|
63
|
+
const TaroElement: any
|
|
64
|
+
type TaroElement = any
|
|
65
|
+
type TaroVideoElement = typeof TaroElement
|
|
66
|
+
}
|