@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.
Files changed (231) hide show
  1. package/README.md +270 -0
  2. package/dist/index.d.ts +32 -0
  3. package/dist/index.js +1318 -0
  4. package/dist/runtime/apis/apis.ts +20 -0
  5. package/dist/runtime/apis/base/crypto.ts +4 -0
  6. package/dist/runtime/apis/base/debug.ts +5 -0
  7. package/dist/runtime/apis/base/index.ts +13 -0
  8. package/dist/runtime/apis/base/performance.ts +8 -0
  9. package/dist/runtime/apis/base/system.ts +181 -0
  10. package/dist/runtime/apis/base/update.ts +5 -0
  11. package/dist/runtime/apis/base/weapp/app-event.ts +75 -0
  12. package/dist/runtime/apis/base/weapp/life-cycle.ts +21 -0
  13. package/dist/runtime/apis/canvas/index.ts +27 -0
  14. package/dist/runtime/apis/data-analysis/index.ts +6 -0
  15. package/dist/runtime/apis/device/accelerometer.ts +79 -0
  16. package/dist/runtime/apis/device/accessibility.ts +4 -0
  17. package/dist/runtime/apis/device/battery.ts +24 -0
  18. package/dist/runtime/apis/device/bluetooth-ble.ts +19 -0
  19. package/dist/runtime/apis/device/bluetooth-peripheral.ts +6 -0
  20. package/dist/runtime/apis/device/bluetooth.ts +16 -0
  21. package/dist/runtime/apis/device/calendar.ts +5 -0
  22. package/dist/runtime/apis/device/clipboard.ts +85 -0
  23. package/dist/runtime/apis/device/compass.ts +21 -0
  24. package/dist/runtime/apis/device/contact.ts +5 -0
  25. package/dist/runtime/apis/device/crypto.ts +4 -0
  26. package/dist/runtime/apis/device/gyroscope.ts +77 -0
  27. package/dist/runtime/apis/device/iBeacon.ts +10 -0
  28. package/dist/runtime/apis/device/index.ts +24 -0
  29. package/dist/runtime/apis/device/keyboard.ts +63 -0
  30. package/dist/runtime/apis/device/memory.ts +11 -0
  31. package/dist/runtime/apis/device/motion.ts +6 -0
  32. package/dist/runtime/apis/device/network.ts +123 -0
  33. package/dist/runtime/apis/device/nfc.ts +10 -0
  34. package/dist/runtime/apis/device/phone.ts +44 -0
  35. package/dist/runtime/apis/device/scan.ts +4 -0
  36. package/dist/runtime/apis/device/screen.ts +80 -0
  37. package/dist/runtime/apis/device/sms.ts +4 -0
  38. package/dist/runtime/apis/device/vibrate.ts +32 -0
  39. package/dist/runtime/apis/device/wifi.ts +15 -0
  40. package/dist/runtime/apis/ext/index.ts +5 -0
  41. package/dist/runtime/apis/files/index.ts +136 -0
  42. package/dist/runtime/apis/files/manager.ts +942 -0
  43. package/dist/runtime/apis/framework/index.ts +48 -0
  44. package/dist/runtime/apis/harmony/task-pool.ts +39 -0
  45. package/dist/runtime/apis/index.ts +61 -0
  46. package/dist/runtime/apis/location/index.ts +133 -0
  47. package/dist/runtime/apis/media/EditorContext.ts +32 -0
  48. package/dist/runtime/apis/media/audio/index.ts +36 -0
  49. package/dist/runtime/apis/media/background-audio/index.ts +16 -0
  50. package/dist/runtime/apis/media/camera.ts +16 -0
  51. package/dist/runtime/apis/media/common.ts +58 -0
  52. package/dist/runtime/apis/media/image/index.ts +291 -0
  53. package/dist/runtime/apis/media/index.ts +13 -0
  54. package/dist/runtime/apis/media/live.ts +5 -0
  55. package/dist/runtime/apis/media/map.ts +4 -0
  56. package/dist/runtime/apis/media/media-recorder.ts +4 -0
  57. package/dist/runtime/apis/media/recorder.ts +6 -0
  58. package/dist/runtime/apis/media/video/VideoContext.ts +67 -0
  59. package/dist/runtime/apis/media/video/index.ts +45 -0
  60. package/dist/runtime/apis/media/video-decoder.ts +4 -0
  61. package/dist/runtime/apis/media/video-processing.ts +4 -0
  62. package/dist/runtime/apis/media/voip.ts +19 -0
  63. package/dist/runtime/apis/navigate/index.ts +8 -0
  64. package/dist/runtime/apis/network/downloadFile.ts +85 -0
  65. package/dist/runtime/apis/network/index.ts +7 -0
  66. package/dist/runtime/apis/network/mdns.ts +13 -0
  67. package/dist/runtime/apis/network/request.ts +140 -0
  68. package/dist/runtime/apis/network/tcp.ts +4 -0
  69. package/dist/runtime/apis/network/udp.ts +4 -0
  70. package/dist/runtime/apis/network/uploadFile.ts +105 -0
  71. package/dist/runtime/apis/network/webSocket.ts +126 -0
  72. package/dist/runtime/apis/open-api/account.ts +4 -0
  73. package/dist/runtime/apis/open-api/address.ts +4 -0
  74. package/dist/runtime/apis/open-api/authorize.ts +5 -0
  75. package/dist/runtime/apis/open-api/card.ts +5 -0
  76. package/dist/runtime/apis/open-api/channels-live.ts +11 -0
  77. package/dist/runtime/apis/open-api/customer-service.ts +4 -0
  78. package/dist/runtime/apis/open-api/device-voip.ts +5 -0
  79. package/dist/runtime/apis/open-api/facial.ts +7 -0
  80. package/dist/runtime/apis/open-api/favorites.ts +5 -0
  81. package/dist/runtime/apis/open-api/group.ts +4 -0
  82. package/dist/runtime/apis/open-api/index.ts +21 -0
  83. package/dist/runtime/apis/open-api/invoice.ts +5 -0
  84. package/dist/runtime/apis/open-api/license-plate.ts +4 -0
  85. package/dist/runtime/apis/open-api/login.ts +6 -0
  86. package/dist/runtime/apis/open-api/my-miniprogram.ts +4 -0
  87. package/dist/runtime/apis/open-api/privacy.ts +7 -0
  88. package/dist/runtime/apis/open-api/red-package.ts +4 -0
  89. package/dist/runtime/apis/open-api/settings.ts +5 -0
  90. package/dist/runtime/apis/open-api/soter.ts +6 -0
  91. package/dist/runtime/apis/open-api/subscribe-message.ts +6 -0
  92. package/dist/runtime/apis/open-api/user-info.ts +70 -0
  93. package/dist/runtime/apis/open-api/werun.ts +5 -0
  94. package/dist/runtime/apis/payment/index.ts +6 -0
  95. package/dist/runtime/apis/route/index.ts +88 -0
  96. package/dist/runtime/apis/share/index.ts +33 -0
  97. package/dist/runtime/apis/storage/background-fetch.ts +7 -0
  98. package/dist/runtime/apis/storage/cache-manager.ts +4 -0
  99. package/dist/runtime/apis/storage/index.ts +203 -0
  100. package/dist/runtime/apis/ui/animation/animation.ts +264 -0
  101. package/dist/runtime/apis/ui/animation/index.ts +7 -0
  102. package/dist/runtime/apis/ui/background.ts +20 -0
  103. package/dist/runtime/apis/ui/custom-component.ts +1 -0
  104. package/dist/runtime/apis/ui/fonts.ts +4 -0
  105. package/dist/runtime/apis/ui/index.ts +12 -0
  106. package/dist/runtime/apis/ui/interaction/index.ts +198 -0
  107. package/dist/runtime/apis/ui/menu.ts +4 -0
  108. package/dist/runtime/apis/ui/navigation-bar/index.ts +72 -0
  109. package/dist/runtime/apis/ui/pull-down-refresh.ts +47 -0
  110. package/dist/runtime/apis/ui/scroll/index.ts +82 -0
  111. package/dist/runtime/apis/ui/sticky.ts +4 -0
  112. package/dist/runtime/apis/ui/tab-bar.ts +144 -0
  113. package/dist/runtime/apis/ui/window.ts +20 -0
  114. package/dist/runtime/apis/utils/constant.ts +1 -0
  115. package/dist/runtime/apis/utils/handler.ts +117 -0
  116. package/dist/runtime/apis/utils/index.ts +105 -0
  117. package/dist/runtime/apis/utils/permissions.ts +6 -0
  118. package/dist/runtime/apis/utils/types.ts +12 -0
  119. package/dist/runtime/apis/utils/unit.ts +104 -0
  120. package/dist/runtime/apis/utils/validate.ts +87 -0
  121. package/dist/runtime/apis/worker/index.ts +4 -0
  122. package/dist/runtime/apis/wxml/index.ts +17 -0
  123. package/dist/runtime/apis/wxml/intersectionObserver.ts +100 -0
  124. package/dist/runtime/apis/wxml/nodesRef.ts +58 -0
  125. package/dist/runtime/apis/wxml/selectorQuery.ts +221 -0
  126. package/dist/runtime/apischunk/index.d.ts +1606 -0
  127. package/dist/runtime/apischunk/index.js +5054 -0
  128. package/dist/runtime/components/deprecated.ets +43 -0
  129. package/dist/runtime/components/index.ets +49 -0
  130. package/dist/runtime/components/innerHtml.ets +16 -0
  131. package/dist/runtime/components/navigationBar.ets +65 -0
  132. package/dist/runtime/components/pageMeta.ets +94 -0
  133. package/dist/runtime/components/richText.ets +24 -0
  134. package/dist/runtime/components/slider.ets +119 -0
  135. package/dist/runtime/components/style.ets +286 -0
  136. package/dist/runtime/components/switch.ets +73 -0
  137. package/dist/runtime/components/tag.ts +58 -0
  138. package/dist/runtime/components/utils/AttributeManager.ets +252 -0
  139. package/dist/runtime/components/utils/DynamicCenter.ts +41 -0
  140. package/dist/runtime/components/utils/constant/event.ets +25 -0
  141. package/dist/runtime/components/utils/constant/style.ets +91 -0
  142. package/dist/runtime/components/utils/events.ts +26 -0
  143. package/dist/runtime/components/utils/flexManager.ets +49 -0
  144. package/dist/runtime/components/utils/helper.ets +51 -0
  145. package/dist/runtime/components/utils/htmlParser/HarmonyHTMLParser.ts +100 -0
  146. package/dist/runtime/components/utils/htmlParser/index.ts +58 -0
  147. package/dist/runtime/components/utils/index.ts +77 -0
  148. package/dist/runtime/components/utils/styles.ets +41 -0
  149. package/dist/runtime/components/video.ets +119 -0
  150. package/dist/runtime/components/webView.ets +55 -0
  151. package/dist/runtime/components/xComponent.ets +89 -0
  152. package/dist/runtime/framework/app.ts +248 -0
  153. package/dist/runtime/framework/connect.ts +24 -0
  154. package/dist/runtime/framework/constant.ts +3 -0
  155. package/dist/runtime/framework/hooks.ts +100 -0
  156. package/dist/runtime/framework/index.ts +15 -0
  157. package/dist/runtime/framework/native-page.ts +511 -0
  158. package/dist/runtime/framework/page.ts +256 -0
  159. package/dist/runtime/framework/utils/index.ts +17 -0
  160. package/dist/runtime/framework/utils/is.ts +26 -0
  161. package/dist/runtime/framework-reconciler/componentTree.ts +81 -0
  162. package/dist/runtime/framework-reconciler/constant.ts +86 -0
  163. package/dist/runtime/framework-reconciler/domInput.ts +90 -0
  164. package/dist/runtime/framework-reconciler/event.ts +108 -0
  165. package/dist/runtime/framework-reconciler/index.ts +99 -0
  166. package/dist/runtime/framework-reconciler/inputValueTracking.ts +106 -0
  167. package/dist/runtime/framework-reconciler/props.ts +132 -0
  168. package/dist/runtime/framework-reconciler/reconciler.ts +202 -0
  169. package/dist/runtime/framework-reconciler/render.ts +139 -0
  170. package/dist/runtime/framework-reconciler/workTags.ts +53 -0
  171. package/dist/runtime/runtime-cpp/bom/URL.ts +2 -0
  172. package/dist/runtime/runtime-cpp/bom/document.ts +45 -0
  173. package/dist/runtime/runtime-cpp/bom/history.ts +1 -0
  174. package/dist/runtime/runtime-cpp/bom/location.ts +1 -0
  175. package/dist/runtime/runtime-cpp/bom/navigator.ts +1 -0
  176. package/dist/runtime/runtime-cpp/bom/raf.ts +1 -0
  177. package/dist/runtime/runtime-cpp/bom/window.ts +57 -0
  178. package/dist/runtime/runtime-cpp/constant.ts +29 -0
  179. package/dist/runtime/runtime-cpp/current.ts +48 -0
  180. package/dist/runtime/runtime-cpp/dom/class-list.ts +41 -0
  181. package/dist/runtime/runtime-cpp/dom/comment.ts +9 -0
  182. package/dist/runtime/runtime-cpp/dom/dataSource.ts +87 -0
  183. package/dist/runtime/runtime-cpp/dom/document.ts +113 -0
  184. package/dist/runtime/runtime-cpp/dom/element/canvas.ts +285 -0
  185. package/dist/runtime/runtime-cpp/dom/element/element.ts +262 -0
  186. package/dist/runtime/runtime-cpp/dom/element/form.ts +371 -0
  187. package/dist/runtime/runtime-cpp/dom/element/index.ts +129 -0
  188. package/dist/runtime/runtime-cpp/dom/element/movable.ts +250 -0
  189. package/dist/runtime/runtime-cpp/dom/element/normal.ts +123 -0
  190. package/dist/runtime/runtime-cpp/dom/element/scroll_view.ts +32 -0
  191. package/dist/runtime/runtime-cpp/dom/element/text.ts +9 -0
  192. package/dist/runtime/runtime-cpp/dom/element/video.ts +66 -0
  193. package/dist/runtime/runtime-cpp/dom/element/web_view.ts +72 -0
  194. package/dist/runtime/runtime-cpp/dom/event-source.ts +1 -0
  195. package/dist/runtime/runtime-cpp/dom/event.ts +187 -0
  196. package/dist/runtime/runtime-cpp/dom/eventTarget.ts +81 -0
  197. package/dist/runtime/runtime-cpp/dom/node.ts +307 -0
  198. package/dist/runtime/runtime-cpp/dom/style.ts +44 -0
  199. package/dist/runtime/runtime-cpp/dom/stylesheet/index.ts +379 -0
  200. package/dist/runtime/runtime-cpp/dom/stylesheet/type.ts +212 -0
  201. package/dist/runtime/runtime-cpp/dom/stylesheet/util.ts +186 -0
  202. package/dist/runtime/runtime-cpp/emitter/emitter.ts +29 -0
  203. package/dist/runtime/runtime-cpp/env.ts +1 -0
  204. package/dist/runtime/runtime-cpp/harmony-library.ts +1 -0
  205. package/dist/runtime/runtime-cpp/index.ts +79 -0
  206. package/dist/runtime/runtime-cpp/interface/event.ts +10 -0
  207. package/dist/runtime/runtime-cpp/interface/index.ts +7 -0
  208. package/dist/runtime/runtime-cpp/next-tick.ts +14 -0
  209. package/dist/runtime/runtime-cpp/system.ts +213 -0
  210. package/dist/runtime/runtime-cpp/utils/index.ts +63 -0
  211. package/dist/runtime/runtime-cpp/utils/info.ts +123 -0
  212. package/dist/runtime/runtime-cpp/utils/page.ts +12 -0
  213. package/dist/runtime/runtime-cpp/utils/router.ts +1 -0
  214. package/dist/runtime/runtime-harmony/apis/helper.ets +33 -0
  215. package/dist/runtime/runtime-harmony/apis/network/common.ets +41 -0
  216. package/dist/runtime/runtime-harmony/apis/network/downloadFile.ets +327 -0
  217. package/dist/runtime/runtime-harmony/apis/network/index.ets +58 -0
  218. package/dist/runtime/runtime-harmony/apis/network/request.ets +206 -0
  219. package/dist/runtime/runtime-harmony/apis/network/uploadFile.ets +190 -0
  220. package/dist/runtime/runtime-harmony/apis/route.ets +110 -0
  221. package/dist/runtime/runtime-harmony/apis/taskpool.ets +149 -0
  222. package/dist/runtime/runtime-harmony/index.ets +41 -0
  223. package/dist/runtime/runtime-harmony/utils.ts +53 -0
  224. package/index.js +4 -0
  225. package/package.json +93 -0
  226. package/static/@taro-oh/library-4.0.8-beta.3.har +0 -0
  227. package/types/compile.d.ts +50 -0
  228. package/types/components.d.ts +49 -0
  229. package/types/define.d.ts +61 -0
  230. package/types/harmony.d.ts +28 -0
  231. 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
@@ -0,0 +1,4 @@
1
+ module.exports = require('./dist/index.js').default
2
+
3
+ module.exports.default = module.exports
4
+ module.exports.HarmonyCPP = require('./dist/index.js').HarmonyCPP
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
+ }
@@ -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
+ }