@tarojs/plugin-platform-harmony-cpp 4.1.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/LICENSE +174 -0
- package/README.md +66 -0
- package/index.js +4 -0
- package/package.json +92 -0
- package/types/compile.d.ts +50 -0
- package/types/components.d.ts +49 -0
- package/types/define.d.ts +113 -0
- package/types/global.d.ts +1 -0
- package/types/harmony.d.ts +11 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2018 O2Team
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
|
23
|
+
========================================================================
|
|
24
|
+
|
|
25
|
+
MIT (react-devtools):
|
|
26
|
+
The following files embed [react-devtools](https://github.com/facebook/react) MIT:
|
|
27
|
+
`/packages/taro-plugin-react-devtools/src/backend/index.js`
|
|
28
|
+
See `/LICENSE` for details of the license.
|
|
29
|
+
|
|
30
|
+
==================
|
|
31
|
+
|
|
32
|
+
MIT (vue-devtools):
|
|
33
|
+
The following files embed [vue-devtools](https://github.com/vuejs/devtools) MIT:
|
|
34
|
+
`/packages/taro-plugin-vue-devtools/src/backend/*`
|
|
35
|
+
See `/LICENSE` for details of the license.
|
|
36
|
+
|
|
37
|
+
==================
|
|
38
|
+
|
|
39
|
+
MIT (vite):
|
|
40
|
+
The following files embed [vite](https://github.com/vitejs/vite) MIT:
|
|
41
|
+
`/packages/taro-webpack5-prebundle/src/prebundle/scanImport.ts`,
|
|
42
|
+
`/packages/taro-webpack5-prebundle/src/prebundle/bundle.ts`,
|
|
43
|
+
`/packages/taro-webpack5-prebundle/src/h5.ts`,
|
|
44
|
+
`/packages/taro-webpack5-prebundle/src/min.ts`
|
|
45
|
+
See `/LICENSE` for details of the license.
|
|
46
|
+
|
|
47
|
+
==================
|
|
48
|
+
|
|
49
|
+
MIT (webpack):
|
|
50
|
+
The following files embed [webpack](https://github.com/webpack/webpack) MIT:
|
|
51
|
+
`/packages/taro-webpack5-prebundle/src/webpack/TaroContainerEntryModule.ts`,
|
|
52
|
+
`/packages/taro-webpack5-prebundle/src/webpack/TaroContainerPlugin.ts`,
|
|
53
|
+
`/packages/taro-webpack5-prebundle/src/webpack/TaroContainerReferencePlugin.ts`,
|
|
54
|
+
`/packages/taro-webpack5-prebundle/src/webpack/TaroModuleFederationPlugin.ts`
|
|
55
|
+
See `/LICENSE` for details of the license.
|
|
56
|
+
|
|
57
|
+
==================
|
|
58
|
+
|
|
59
|
+
MIT (sizzle):
|
|
60
|
+
The following files embed [sizzle](https://github.com/jquery/sizzle) MIT:
|
|
61
|
+
`/packages/taro-extends/src/jquery/sizzle.js`
|
|
62
|
+
See `/LICENSE.txt` for details of the license.
|
|
63
|
+
|
|
64
|
+
==================
|
|
65
|
+
|
|
66
|
+
MIT (zepto):
|
|
67
|
+
The following files embed [zepto](https://github.com/madrobby/zepto) MIT:
|
|
68
|
+
`/packages/taro-extends/src/jquery/zepto.js`,
|
|
69
|
+
`/packages/taro-extends/src/jquery/event.js`
|
|
70
|
+
See `/MIT-LICENSE` for details of the license.
|
|
71
|
+
|
|
72
|
+
==================
|
|
73
|
+
|
|
74
|
+
MIT (css-to-react-native):
|
|
75
|
+
The following files embed [css-to-react-native](https://github.com/styled-components/css-to-react-native) MIT:
|
|
76
|
+
`/packages/css-to-react-native/src/css-to-react-native/*`
|
|
77
|
+
See `/LICENSE.md` for details of the license.
|
|
78
|
+
|
|
79
|
+
==================
|
|
80
|
+
|
|
81
|
+
MIT (reactify-wc):
|
|
82
|
+
The following files embed [reactify-wc](https://github.com/BBKolton/reactify-wc) MIT:
|
|
83
|
+
`/packages/taro-components-library-react/src/component-lib/reactify-wc.ts`
|
|
84
|
+
See `/LICENSE` for details of the license.
|
|
85
|
+
|
|
86
|
+
==================
|
|
87
|
+
|
|
88
|
+
MIT (ant-design-mobile-rn):
|
|
89
|
+
The following files embed [ant-design-mobile-rn](https://github.com/ant-design/ant-design-mobile-rn) MIT:
|
|
90
|
+
`/packages/taro-components-rn/src/components/Swiper/carousel.tsx`
|
|
91
|
+
See `/LICENSE` for details of the license.
|
|
92
|
+
|
|
93
|
+
==================
|
|
94
|
+
|
|
95
|
+
MIT (react-wx-images-viewer):
|
|
96
|
+
The following files embed [react-wx-images-viewer](https://github.com/react-ld/react-wx-images-viewer) MIT:
|
|
97
|
+
`/packages/taro-h5/src/api/media/image/previewImage.ts`
|
|
98
|
+
See `/LICENSE` for details of the license.
|
|
99
|
+
|
|
100
|
+
==================
|
|
101
|
+
|
|
102
|
+
MIT (webpack-contrib/css-loader):
|
|
103
|
+
The following files embed [webpack-contrib/css-loader](https://github.com/webpack-contrib/css-loader) MIT:
|
|
104
|
+
`/packages/taro-rn-style-transformer/src/utils/index.ts`
|
|
105
|
+
See `/LICENSE` for details of the license.
|
|
106
|
+
|
|
107
|
+
==================
|
|
108
|
+
|
|
109
|
+
MIT (react-native):
|
|
110
|
+
The following files embed [react-native](https://github.com/facebook/react-native) MIT:
|
|
111
|
+
`/packages/taro-rn-style-transformer/src/transforms/StyleSheet/*`
|
|
112
|
+
See `/LICENSE` for details of the license.
|
|
113
|
+
|
|
114
|
+
==================
|
|
115
|
+
|
|
116
|
+
MIT (myrne/performance-now):
|
|
117
|
+
The following files embed [myrne/performance-now](https://github.com/myrne/performance-now) MIT:
|
|
118
|
+
`/packages/taro-runtime/src/bom/raf.ts`
|
|
119
|
+
See `/LICENSE` for details of the license.
|
|
120
|
+
|
|
121
|
+
==================
|
|
122
|
+
|
|
123
|
+
Apache (chameleon-api):
|
|
124
|
+
The following files embed [chameleon-api](https://github.com/chameleon-team/chameleon-api) Apache:
|
|
125
|
+
`/packages/taro-h5/src/api/device/clipboard.ts`
|
|
126
|
+
|
|
127
|
+
==================
|
|
128
|
+
|
|
129
|
+
MIT (uni-app):
|
|
130
|
+
The following files embed [uni-app](https://github.com/dcloudio/uni-app) MIT:
|
|
131
|
+
`/packages/taro-components-rn/src/components/Video/index.tsx`
|
|
132
|
+
See `/LICENSE` for details of the license.
|
|
133
|
+
|
|
134
|
+
==================
|
|
135
|
+
|
|
136
|
+
MIT (miniprogram-render):
|
|
137
|
+
The following files embed [miniprogram-render](https://github.com/Tencent/kbone) MIT:
|
|
138
|
+
`/packages/taro-plugin-http/src/runtime/Cookie.ts`
|
|
139
|
+
See `/LICENSE` for details of the license.
|
|
140
|
+
|
|
141
|
+
==================
|
|
142
|
+
|
|
143
|
+
MIT (stencil-ds-output-targets):
|
|
144
|
+
The following files embed [stencil-ds-output-targets](https://github.com/ionic-team/stencil-ds-output-targets/) MIT:
|
|
145
|
+
`/packages/taro-components-library-react/src/react-component-lib/utils/attachProps.ts`
|
|
146
|
+
`/packages/taro-components-library-react/src/react-component-lib/utils/case.ts`
|
|
147
|
+
`/packages/taro-components-library-react/src/react-component-lib/utils/dev.ts`
|
|
148
|
+
`/packages/taro-components-library-react/src/react-component-lib/utils/index.tsx`
|
|
149
|
+
`/packages/taro-components-library-react/src/react-component-lib/createComponent.tsx`
|
|
150
|
+
`/packages/taro-components-library-react/src/react-component-lib/createOverlayComponent.tsx`
|
|
151
|
+
`/packages/taro-components-library-react/src/react-component-lib/interfaces.ts`
|
|
152
|
+
`/packages/taro-components-library-vue3/src/vue-component-lib/utils.ts`
|
|
153
|
+
See `/LICENSE` for details of the license.
|
|
154
|
+
|
|
155
|
+
==================
|
|
156
|
+
|
|
157
|
+
MIT (weui):
|
|
158
|
+
The following files embed [weui](https://github.com/Tencent/weui) MIT:
|
|
159
|
+
`/packages/taro-components/src/components/*.scss`
|
|
160
|
+
See `/LICENSE.txt` for details of the license.
|
|
161
|
+
|
|
162
|
+
==================
|
|
163
|
+
|
|
164
|
+
Apache-2.0 (intersection-observer):
|
|
165
|
+
The following files embed [intersection-observer](https://github.com/GoogleChromeLabs/intersection-observer) Apache-2.0:
|
|
166
|
+
`/packages/taro-api/src/polyfill/intersection-observer.ts`
|
|
167
|
+
See `/LICENSE.txt` for details of the license.
|
|
168
|
+
|
|
169
|
+
==================
|
|
170
|
+
|
|
171
|
+
MIT (babel-plugin-jsx-dom-expressions):
|
|
172
|
+
The following files embed [babel-plugin-jsx-dom-expressions](https://github.com/ryansolid/dom-expressions/blob/main/packages/babel-plugin-jsx-dom-expressions) MIT:
|
|
173
|
+
`/packages/babel-plugin-transform-solid-jsx/src/*`
|
|
174
|
+
See `/LICENSE` for details of the license.
|
package/README.md
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# @tarojs/plugin-platform-harmony-cpp
|
|
2
|
+
|
|
3
|
+
## 功能
|
|
4
|
+
|
|
5
|
+
### 安装和使用
|
|
6
|
+
|
|
7
|
+
- 安装 harmony 插件
|
|
8
|
+
|
|
9
|
+
```shell
|
|
10
|
+
# 使用 npm 安装
|
|
11
|
+
$ npm i @tarojs/plugin-platform-harmony-cpp
|
|
12
|
+
# 使用 pnpm 安装
|
|
13
|
+
$ pnpm i @tarojs/plugin-platform-harmony-cpp
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
- 添加插件配置
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
import os from 'os'
|
|
20
|
+
import path from 'path'
|
|
21
|
+
|
|
22
|
+
const config = {
|
|
23
|
+
// ...
|
|
24
|
+
plugin: ['@tarojs/plugin-platform-harmony-cpp'],
|
|
25
|
+
harmony: {
|
|
26
|
+
compiler: 'vite',
|
|
27
|
+
projectPath: path.join(os.homedir(), 'projects/my-business-module'),
|
|
28
|
+
hapName: 'library',
|
|
29
|
+
},
|
|
30
|
+
// ...
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### 使用公共依赖库
|
|
35
|
+
|
|
36
|
+
插件默认使用对应版本的公共依赖库,可以通过 useChoreLibrary 配置禁用。
|
|
37
|
+
|
|
38
|
+
```ts
|
|
39
|
+
const config = {
|
|
40
|
+
// ...
|
|
41
|
+
plugin: [
|
|
42
|
+
'@tarojs/plugin-platform-harmony-cpp',
|
|
43
|
+
// ['@tarojs/plugin-platform-harmony-cpp', { useChoreLibrary: false }],
|
|
44
|
+
],
|
|
45
|
+
harmony: {
|
|
46
|
+
ohPackage: {
|
|
47
|
+
dependencies: {
|
|
48
|
+
'library': 'file:../library',
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
// ...
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
插件版本可以通过 `ohPackage.dependencies` 配置或者鸿蒙工程内 `oh-package.json5` 配置覆盖。
|
|
57
|
+
|
|
58
|
+
## 类型定义
|
|
59
|
+
|
|
60
|
+
需要在 Taro 项目的 types/global.d.ts 文件夹里添加对插件类型的引用
|
|
61
|
+
|
|
62
|
+
```ts
|
|
63
|
+
/// <reference types="@tarojs/taro" />
|
|
64
|
+
/// <reference path="../node_modules/@tarojs/plugin-platform-harmony-cpp/types/define.d.ts" />
|
|
65
|
+
|
|
66
|
+
```
|
package/index.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@tarojs/plugin-platform-harmony-cpp",
|
|
3
|
+
"version": "4.1.0-alpha.0",
|
|
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
|
+
"types"
|
|
17
|
+
],
|
|
18
|
+
"types": "types/index.d.ts",
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "git+https://gitee.com/openharmony-sig/taro.git"
|
|
22
|
+
},
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"@babel/core": "^7.24.7",
|
|
25
|
+
"@babel/preset-env": "^7.24.4",
|
|
26
|
+
"@rollup/plugin-alias": "^5.1.0",
|
|
27
|
+
"@rollup/plugin-commonjs": "^25.0.8",
|
|
28
|
+
"@rollup/plugin-json": "^6.1.0",
|
|
29
|
+
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
30
|
+
"@rollup/plugin-replace": "^5.0.7",
|
|
31
|
+
"@tarojs/parse-css-to-stylesheet": "^1.1.5 ",
|
|
32
|
+
"@types/react": "^18.3.3",
|
|
33
|
+
"@types/react-reconciler": "^0.28.8",
|
|
34
|
+
"react": "^18.3.1",
|
|
35
|
+
"react-dom": "^18.3.1",
|
|
36
|
+
"react-reconciler": "0.29.0",
|
|
37
|
+
"rollup": "^3.29.4",
|
|
38
|
+
"rollup-plugin-dts": "^6.1.1",
|
|
39
|
+
"rollup-plugin-node-externals": "^5.1.3",
|
|
40
|
+
"rollup-plugin-ts": "^3.4.5",
|
|
41
|
+
"scheduler": "^0.23.2",
|
|
42
|
+
"@tarojs/react": "4.1.0-alpha.0",
|
|
43
|
+
"@tarojs/runner-utils": "4.1.0-alpha.0",
|
|
44
|
+
"@tarojs/service": "4.1.0-alpha.0"
|
|
45
|
+
},
|
|
46
|
+
"devDependencies": {
|
|
47
|
+
"@rollup/plugin-typescript": "^11.1.6",
|
|
48
|
+
"@types/node": "^18.19.34",
|
|
49
|
+
"fast-glob": "^3.3.2",
|
|
50
|
+
"postcss": "^8.4.38",
|
|
51
|
+
"prettier": "^2.8.8",
|
|
52
|
+
"solid-js": "^1.8.17",
|
|
53
|
+
"terser": "^5.31.1",
|
|
54
|
+
"ts-node": "^10.9.2",
|
|
55
|
+
"tsconfig-paths": "^3.15.0",
|
|
56
|
+
"tslib": "^2.6.3",
|
|
57
|
+
"typescript": "~5.4.5",
|
|
58
|
+
"vite": "^4.2.0",
|
|
59
|
+
"@tarojs/components": "4.1.0-alpha.0",
|
|
60
|
+
"@tarojs/helper": "4.1.0-alpha.0",
|
|
61
|
+
"@tarojs/plugin-framework-react": "4.1.0-alpha.0",
|
|
62
|
+
"@tarojs/plugin-platform-harmony-ets": "4.1.0-alpha.0",
|
|
63
|
+
"@tarojs/react": "4.1.0-alpha.0",
|
|
64
|
+
"@tarojs/runtime": "4.1.0-alpha.0",
|
|
65
|
+
"@tarojs/shared": "4.1.0-alpha.0",
|
|
66
|
+
"@tarojs/taro": "4.1.0-alpha.0",
|
|
67
|
+
"@tarojs/vite-runner": "4.1.0-alpha.0",
|
|
68
|
+
"rollup-plugin-copy": "4.1.0-alpha.0"
|
|
69
|
+
},
|
|
70
|
+
"peerDependencies": {
|
|
71
|
+
"less": "^4.2.0",
|
|
72
|
+
"sass": "^1.75.0",
|
|
73
|
+
"stylus": "^0.63.0",
|
|
74
|
+
"@tarojs/components": "4.1.0-alpha.0",
|
|
75
|
+
"@tarojs/helper": "4.1.0-alpha.0",
|
|
76
|
+
"@tarojs/plugin-framework-react": "4.1.0-alpha.0",
|
|
77
|
+
"@tarojs/plugin-platform-harmony-ets": "4.1.0-alpha.0",
|
|
78
|
+
"@tarojs/react": "4.1.0-alpha.0",
|
|
79
|
+
"@tarojs/runtime": "4.1.0-alpha.0",
|
|
80
|
+
"@tarojs/shared": "4.1.0-alpha.0",
|
|
81
|
+
"@tarojs/taro": "4.1.0-alpha.0",
|
|
82
|
+
"@tarojs/vite-runner": "4.1.0-alpha.0"
|
|
83
|
+
},
|
|
84
|
+
"scripts": {
|
|
85
|
+
"prebuild": "rimraf --impl=move-remove dist",
|
|
86
|
+
"build": "pnpm run rollup",
|
|
87
|
+
"dev": "pnpm run rollup -w",
|
|
88
|
+
"remove:reference": "pnpm run tsx --files ./scripts/reference",
|
|
89
|
+
"rollup": "rollup --config rollup.config.mts --configPlugin @rollup/plugin-typescript --bundleConfigAsCjs",
|
|
90
|
+
"tsx": "ts-node --skipIgnore"
|
|
91
|
+
}
|
|
92
|
+
}
|
|
@@ -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,113 @@
|
|
|
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
|
+
|
|
38
|
+
declare module '@tarojs/runtime' {
|
|
39
|
+
function initHarmonyElement()
|
|
40
|
+
function initStyleSheetConfig(size: any, navHeight: any)
|
|
41
|
+
enum NodeType {
|
|
42
|
+
ELEMENT_NODE = 1,
|
|
43
|
+
ATTRIBUTE_NODE = 2,
|
|
44
|
+
TEXT_NODE = 3,
|
|
45
|
+
CDATA_SECTION_NODE = 4,
|
|
46
|
+
ENTITY_REFERENCE_NODE = 5,
|
|
47
|
+
PROCESSING_INSTRUCTION_NODE = 7,
|
|
48
|
+
COMMENT_NODE = 8,
|
|
49
|
+
DOCUMENT_NODE = 9,
|
|
50
|
+
DOCUMENT_TYPE_NODE = 10,
|
|
51
|
+
DOCUMENT_FRAGMENT_NODE = 11
|
|
52
|
+
}
|
|
53
|
+
type TFunc = (...args: any[]) => any
|
|
54
|
+
type TaroRichTextElement = any
|
|
55
|
+
type EventOptions = any
|
|
56
|
+
const context: {
|
|
57
|
+
resolver: Promise.resolve
|
|
58
|
+
value: any
|
|
59
|
+
}
|
|
60
|
+
const TaroWindowUtil: {
|
|
61
|
+
resolver: Promise.resolve
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const uiContext: typeof context
|
|
65
|
+
declare const Current: {
|
|
66
|
+
app: AppInstance | null
|
|
67
|
+
entryAsync: AppInstance | null
|
|
68
|
+
isDebug: boolean
|
|
69
|
+
uiContext: any
|
|
70
|
+
router: Router | null
|
|
71
|
+
taro: any
|
|
72
|
+
contextPromise: Promise<any>
|
|
73
|
+
uiContextPromise: Promise<any>
|
|
74
|
+
nativeModule: any
|
|
75
|
+
createHarmonyElement: null
|
|
76
|
+
page: PageInstance | null
|
|
77
|
+
preloadData?: any
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function getPageById(pageId: string): any
|
|
81
|
+
function setPageById(inst: any, id: string): any
|
|
82
|
+
function removePageById(pageId: string): any
|
|
83
|
+
|
|
84
|
+
// cpp/types/taro-native-node/index.d.ts
|
|
85
|
+
const TaroNativeModule: any
|
|
86
|
+
const systemContext: {
|
|
87
|
+
resolve: Promise.resolve
|
|
88
|
+
reject: Promise.reject
|
|
89
|
+
densityPixels: number
|
|
90
|
+
safeArea: any
|
|
91
|
+
statusBarHeight: number
|
|
92
|
+
windowWidth: number
|
|
93
|
+
windowHeight: number
|
|
94
|
+
}
|
|
95
|
+
const systemPromise: typeof context
|
|
96
|
+
const TaroWindowUtil: typeof TaroWindowUtil
|
|
97
|
+
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
declare module '@tarojs/taro' {
|
|
101
|
+
interface TaroStatic {
|
|
102
|
+
/** 尺寸转换
|
|
103
|
+
* @supported global
|
|
104
|
+
*/
|
|
105
|
+
pxTransform(size: number, designWidth?: number): number | string
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
declare global {
|
|
110
|
+
function $r(resourcePath: string): any
|
|
111
|
+
function getUIContext(): any
|
|
112
|
+
function canIUse(name: string): boolean
|
|
113
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/// <reference types="@tarojs/runtime" />
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="@tarojs/plugin-platform-harmony-ets/types/harmony" />
|
|
2
|
+
declare module '@jd-oh/*'
|
|
3
|
+
declare module '@hmscore/*'
|
|
4
|
+
declare module '@ohos.*'
|
|
5
|
+
declare module '@system.*'
|
|
6
|
+
declare module '@kit.*'
|
|
7
|
+
|
|
8
|
+
declare module 'libTaroHarmonyLibrary.so' {
|
|
9
|
+
export = any
|
|
10
|
+
// export * from '../cpp/types/taro-native-node/index.d.ts'
|
|
11
|
+
}
|