@tarojs/plugin-platform-harmony-ets 4.0.8-beta.0 → 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 (207) hide show
  1. package/dist/apis/apis.d.ts +19 -0
  2. package/dist/apis/base/crypto.d.ts +1 -0
  3. package/dist/apis/base/debug.d.ts +3 -0
  4. package/dist/apis/base/index.d.ts +10 -0
  5. package/dist/apis/base/performance.d.ts +5 -0
  6. package/dist/apis/base/system.d.ts +3 -0
  7. package/dist/apis/base/update.d.ts +2 -0
  8. package/dist/apis/base/weapp/app-event.d.ts +19 -0
  9. package/dist/apis/base/weapp/life-cycle.d.ts +3 -0
  10. package/dist/apis/canvas/index.d.ts +10 -0
  11. package/dist/apis/data-analysis/index.d.ts +4 -0
  12. package/dist/apis/device/accelerometer.d.ts +17 -0
  13. package/dist/apis/device/accessibility.d.ts +1 -0
  14. package/dist/apis/device/battery.d.ts +3 -0
  15. package/dist/apis/device/bluetooth-ble.d.ts +16 -0
  16. package/dist/apis/device/bluetooth-peripheral.d.ts +3 -0
  17. package/dist/apis/device/bluetooth.d.ts +13 -0
  18. package/dist/apis/device/calendar.d.ts +2 -0
  19. package/dist/apis/device/clipboard.d.ts +9 -0
  20. package/dist/apis/device/compass.d.ts +16 -0
  21. package/dist/apis/device/contact.d.ts +2 -0
  22. package/dist/apis/device/crypto.d.ts +1 -0
  23. package/dist/apis/device/gyroscope.d.ts +4 -0
  24. package/dist/apis/device/iBeacon.d.ts +7 -0
  25. package/dist/apis/device/index.d.ts +24 -0
  26. package/dist/apis/device/keyboard.d.ts +5 -0
  27. package/dist/apis/device/memory.d.ts +2 -0
  28. package/dist/apis/device/motion.d.ts +4 -0
  29. package/dist/apis/device/network.d.ts +14 -0
  30. package/dist/apis/device/nfc.d.ts +7 -0
  31. package/dist/apis/device/phone.d.ts +2 -0
  32. package/dist/apis/device/scan.d.ts +1 -0
  33. package/dist/apis/device/screen.d.ts +10 -0
  34. package/dist/apis/device/sms.d.ts +1 -0
  35. package/dist/apis/device/vibrate.d.ts +3 -0
  36. package/dist/apis/device/wifi.d.ts +12 -0
  37. package/dist/apis/ext/index.d.ts +2 -0
  38. package/dist/apis/files/index.d.ts +32 -0
  39. package/dist/apis/files/manager.d.ts +28 -0
  40. package/dist/apis/framework/index.d.ts +18 -0
  41. package/dist/apis/index.d.ts +22 -0
  42. package/dist/apis/location/index.d.ts +13 -0
  43. package/dist/apis/media/EditorContext.d.ts +16 -0
  44. package/dist/apis/media/audio/index.d.ts +12 -0
  45. package/dist/apis/media/background-audio/index.d.ts +12 -0
  46. package/dist/apis/media/camera.d.ts +2 -0
  47. package/dist/apis/media/common.d.ts +3 -0
  48. package/dist/apis/media/image/index.d.ts +6 -0
  49. package/dist/apis/media/index.d.ts +13 -0
  50. package/dist/apis/media/live.d.ts +2 -0
  51. package/dist/apis/media/map.d.ts +1 -0
  52. package/dist/apis/media/media-recorder.d.ts +1 -0
  53. package/dist/apis/media/recorder.d.ts +3 -0
  54. package/dist/apis/media/video/index.d.ts +7 -0
  55. package/dist/apis/media/video-decoder.d.ts +1 -0
  56. package/dist/apis/media/video-processing.d.ts +1 -0
  57. package/dist/apis/media/voip.d.ts +16 -0
  58. package/dist/apis/navigate/index.d.ts +5 -0
  59. package/dist/apis/network/downloadFile.d.ts +2 -0
  60. package/dist/apis/network/index.d.ts +7 -0
  61. package/dist/apis/network/mdns.d.ts +10 -0
  62. package/dist/apis/network/request.d.ts +2 -0
  63. package/dist/apis/network/tcp.d.ts +1 -0
  64. package/dist/apis/network/udp.d.ts +1 -0
  65. package/dist/apis/network/uploadFile.d.ts +2 -0
  66. package/dist/apis/network/webSocket.d.ts +2 -0
  67. package/dist/apis/open-api/account.d.ts +1 -0
  68. package/dist/apis/open-api/address.d.ts +1 -0
  69. package/dist/apis/open-api/authorize.d.ts +2 -0
  70. package/dist/apis/open-api/card.d.ts +2 -0
  71. package/dist/apis/open-api/channels-live.d.ts +8 -0
  72. package/dist/apis/open-api/customer-service.d.ts +1 -0
  73. package/dist/apis/open-api/device-voip.d.ts +2 -0
  74. package/dist/apis/open-api/facial.d.ts +4 -0
  75. package/dist/apis/open-api/favorites.d.ts +2 -0
  76. package/dist/apis/open-api/group.d.ts +1 -0
  77. package/dist/apis/open-api/index.d.ts +21 -0
  78. package/dist/apis/open-api/invoice.d.ts +2 -0
  79. package/dist/apis/open-api/license-plate.d.ts +1 -0
  80. package/dist/apis/open-api/login.d.ts +3 -0
  81. package/dist/apis/open-api/my-miniprogram.d.ts +1 -0
  82. package/dist/apis/open-api/privacy.d.ts +4 -0
  83. package/dist/apis/open-api/red-package.d.ts +1 -0
  84. package/dist/apis/open-api/settings.d.ts +2 -0
  85. package/dist/apis/open-api/soter.d.ts +3 -0
  86. package/dist/apis/open-api/subscribe-message.d.ts +2 -0
  87. package/dist/apis/open-api/user-info.d.ts +15 -0
  88. package/dist/apis/open-api/werun.d.ts +2 -0
  89. package/dist/apis/payment/index.d.ts +3 -0
  90. package/dist/apis/route/index.d.ts +10 -0
  91. package/dist/apis/share/index.d.ts +20 -0
  92. package/dist/apis/storage/background-fetch.d.ts +4 -0
  93. package/dist/apis/storage/cache-manager.d.ts +1 -0
  94. package/dist/apis/storage/index.d.ts +19 -0
  95. package/dist/apis/ui/animation/animation.d.ts +56 -0
  96. package/dist/apis/ui/animation/index.d.ts +3 -0
  97. package/dist/apis/ui/background.d.ts +2 -0
  98. package/dist/apis/ui/custom-component.d.ts +2 -0
  99. package/dist/apis/ui/fonts.d.ts +1 -0
  100. package/dist/apis/ui/index.d.ts +12 -0
  101. package/dist/apis/ui/interaction/index.d.ts +8 -0
  102. package/dist/apis/ui/menu.d.ts +1 -0
  103. package/dist/apis/ui/navigation-bar/index.d.ts +6 -0
  104. package/dist/apis/ui/pull-down-refresh.d.ts +3 -0
  105. package/dist/apis/ui/scroll/index.d.ts +5 -0
  106. package/dist/apis/ui/sticky.d.ts +1 -0
  107. package/dist/apis/ui/tab-bar.d.ts +9 -0
  108. package/dist/apis/ui/window.d.ts +14 -0
  109. package/dist/apis/utils/handler.d.ts +46 -0
  110. package/dist/apis/utils/index.d.ts +17 -0
  111. package/dist/apis/utils/permissions.d.ts +5 -0
  112. package/dist/apis/utils/types.d.ts +11 -0
  113. package/dist/apis/utils/validate.d.ts +39 -0
  114. package/dist/apis/worker/index.d.ts +1 -0
  115. package/dist/apis/wxml/IntersectionObserver.d.ts +12 -0
  116. package/dist/apis/wxml/index.d.ts +7 -0
  117. package/dist/apis/wxml/nodesRef.d.ts +14 -0
  118. package/dist/apis/wxml/selectorQuery.d.ts +39 -0
  119. package/dist/components/components-harmony-ets/tag.d.ts +53 -0
  120. package/dist/components/components-harmony-ets/utils/DynamicCenter.d.ts +7 -0
  121. package/dist/components/components-harmony-ets/utils/events.d.ts +3 -0
  122. package/dist/components/components-harmony-ets/utils/htmlParser/HarmonyHTMLParser.d.ts +11 -0
  123. package/dist/components/components-harmony-ets/utils/htmlParser/index.d.ts +3 -0
  124. package/dist/components/components-harmony-ets/utils/index.d.ts +11 -0
  125. package/dist/components/components-react.d.ts +7 -0
  126. package/dist/components/components-react.js +2 -41
  127. package/dist/components/components-react.js.map +1 -1
  128. package/dist/components/index.d.ts +119 -0
  129. package/dist/index.d.ts +6 -148
  130. package/dist/index.js +12 -8
  131. package/dist/index.js.map +1 -1
  132. package/dist/program/arkTS.d.ts +40 -0
  133. package/dist/program/harmony.d.ts +36 -0
  134. package/dist/program/jsUI.d.ts +60 -0
  135. package/dist/runtime-ets/bom/URL.d.ts +2 -0
  136. package/dist/runtime-ets/bom/document.d.ts +2 -0
  137. package/dist/runtime-ets/bom/getComputedStyle.d.ts +1 -0
  138. package/dist/runtime-ets/bom/history.d.ts +1 -0
  139. package/dist/runtime-ets/bom/location.d.ts +1 -0
  140. package/dist/runtime-ets/bom/navigator.d.ts +1 -0
  141. package/dist/runtime-ets/bom/raf.d.ts +1 -0
  142. package/dist/runtime-ets/bom/window.d.ts +20 -0
  143. package/dist/runtime-ets/constant.d.ts +17 -0
  144. package/dist/runtime-ets/current.d.ts +4 -0
  145. package/dist/runtime-ets/dom/bind.d.ts +4 -0
  146. package/dist/runtime-ets/dom/class-list.d.ts +15 -0
  147. package/dist/runtime-ets/dom/comment.d.ts +5 -0
  148. package/dist/runtime-ets/dom/cssNesting.d.ts +7 -0
  149. package/dist/runtime-ets/dom/cssStyleDeclaration.d.ts +14 -0
  150. package/dist/runtime-ets/dom/document.d.ts +20 -0
  151. package/dist/runtime-ets/dom/element/element.ts +49 -42
  152. package/dist/runtime-ets/dom/element/index.d.ts +14 -0
  153. package/dist/runtime-ets/dom/element/movableArea.d.ts +5 -0
  154. package/dist/runtime-ets/dom/element/progress.d.ts +5 -0
  155. package/dist/runtime-ets/dom/element/text.d.ts +5 -0
  156. package/dist/runtime-ets/dom/element/webView.d.ts +15 -0
  157. package/dist/runtime-ets/dom/event-source.d.ts +1 -0
  158. package/dist/runtime-ets/dom/event.d.ts +24 -0
  159. package/dist/runtime-ets/dom/eventTarget.d.ts +17 -0
  160. package/dist/runtime-ets/dom/node.d.ts +62 -0
  161. package/dist/runtime-ets/dom/stylesheet/covertWeb2Hm.d.ts +3 -0
  162. package/dist/runtime-ets/dom/stylesheet/covertWeb2Hm.ts +1 -0
  163. package/dist/runtime-ets/dom/stylesheet/index.d.ts +83 -0
  164. package/dist/runtime-ets/emitter/emitter.d.ts +1 -0
  165. package/dist/runtime-ets/env.d.ts +1 -0
  166. package/dist/runtime-ets/index.d.ts +22 -0
  167. package/dist/runtime-ets/interface/event.d.ts +9 -0
  168. package/dist/runtime-ets/interface/index.d.ts +6 -0
  169. package/dist/runtime-ets/utils/index.d.ts +26 -0
  170. package/dist/runtime-ets/utils/info.d.ts +11 -0
  171. package/dist/runtime-ets/utils/router.d.ts +1 -0
  172. package/dist/runtime-framework/react/app.d.ts +12 -0
  173. package/dist/runtime-framework/react/connect.d.ts +1 -0
  174. package/dist/runtime-framework/react/constant.d.ts +5 -0
  175. package/dist/runtime-framework/react/hooks.d.ts +31 -0
  176. package/dist/runtime-framework/react/hooks.ts +1 -0
  177. package/dist/runtime-framework/react/index.d.ts +5 -0
  178. package/dist/runtime-framework/react/native-page.d.ts +8 -0
  179. package/dist/runtime-framework/react/native-page.ts +6 -6
  180. package/dist/runtime-framework/react/page.d.ts +13 -0
  181. package/dist/runtime-framework/react/utils/index.d.ts +7 -0
  182. package/dist/runtime-framework/react/utils/is.d.ts +10 -0
  183. package/dist/runtime-framework/solid/app.d.ts +10 -0
  184. package/dist/runtime-framework/solid/connect.d.ts +4 -0
  185. package/dist/runtime-framework/solid/constant.d.ts +5 -0
  186. package/dist/runtime-framework/solid/hooks.d.ts +31 -0
  187. package/dist/runtime-framework/solid/hooks.ts +1 -0
  188. package/dist/runtime-framework/solid/index.d.ts +4 -0
  189. package/dist/runtime-framework/solid/page.d.ts +13 -0
  190. package/dist/runtime-framework/solid/reconciler/h.d.ts +8 -0
  191. package/dist/runtime-framework/solid/reconciler/index.d.ts +3 -0
  192. package/dist/runtime-framework/solid/reconciler/props.d.ts +7 -0
  193. package/dist/runtime-framework/solid/reconciler/props.ts +1 -1
  194. package/dist/runtime-framework/solid/reconciler/render.d.ts +16 -0
  195. package/dist/runtime-framework/solid/reconciler/use.d.ts +1 -0
  196. package/dist/runtime-framework/solid/utils/index.d.ts +16 -0
  197. package/dist/runtime-framework/solid/utils/is.d.ts +10 -0
  198. package/dist/runtime-utils.d.ts +4 -818
  199. package/dist/runtime-utils.js +394 -394
  200. package/dist/runtime-utils.js.map +1 -1
  201. package/dist/runtime.js +394 -394
  202. package/dist/runtime.js.map +1 -1
  203. package/dist/template.d.ts +43 -0
  204. package/dist/utils/api-loader.d.ts +1 -0
  205. package/dist/utils/constants.d.ts +4 -0
  206. package/dist/utils/index.d.ts +3 -0
  207. package/package.json +13 -12
@@ -0,0 +1,39 @@
1
+ type NormalParamSchema = string[];
2
+ type ObjectParamSchema = Record<string, string>;
3
+ type Schema = NormalParamSchema | ObjectParamSchema;
4
+ interface ValidateParams {
5
+ <T>(name: string, params: any, schema: Schema): asserts params is T;
6
+ }
7
+ export declare function shouldBeObject(target: unknown): {
8
+ flag: boolean;
9
+ msg?: undefined;
10
+ } | {
11
+ flag: boolean;
12
+ msg: string;
13
+ };
14
+ interface IParameterErrorParam {
15
+ name?: string;
16
+ para?: string;
17
+ correct?: string;
18
+ wrong?: unknown;
19
+ level?: 'warn' | 'error' | 'log' | 'info' | 'debug';
20
+ }
21
+ export declare function getParameterError({ name, para, correct, wrong, level }: IParameterErrorParam): string;
22
+ export declare function upperCaseFirstLetter(string: string): string;
23
+ export declare function assertType(target: any, type: string, methodName: string, paramName?: string): void;
24
+ /**
25
+ * 用于校验方法的参数类型
26
+ * @param name 方法名称
27
+ * @param params [array|object] 当前参数
28
+ * @param schema [array|object] 参数类型规范
29
+ * @example
30
+ * ```js
31
+ * // 例子一:
32
+ * validateParams(methodA, [key], [string])
33
+ * // 例子二:
34
+ * validateParams(methodB, { key: 123 }, { key: number })
35
+ * ```
36
+ * @todo 校验可选参数
37
+ */
38
+ export declare const validateParams: ValidateParams;
39
+ export {};
@@ -0,0 +1 @@
1
+ export declare const createWorker: (option?: {}, ...args: any[]) => Promise<Partial<import("../utils/handler").ICallbackResult> & Record<string, unknown> & import("../utils/handler").ICallbackResult>;
@@ -0,0 +1,12 @@
1
+ import type Taro from '@tarojs/taro/types';
2
+ export declare class IntersectionObserver implements Taro.IntersectionObserver {
3
+ private _component;
4
+ private _observerNodes;
5
+ private _options;
6
+ constructor(component: any, options?: Taro.createIntersectionObserver.Option);
7
+ disconnect(): void;
8
+ observe(targetSelector: string, callback: Taro.IntersectionObserver.ObserveCallback): void;
9
+ relativeTo(): Taro.IntersectionObserver;
10
+ relativeToViewport(): Taro.IntersectionObserver;
11
+ private handleResult;
12
+ }
@@ -0,0 +1,7 @@
1
+ import { IntersectionObserver } from './IntersectionObserver';
2
+ import { SelectorQuery } from './selectorQuery';
3
+ import type Taro from '@tarojs/taro/types';
4
+ export declare const createSelectorQuery: () => SelectorQuery;
5
+ export declare const createIntersectionObserver: typeof Taro.createIntersectionObserver;
6
+ export declare const createMediaQueryObserver: (option?: {}, ...args: any[]) => Promise<Partial<import("../utils/handler").ICallbackResult> & Record<string, unknown> & import("../utils/handler").ICallbackResult>;
7
+ export { IntersectionObserver };
@@ -0,0 +1,14 @@
1
+ import { SelectorQuery } from './selectorQuery';
2
+ import type Taro from '@tarojs/taro/types';
3
+ export declare class NodesRef implements Taro.NodesRef {
4
+ _component?: any;
5
+ _selector: string;
6
+ _selectorQuery: SelectorQuery;
7
+ _single: boolean;
8
+ constructor(selector: string, querySelectorQuery: SelectorQuery, single: boolean);
9
+ context(cb: any): SelectorQuery;
10
+ node(cb?: Taro.NodesRef.NodeCallback): SelectorQuery;
11
+ boundingClientRect(cb?: Taro.NodesRef.BoundingClientRectCallback): SelectorQuery;
12
+ scrollOffset(cb: any): SelectorQuery;
13
+ fields(fields: Taro.NodesRef.Fields, cb?: Taro.NodesRef.FieldsCallback): SelectorQuery;
14
+ }
@@ -0,0 +1,39 @@
1
+ import { NodesRef } from './nodesRef';
2
+ import type Taro from '@tarojs/taro/types';
3
+ interface ISelectorQueryQueue {
4
+ component: any;
5
+ selector: string;
6
+ single: boolean;
7
+ fields: any;
8
+ }
9
+ type TSelectorQueryQueueCallback = (res: ISelectorQueryQueue) => void;
10
+ export declare class SelectorQuery implements Taro.SelectorQuery {
11
+ _queue: ISelectorQueryQueue[];
12
+ _queueCb: (TSelectorQueryQueueCallback | null)[];
13
+ _component?: any;
14
+ constructor();
15
+ /**
16
+ * 设置选择器的选取范围
17
+ * @param component 指定组件
18
+ * @return selectQuery 返回查询对象
19
+ */
20
+ in: (_: any) => this;
21
+ /**
22
+ * 在当前页面下选择第一个匹配选择器selector的节点
23
+ * @param selector
24
+ * @return nodesRef 返回一个NodesRef 对象实例,可以用于获取节点信息
25
+ */
26
+ select(selector: string): NodesRef;
27
+ /**
28
+ * 在当前页面下选择匹配选择器selector的所有节点
29
+ * @param selector
30
+ */
31
+ selectAll(selector: string): NodesRef;
32
+ /**
33
+ * 选择显示区域。可用于获取显示区域的尺寸、滚动位置等信息
34
+ */
35
+ selectViewport(): NodesRef;
36
+ exec(cb?: (...args: any[]) => any): any;
37
+ _push(selector: any, component: any, single: any, fields: any, callback?: Taro.NodesRef.FieldsCallback | null): void;
38
+ }
39
+ export {};
@@ -0,0 +1,53 @@
1
+ export declare const TaroViewTagName = "view";
2
+ export declare const TaroIconTagName = "icon";
3
+ export declare const TaroProgressTagName = "progress";
4
+ export declare const TaroRichTextTagName = "rich-text";
5
+ export declare const TaroTextTagName = "text";
6
+ export declare const TaroButtonTagName = "button";
7
+ export declare const TaroCheckboxTagName = "checkbox";
8
+ export declare const TaroCheckboxGroupTagName = "checkbox-group";
9
+ export declare const TaroFormTagName = "form";
10
+ export declare const TaroInputTagName = "input";
11
+ export declare const TaroLabelTagName = "label";
12
+ export declare const TaroPickerTagName = "picker";
13
+ export declare const TaroPickerViewTagName = "picker-view";
14
+ export declare const TaroPickerViewColumnTagName = "picker-view-column";
15
+ export declare const TaroRadioTagName = "radio";
16
+ export declare const TaroRadioGroupTagName = "radio-group";
17
+ export declare const TaroSliderTagName = "slider";
18
+ export declare const TaroSwitchTagName = "switch";
19
+ export declare const TaroCoverImageTagName = "cover-image";
20
+ export declare const TaroTextareaTagName = "textarea";
21
+ export declare const TaroCoverViewTagName = "cover-view";
22
+ export declare const TaroMovableAreaTagName = "movable-area";
23
+ export declare const TaroMovableViewTagName = "movable-view";
24
+ export declare const TaroScrollViewTagName = "scroll-view";
25
+ export declare const TaroSwiperTagName = "swiper";
26
+ export declare const TaroSwiperItemTagName = "swiper-item";
27
+ export declare const TaroNavigatorTagName = "navigator";
28
+ export declare const TaroAudioTagName = "audio";
29
+ export declare const TaroCameraTagName = "camera";
30
+ export declare const TaroImageTagName = "image";
31
+ export declare const TaroLivePlayerTagName = "live-player";
32
+ export declare const TaroVideoTagName = "video";
33
+ export declare const TaroCanvasTagName = "canvas";
34
+ export declare const TaroAdTagName = "ad";
35
+ export declare const TaroWebViewTagName = "web-view";
36
+ export declare const TaroBlockTagName = "block";
37
+ export declare const TaroMapTagName = "map";
38
+ export declare const TaroPageMetaTagName = "page-meta";
39
+ export declare const TaroNavigationBarTagName = "navigation-bar";
40
+ export declare const TaroSlotTagName = "slot";
41
+ export declare const TaroNativeSlotTagName = "native-slot";
42
+ export declare const TaroCustomWrapperTagName = "custom-wrapper";
43
+ export declare const TaroSpanTagName = "span";
44
+ export declare const TaroTabsTagName = "tabs";
45
+ export declare const TaroTabBarTagName = "tab-bar";
46
+ export declare const TaroTabContentTagName = "tab-content";
47
+ export declare const TaroListTagName = "list";
48
+ export declare const TaroListItemTagName = "list-item";
49
+ export declare const TaroOpenDataTagName = "open-data";
50
+ export declare const TaroIgnoreTagName = "ignore";
51
+ export declare const TaroStickySectionTagName = "sticky-section";
52
+ export declare const TaroStickyHeaderTagName = "sticky-header";
53
+ export declare const TaroListViewTagName = "list-view";
@@ -0,0 +1,7 @@
1
+ /// <reference types="types/runtime" />
2
+ import { TaroAny, TaroElement } from '@tarojs/runtime';
3
+ export declare class DynamicCenter {
4
+ install(node: TaroElement, parentNode: TaroElement): void;
5
+ uninstall(node: TaroElement): void;
6
+ bindComponentToNodeWithDFS(node: TaroElement, component: TaroAny): void;
7
+ }
@@ -0,0 +1,3 @@
1
+ /// <reference types="types/runtime" />
2
+ import { EventOptions, TaroElement, TaroEvent } from '@tarojs/runtime';
3
+ export declare function createTaroEvent(type: string, opts?: Partial<EventOptions>, node?: TaroElement): TaroEvent;
@@ -0,0 +1,11 @@
1
+ export type TTreeNode = {
2
+ type: string;
3
+ name?: string;
4
+ content?: string;
5
+ attributes?: Record<string, string>;
6
+ children?: TTreeNode[];
7
+ endIndex?: number;
8
+ selfClosing?: boolean;
9
+ };
10
+ declare function parseHTML(htmlString: string): TTreeNode[];
11
+ export default parseHTML;
@@ -0,0 +1,3 @@
1
+ /// <reference types="types/runtime" />
2
+ import { TaroElement } from '@tarojs/runtime';
3
+ export default function htmlParser(htmlString: string): TaroElement;
@@ -0,0 +1,11 @@
1
+ /// <reference types="types/runtime" />
2
+ import type { TaroRichTextElement } from '@tarojs/runtime';
3
+ export declare function getSingleSelector(range: any, rangeKey: any): any[];
4
+ export declare function getMultiSelector(ctx: any, range: any, rangeKey: any, value: any): any;
5
+ export declare function getUnit(val: string | number): string;
6
+ export declare function generateText(node: TaroRichTextElement): string;
7
+ export declare function computeBackgroundPosition(style: any): {
8
+ offsetX: any;
9
+ offsetY: any;
10
+ };
11
+ export declare function convertVp2Px(val: string | number): number;
@@ -0,0 +1,7 @@
1
+ export * from '@tarojs/components/mini';
2
+ export declare const Span = "span";
3
+ export declare const Tabs = "tabs";
4
+ export declare const TabBar = "tab-bar";
5
+ export declare const TabContent = "tab-content";
6
+ export declare const List = "list";
7
+ export declare const ListItem = "list-item";
@@ -1,43 +1,4 @@
1
- const View = 'view';
2
- const Icon = 'icon';
3
- const Progress = 'progress';
4
- const RichText = 'rich-text';
5
- const Text = 'text';
6
- const Button = 'button';
7
- const Checkbox = 'checkbox';
8
- const CheckboxGroup = 'checkbox-group';
9
- const Form = 'form';
10
- const Input = 'input';
11
- const Label = 'label';
12
- const Picker = 'picker';
13
- const PickerView = 'picker-view';
14
- const PickerViewColumn = 'picker-view-column';
15
- const Radio = 'radio';
16
- const RadioGroup = 'radio-group';
17
- const Slider = 'slider';
18
- const Switch = 'switch';
19
- const CoverImage = 'cover-image';
20
- const Textarea = 'textarea';
21
- const CoverView = 'cover-view';
22
- const MovableArea = 'movable-area';
23
- const MovableView = 'movable-view';
24
- const ScrollView = 'scroll-view';
25
- const Swiper = 'swiper';
26
- const SwiperItem = 'swiper-item';
27
- const Navigator = 'navigator';
28
- const Audio = 'audio';
29
- const Camera = 'camera';
30
- const Image = 'image';
31
- const LivePlayer = 'live-player';
32
- const Video = 'video';
33
- const Canvas = 'canvas';
34
- const Ad = 'ad';
35
- const WebView = 'web-view';
36
- const Block = 'block';
37
- const Map = 'map';
38
- const Slot = 'slot';
39
- const NativeSlot = 'native-slot';
40
- const CustomWrapper = 'custom-wrapper';
1
+ export * from '@tarojs/components/mini';
41
2
 
42
3
  // For React.createElement's type
43
4
  const Span = 'span';
@@ -47,5 +8,5 @@ const TabContent = 'tab-content';
47
8
  const List = 'list';
48
9
  const ListItem = 'list-item';
49
10
 
50
- export { Ad, Audio, Block, Button, Camera, Canvas, Checkbox, CheckboxGroup, CoverImage, CoverView, CustomWrapper, Form, Icon, Image, Input, Label, List, ListItem, LivePlayer, Map, MovableArea, MovableView, NativeSlot, Navigator, Picker, PickerView, PickerViewColumn, Progress, Radio, RadioGroup, RichText, ScrollView, Slider, Slot, Span, Swiper, SwiperItem, Switch, TabBar, TabContent, Tabs, Text, Textarea, Video, View, WebView };
11
+ export { List, ListItem, Span, TabBar, TabContent, Tabs };
51
12
  //# sourceMappingURL=components-react.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"components-react.js","sources":["../../src/components/components-react.ts"],"sourcesContent":["// For React.createElement's type\nexport * from '@tarojs/components/mini'\nexport const Span = 'span'\nexport const Tabs = 'tabs'\nexport const TabBar = 'tab-bar'\nexport const TabContent = 'tab-content'\nexport const List = 'list'\nexport const ListItem = 'list-item'\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAEO,MAAM,IAAI,GAAG,OAAM;AACnB,MAAM,IAAI,GAAG,OAAM;AACnB,MAAM,MAAM,GAAG,UAAS;AACxB,MAAM,UAAU,GAAG,cAAa;AAChC,MAAM,IAAI,GAAG,OAAM;AACnB,MAAM,QAAQ,GAAG;;;;"}
1
+ {"version":3,"file":"components-react.js","sources":["../../src/components/components-react.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAAA;AAEO,MAAM,IAAI,GAAG,OAAM;AACnB,MAAM,IAAI,GAAG,OAAM;AACnB,MAAM,MAAM,GAAG,UAAS;AACxB,MAAM,UAAU,GAAG,cAAa;AAChC,MAAM,IAAI,GAAG,OAAM;AACnB,MAAM,QAAQ,GAAG;;;;"}
@@ -0,0 +1,119 @@
1
+ export declare const components: {
2
+ Checkbox: {
3
+ 'group-id': string;
4
+ cn: string;
5
+ };
6
+ Span: {};
7
+ Tabs: {
8
+ index: string;
9
+ vertical: string;
10
+ bindchange: string;
11
+ };
12
+ TabBar: {
13
+ mode: string;
14
+ };
15
+ TabContent: {
16
+ scrollable: string;
17
+ };
18
+ List: {
19
+ scrollpage: string;
20
+ cachedcount: string;
21
+ scrollbar: string;
22
+ scrolleffect: string;
23
+ indexer: string;
24
+ indexercircle: string;
25
+ indexermulti: string;
26
+ indexerbubble: string;
27
+ divider: string;
28
+ shapemode: string;
29
+ itemscale: string;
30
+ itemcenter: string;
31
+ updateeffect: string;
32
+ chainanimation: string;
33
+ scrollvibrate: string;
34
+ initialindex: string;
35
+ initialoffset: string;
36
+ selected: string;
37
+ bindindexerchange: string;
38
+ bindscroll: string;
39
+ bindscrollbottom: string;
40
+ bindscrolltop: string;
41
+ bindscrollend: string;
42
+ bindscrolltouchup: string;
43
+ bindrequestitem: string;
44
+ };
45
+ ListItem: {
46
+ type: string;
47
+ primary: string;
48
+ section: string;
49
+ sticky: string;
50
+ stickyradius: string;
51
+ clickeffect: string;
52
+ bindsticky: string;
53
+ };
54
+ Switch: {
55
+ showtext: string;
56
+ texton: string;
57
+ textoff: string;
58
+ };
59
+ Textarea: {
60
+ headericon: string;
61
+ showcounter: string;
62
+ menuoptions: string;
63
+ softkeyboardenabled: string;
64
+ bindtranslate: string;
65
+ bindshare: string;
66
+ bindsearch: string;
67
+ bindoptionselect: string;
68
+ bindselectchange: string;
69
+ };
70
+ Progress: {
71
+ 'active-color': string;
72
+ 'background-color': string;
73
+ type: string;
74
+ 'font-size': string;
75
+ secondarypercent: string;
76
+ clockwise: string;
77
+ };
78
+ Slider: {
79
+ showsteps: string;
80
+ showtips: string;
81
+ };
82
+ Input: {
83
+ 'placeholder-color': string;
84
+ };
85
+ Video: {
86
+ speed: string;
87
+ bindloadedmetadata: string;
88
+ bindprogress: string;
89
+ bindtap: string;
90
+ };
91
+ Image: {
92
+ alt: string;
93
+ };
94
+ Radio: {
95
+ 'group-id': string;
96
+ };
97
+ Picker: {
98
+ selected: string;
99
+ hours: string;
100
+ containsecond: string;
101
+ vibrate: string;
102
+ lunar: string;
103
+ lunarswitch: string;
104
+ };
105
+ PickerView: {
106
+ mode: string;
107
+ range: string;
108
+ selected: string;
109
+ hours: string;
110
+ indicatorprefix: string;
111
+ indicatorsuffix: string;
112
+ containsecond: string;
113
+ vibrate: string;
114
+ lunar: string;
115
+ lunarswitch: string;
116
+ bindcolumnchange: string;
117
+ cn: string;
118
+ };
119
+ };
package/dist/index.d.ts CHANGED
@@ -1,152 +1,10 @@
1
- /* eslint-disable no-console */
2
- import { IFileType, TConfig, TaroPlatform, IPluginContext, TaroPlatformBase } from "@tarojs/service";
3
- import { PLATFORM_TYPE } from "@tarojs/shared";
4
- declare abstract class TaroPlatformHarmony<T extends TConfig = TConfig> extends TaroPlatform<T> {
5
- platformType: PLATFORM_TYPE;
6
- globalObject: string;
7
- abstract fileType: IFileType;
8
- abstract useETS: boolean;
9
- abstract useJSON5: boolean;
10
- taroComponentsPath: string;
11
- /**
12
- * 1. 清空 dist 文件夹
13
- * 2. 输出编译提示
14
- */
15
- private setup;
16
- private setupHarmonyApp;
17
- protected printDevelopmentTip(): void;
18
- /**
19
- * 返回当前项目内的 runner 包
20
- */
21
- protected getRunner(): Promise<any>;
22
- /**
23
- * 准备 runner 参数
24
- * @param extraOptions 需要额外合入 Options 的配置项
25
- */
26
- protected getOptions(extraOptions?: {}): any;
27
- /**
28
- * 调用 runner 开始编译
29
- * @param extraOptions 需要额外传入 runner 的配置项
30
- */
31
- private build;
32
- private buildHarmonyApp;
33
- /**
34
- * 调用 runner 开启编译
35
- */
36
- start(): Promise<void>;
37
- }
38
- declare class Harmony extends TaroPlatformHarmony {
39
- #private;
40
- platform: string;
41
- globalObject: string;
42
- fileType: {
43
- templ: string;
44
- style: string;
45
- config: string;
46
- script: string;
47
- };
48
- useETS: boolean;
49
- useJSON5: boolean;
50
- runtimePath: string[] | string;
51
- taroComponentsPath: string;
52
- apiEntryList: RegExp[];
53
- constructor(ctx: IPluginContext, config: TConfig);
54
- get framework(): "solid" | "vue3" | "react" | "preact" | "none";
55
- get aliasFramework(): string;
56
- get apiLibrary(): string;
57
- get apiEntry(): RegExp[];
58
- get componentLibrary(): string;
59
- get runtimeLibrary(): string;
60
- get runtimeFrameworkLibrary(): string;
61
- get defineConstants(): Record<string, string>;
62
- extensions: string[];
63
- excludeLibraries: (string | RegExp)[];
64
- externalDeps: [
65
- string,
66
- RegExp,
67
- string?
68
- ][];
69
- harmonyScope: RegExp[];
70
- indexOfLibraries(lib: string): number;
71
- removeFromLibraries(lib: string): void;
72
- moveLibraries(lib: string, target?: string, basedir?: string, sync?: boolean): void;
73
- replaceDefineValue(code: string, define: Record<string, string>, ext?: string): string;
74
- /**
75
- * 修改 Vite 配置
76
- */
77
- modifyViteConfig(): void;
78
- handleResourceEmit(outDir: string, basedir?: string): void;
79
- }
80
- declare module HarmonyWrapper {
81
- export { Harmony };
82
- }
83
- import HarmonyOS_ArkTS = HarmonyWrapper.Harmony;
84
- declare class Harmony$0 extends TaroPlatformBase {
85
- platform: string;
86
- globalObject: string;
87
- runtimePath: string;
88
- taroComponentsPath: string;
89
- fileType: {
90
- templ: string;
91
- style: string;
92
- config: string;
93
- script: string;
94
- };
95
- template: any;
96
- /**
97
- * 1. setupTransaction - init
98
- * 2. setup
99
- * 3. setupTransaction - close
100
- * 4. buildTransaction - init
101
- * 5. build
102
- * 6. buildTransaction - close
103
- */
104
- constructor(ctx: any, config: any);
105
- /**
106
- * 增加组件或修改组件属性
107
- */
108
- modifyComponents(): void;
109
- /**
110
- * 不需要转 rpx
111
- */
112
- modifyPostcssConfigs(config: Record<string, any>): void;
113
- /**
114
- * 模板自定义组件 js
115
- * 等鸿蒙支持 template 后需要重构
116
- */
117
- addEntry(): void;
118
- /**
119
- * 把 app、pages、自定义组件的 js 改造为鸿蒙的 export default 导出形式
120
- */
121
- modifyTaroExport(): void;
122
- /**
123
- * 修改最终的编译产物
124
- * 1. 生成模板自定义组件的 xml、css 文件
125
- * 2. 删除多余的文件
126
- * 3. 把 components-harmony 中被使用到的组件移动到输出目录
127
- */
128
- modifyBuildAssets(ctx: any, config: any): void;
129
- modifyWebpackConfig(): void;
130
- modifyHarmonyConfig(pages: any, { projectPath, hapName, name }: {
131
- projectPath: any;
132
- hapName: any;
133
- name: any;
134
- }): void;
135
- modifyHostPackage({ projectPath, hapName }: {
136
- projectPath: any;
137
- hapName?: string | undefined;
138
- }): Promise<any>;
139
- getChunkEntryModule(compilation: any, chunk: any, compiler?: string): any;
140
- checkMetaType(entryModule: any): boolean;
141
- isHarmonyRequest(request: string): boolean;
142
- }
143
- declare module HarmonyWrapper {
144
- export { Harmony$0 as Harmony };
145
- }
146
- import HarmonyOS_JSUI = HarmonyWrapper.Harmony;
147
- interface IOptions {
1
+ import HarmonyOS_ArkTS from './program/arkTS';
2
+ import HarmonyOS_JSUI from './program/jsUI';
3
+ import type { IPluginContext } from '@tarojs/service';
4
+ export { HarmonyOS_ArkTS, HarmonyOS_JSUI };
5
+ export interface IOptions {
148
6
  disableArkTS?: boolean;
149
7
  useConfigName?: string;
150
8
  }
151
9
  declare const _default: (ctx: IPluginContext, options?: IOptions) => void;
152
- export { _default as default, HarmonyOS_ArkTS, HarmonyOS_JSUI, IOptions };
10
+ export default _default;
package/dist/index.js CHANGED
@@ -43,7 +43,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
43
43
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
44
44
  PERFORMANCE OF THIS SOFTWARE.
45
45
  ***************************************************************************** */
46
- /* global Reflect, Promise, SuppressedError, Symbol */
46
+ /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
47
47
 
48
48
 
49
49
  function __awaiter(thisArg, _arguments, P, generator) {
@@ -83,6 +83,7 @@ function apiLoader(str) {
83
83
  useLaunch,
84
84
  useLoad,
85
85
  useOptionMenuClick,
86
+ useKeyboardHeight,
86
87
  usePageNotFound,
87
88
  usePageScroll,
88
89
  usePullDownRefresh,
@@ -109,6 +110,7 @@ taro.useError = useError
109
110
  taro.useLaunch = useLaunch
110
111
  taro.useLoad = useLoad
111
112
  taro.useOptionMenuClick = useOptionMenuClick
113
+ taro.useKeyboardHeight = useKeyboardHeight
112
114
  taro.usePageNotFound = usePageNotFound
113
115
  taro.usePageScroll = usePageScroll
114
116
  taro.usePullDownRefresh = usePullDownRefresh
@@ -134,6 +136,7 @@ export {
134
136
  useLaunch,
135
137
  useLoad,
136
138
  useOptionMenuClick,
139
+ useKeyboardHeight,
137
140
  usePageNotFound,
138
141
  usePageScroll,
139
142
  usePullDownRefresh,
@@ -512,7 +515,7 @@ let Harmony$1 = class Harmony extends TaroPlatformHarmony {
512
515
  define.global = 'globalThis';
513
516
  }
514
517
  const ext = path__namespace.extname(target);
515
- if (![/d\.e?tsx?$/, /\.(json|map|md)$/].some(e => e.test(target))) {
518
+ if (![/\.d\.e?tsx?$/, /\.(json|map|md)$/].some(e => e.test(target))) {
516
519
  code = this.replaceDefineValue(code, define, ext);
517
520
  }
518
521
  if (['.ts'].includes(ext)) {
@@ -527,12 +530,12 @@ let Harmony$1 = class Harmony extends TaroPlatformHarmony {
527
530
  // Note: 传入 chorePackagePrefix 时,不生成核心依赖库
528
531
  if (!chorePackagePrefix) {
529
532
  if (/tarojs[\\/]taro[\\/]types[\\/]index.d.ts/.test(target)) {
530
- code = `/// <reference path="global.d.ts" />
533
+ code = `import './global.d.ts'
531
534
 
532
- /// <reference path="taro.api.d.ts" />
533
- /// <reference path="taro.component.d.ts" />
534
- /// <reference path="taro.config.d.ts" />
535
- /// <reference path="taro.lifecycle.d.ts" />
535
+ import './taro.api.d.ts'
536
+ import './taro.component.d.ts'
537
+ import './taro.config.d.ts'
538
+ import './taro.lifecycle.d.ts'
536
539
 
537
540
  export = Taro
538
541
  export as namespace Taro
@@ -625,7 +628,7 @@ declare global {
625
628
  // Note: 映射 Taro 相关依赖到注入 taro 目录
626
629
  if (that.indexOfLibraries(source) > -1) {
627
630
  return {
628
- external: 'resolve',
631
+ external: 'relative',
629
632
  id: path__namespace.join(outputRoot, 'npm', source),
630
633
  moduleSideEffects: false,
631
634
  resolvedBy: name,
@@ -924,6 +927,7 @@ ${elements}
924
927
  components.Button.type = "'default'";
925
928
  const result = super.createMiniComponents(components);
926
929
  delete result['pure-view'];
930
+ delete result['click-view'];
927
931
  delete result['static-view'];
928
932
  delete result['static-text'];
929
933
  delete result['static-image'];