@dcloudio/uni-app-x 0.4.6 → 0.5.1

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 (116) hide show
  1. package/README.md +39 -0
  2. package/package.json +5 -3
  3. package/types/app.d.ts +36 -82
  4. package/types/native/CSSStyleDeclaration.d.ts +2 -2
  5. package/types/native/CustomEvent.d.ts +0 -2
  6. package/types/native/DOMRect.d.ts +4 -4
  7. package/types/native/DomNode.d.ts +48 -0
  8. package/types/native/DrawableContext.d.ts +42 -16
  9. package/types/native/Element.d.ts +234 -0
  10. package/types/native/Event.d.ts +14 -3
  11. package/types/native/IDocument.d.ts +6 -6
  12. package/types/native/IPage.d.ts +27 -11
  13. package/types/native/IPageManager.d.ts +2 -2
  14. package/types/native/ITabsNode.d.ts +4 -4
  15. package/types/native/IUniError.d.ts +20 -0
  16. package/types/native/IWebViewNode.d.ts +2 -2
  17. package/types/native/InputBlurEvent.d.ts +13 -0
  18. package/types/native/InputConfirmEvent.d.ts +13 -0
  19. package/types/native/InputEvent.d.ts +21 -0
  20. package/types/native/InputFocusEvent.d.ts +17 -0
  21. package/types/native/InputKeyboardHeightChangeEvent.d.ts +17 -0
  22. package/types/native/MouseEvent.d.ts +13 -1
  23. package/types/native/NestedPreScrollEvent.d.ts +23 -0
  24. package/types/native/ScrollToLowerEvent.d.ts +4 -1
  25. package/types/native/ScrollToUpperEvent.d.ts +5 -2
  26. package/types/native/SourceError.d.ts +0 -2
  27. package/types/native/StartNestedScrollEvent.d.ts +12 -0
  28. package/types/native/SwiperAnimationFinishEvent.d.ts +11 -0
  29. package/types/native/SwiperChangeEvent.d.ts +11 -0
  30. package/types/native/SwiperTransitionEvent.d.ts +11 -0
  31. package/types/native/TextareaBlurEvent.d.ts +17 -0
  32. package/types/native/TextareaFocusEvent.d.ts +17 -0
  33. package/types/native/TextareaLineChangeEvent.d.ts +21 -0
  34. package/types/native/TouchEvent.d.ts +5 -1
  35. package/types/native/UniError.d.ts +7 -3
  36. package/types/native/index.d.ts +18 -3
  37. package/types/page.d.ts +57 -212
  38. package/types/uni/core/index.d.ts +9 -7
  39. package/types/uni/core/lib/base/event/interface.d.ts +4 -4
  40. package/types/uni/core/lib/lifecycle/interface.d.ts +1 -1
  41. package/types/uni/core/lib/performance/interface.d.ts +0 -20
  42. package/types/uni/core/lib/route/index.d.ts +0 -10
  43. package/types/uni/core/lib/route/interface.d.ts +1805 -10
  44. package/types/uni/core/lib/ui/create-selector-query/interface.d.ts +242 -2
  45. package/types/uni/core/lib/ui/get-element-by-id/index.d.ts +9 -0
  46. package/types/uni/core/lib/ui/get-element-by-id/interface.d.ts +72 -0
  47. package/types/uni/core/lib/ui/load-font-face/interface.d.ts +486 -3
  48. package/types/uni/core/lib/ui/page-scroll-to/index.d.ts +0 -2
  49. package/types/uni/core/lib/ui/page-scroll-to/interface.d.ts +93 -9
  50. package/types/uni/core/lib/ui/pull-down-refresh/index.d.ts +0 -2
  51. package/types/uni/core/lib/ui/pull-down-refresh/interface.d.ts +2 -5
  52. package/types/uni/core/lib/ui/set-navigation-bar-color/interface.d.ts +373 -4
  53. package/types/uni/core/lib/ui/tab-bar/index.d.ts +2 -18
  54. package/types/uni/core/lib/ui/tab-bar/interface.d.ts +32 -35
  55. package/types/uni/index.d.ts +2 -1
  56. package/types/uni/{ext → uts-plugin-api}/index.d.ts +18 -17
  57. package/types/uni/{ext → uts-plugin-api}/lib/uni-audio/utssdk/interface.d.ts +2 -2
  58. package/types/uni/uts-plugin-api/lib/uni-createWebviewContext/utssdk/index.d.ts +11 -0
  59. package/types/uni/uts-plugin-api/lib/uni-createWebviewContext/utssdk/interface.d.ts +98 -0
  60. package/types/uni/{ext → uts-plugin-api}/lib/uni-exit/utssdk/interface.d.ts +1 -1
  61. package/types/uni/{ext → uts-plugin-api}/lib/uni-file-manager/utssdk/interface.d.ts +4 -32
  62. package/types/uni/{ext → uts-plugin-api}/lib/uni-getAccessibilityInfo/utssdk/interface.d.ts +1 -1
  63. package/types/uni/{ext → uts-plugin-api}/lib/uni-getAppAuthorizeSetting/utssdk/interface.d.ts +108 -10
  64. package/types/uni/uts-plugin-api/lib/uni-getAppBaseInfo/utssdk/interface.d.ts +233 -0
  65. package/types/uni/{ext → uts-plugin-api}/lib/uni-getDeviceInfo/utssdk/interface.d.ts +58 -46
  66. package/types/uni/{ext → uts-plugin-api}/lib/uni-getLocation-system/utssdk/index.d.ts +0 -2
  67. package/types/uni/{ext → uts-plugin-api}/lib/uni-getLocation-system/utssdk/interface.d.ts +14 -10
  68. package/types/uni/{ext → uts-plugin-api}/lib/uni-getNetworkType/utssdk/interface.d.ts +8 -5
  69. package/types/uni/uts-plugin-api/lib/uni-getRecorderManager/utssdk/interface.d.ts +213 -0
  70. package/types/uni/{ext → uts-plugin-api}/lib/uni-getSystemInfo/utssdk/interface.d.ts +108 -163
  71. package/types/uni/{ext → uts-plugin-api}/lib/uni-getSystemSetting/utssdk/interface.d.ts +3 -3
  72. package/types/uni/{ext → uts-plugin-api}/lib/uni-media/utssdk/index.d.ts +0 -20
  73. package/types/uni/uts-plugin-api/lib/uni-media/utssdk/interface.d.ts +794 -0
  74. package/types/uni/{ext → uts-plugin-api}/lib/uni-network/utssdk/app-ios/interface.d.ts +60 -19
  75. package/types/uni/{ext → uts-plugin-api}/lib/uni-network/utssdk/index.d.ts +4 -0
  76. package/types/uni/{ext → uts-plugin-api}/lib/uni-network/utssdk/interface.d.ts +138 -49
  77. package/types/uni/{ext → uts-plugin-api}/lib/uni-openAppAuthorizeSetting/utssdk/interface.d.ts +8 -5
  78. package/types/uni/{ext → uts-plugin-api}/lib/uni-prompt/utssdk/interface.d.ts +6 -6
  79. package/types/uni/{ext → uts-plugin-api}/lib/uni-storage/utssdk/index.d.ts +0 -10
  80. package/types/uni/{ext → uts-plugin-api}/lib/uni-storage/utssdk/interface.d.ts +33 -117
  81. package/types/uni/{ext → uts-plugin-api}/lib/uni-websocket/utssdk/index.d.ts +2 -0
  82. package/types/uni/{ext → uts-plugin-api}/lib/uni-websocket/utssdk/interface.d.ts +60 -35
  83. package/types/uni/uts-plugin-component/index.d.ts +1 -0
  84. package/types/uni/uts-plugin-component/lib/uni-video/utssdk/index.d.ts +15 -0
  85. package/types/uni/uts-plugin-component/lib/uni-video/utssdk/interface.d.ts +171 -0
  86. package/types/uni-cloud/index.d.ts +59 -333
  87. package/types/uni-cloud/interface.d.ts +786 -0
  88. package/types/vue/CheckboxGroupChangeEvent.d.ts +1 -1
  89. package/types/vue/PickerViewChangeEvent.d.ts +1 -1
  90. package/types/vue/ProgressActiveendEvent.d.ts +1 -1
  91. package/types/vue/RadioGroupChangeEvent.d.ts +1 -1
  92. package/types/vue/SliderChangeEvent.d.ts +10 -1
  93. package/types/vue/SwitchChangeEvent.d.ts +1 -1
  94. package/uts-plugin.d.ts +10 -0
  95. package/.env +0 -3
  96. package/tsconfig.json +0 -5
  97. package/types/native/INode.d.ts +0 -181
  98. package/types/native/UTSError.d.ts +0 -15
  99. package/types/native/UTSPromise.d.ts +0 -74
  100. package/types/uni/ext/lib/uni-file-manager/utssdk/index.d.ts +0 -35
  101. package/types/uni/ext/lib/uni-getAppBaseInfo/utssdk/interface.d.ts +0 -120
  102. package/types/uni/ext/lib/uni-getRecorderManager/utssdk/interface.d.ts +0 -213
  103. package/types/uni/ext/lib/uni-media/utssdk/interface.d.ts +0 -877
  104. /package/types/uni/{ext → uts-plugin-api}/lib/uni-audio/utssdk/index.d.ts +0 -0
  105. /package/types/uni/{ext → uts-plugin-api}/lib/uni-exit/utssdk/index.d.ts +0 -0
  106. /package/types/uni/{ext → uts-plugin-api}/lib/uni-getAccessibilityInfo/utssdk/index.d.ts +0 -0
  107. /package/types/uni/{ext → uts-plugin-api}/lib/uni-getAppAuthorizeSetting/utssdk/index.d.ts +0 -0
  108. /package/types/uni/{ext → uts-plugin-api}/lib/uni-getAppBaseInfo/utssdk/index.d.ts +0 -0
  109. /package/types/uni/{ext → uts-plugin-api}/lib/uni-getDeviceInfo/utssdk/index.d.ts +0 -0
  110. /package/types/uni/{ext → uts-plugin-api}/lib/uni-getNetworkType/utssdk/index.d.ts +0 -0
  111. /package/types/uni/{ext → uts-plugin-api}/lib/uni-getRecorderManager/utssdk/index.d.ts +0 -0
  112. /package/types/uni/{ext → uts-plugin-api}/lib/uni-getSystemInfo/utssdk/index.d.ts +0 -0
  113. /package/types/uni/{ext → uts-plugin-api}/lib/uni-getSystemSetting/utssdk/index.d.ts +0 -0
  114. /package/types/uni/{ext → uts-plugin-api}/lib/uni-network/utssdk/app-ios/index.d.ts +0 -0
  115. /package/types/uni/{ext → uts-plugin-api}/lib/uni-openAppAuthorizeSetting/utssdk/index.d.ts +0 -0
  116. /package/types/uni/{ext → uts-plugin-api}/lib/uni-prompt/utssdk/index.d.ts +0 -0
package/README.md ADDED
@@ -0,0 +1,39 @@
1
+ # uni-app x 类型
2
+
3
+ ## 初始化依赖
4
+
5
+ ```shell
6
+ pnpm i
7
+ ```
8
+
9
+ ## 配置环境
10
+
11
+ 当前目录建立 .env 文件
12
+
13
+ ```
14
+ UNI_CORE_DIR = "%vuejs-core 仓库路径%/packages/uni-ext-api/src"
15
+ UNI_UTS_PLUGIN_API_DIR = "%新 uni-app 仓库路径%/api"
16
+ UNI_UTS_PLUGIN_COMPONENT_DIR = "%新 uni-app 仓库路径%/component"
17
+ UNI_COMPLIER_META_DIR = "%旧 uni-app 仓库路径%/packages/uni-uts-v1/lib/ext-api"
18
+
19
+ ```
20
+
21
+ ## 构建
22
+
23
+ 构建框架内置 Uni Api
24
+
25
+ ```shell
26
+ pnpm build:types:core
27
+ ```
28
+
29
+ 构建 Ext Api
30
+
31
+ ```shell
32
+ pnpm build:types:ext
33
+ ```
34
+
35
+ 生成默认参数数据到编译器
36
+
37
+ ```shell
38
+ pnpm build:types:meta
39
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dcloudio/uni-app-x",
3
- "version": "0.4.6",
3
+ "version": "0.5.1",
4
4
  "description": "uni-app x types",
5
5
  "typings": "index.d.ts",
6
6
  "author": "DCloud",
@@ -8,9 +8,11 @@
8
8
  "type": "module",
9
9
  "scripts": {
10
10
  "build:types:core": "node ./scripts/build-types.js -t core",
11
- "build:types:ext": "node ./scripts/build-types.js -t ext",
11
+ "build:types:plugin:api": "node ./scripts/build-types.js -t uts-plugin-api",
12
+ "build:types:plugin:component": "node ./scripts/build-types.js -t uts-plugin-component",
13
+ "build:types:plugin": "npm run build:types:plugin:api && npm run build:types:plugin:component",
12
14
  "build:types:meta": "node ./scripts/build-meta.js",
13
- "build:types": "npm run build:types:core && npm run build:types:ext"
15
+ "build:types": "npm run build:types:core && npm run build:types:plugin"
14
16
  },
15
17
  "devDependencies": {
16
18
  "delete": "^1.1.0",
package/types/app.d.ts CHANGED
@@ -19,15 +19,15 @@ interface ReferrerInfo {
19
19
  extraData?: any;
20
20
  }
21
21
 
22
- interface LaunchShowOption {
22
+ interface OnLaunchOptions {
23
23
  /**
24
- * 打开小程序的路径
24
+ * 应用启动页面路径
25
25
  */
26
26
  path: string;
27
27
  /**
28
28
  * 打开小程序的query
29
29
  */
30
- query: AnyObject;
30
+ // query: AnyObject;
31
31
  /**
32
32
  * 打开小程序的场景值
33
33
  * - 1001: 发现栏小程序主入口,「最近使用」列表(基础库2.2.4版本起包含「我的小程序」列表)
@@ -100,15 +100,22 @@ interface LaunchShowOption {
100
100
  * - 1103: 发现栏小程序主入口,「我的小程序」列表(基础库2.2.4版本起废弃)
101
101
  * - 1104: 微信聊天主界面下拉,「我的小程序」栏(基础库2.2.4版本起废弃)
102
102
  */
103
- scene: number;
103
+ // scene: number;
104
104
  /**
105
105
  * 打开小程序的场景值
106
106
  */
107
- shareTicket: string;
107
+ // shareTicket: string;
108
108
  /**
109
109
  * 当场景为由从另一个小程序或公众号或App打开时,返回此字段
110
110
  */
111
- referrerInfo?: ReferrerInfo;
111
+ // referrerInfo?: ReferrerInfo;
112
+ }
113
+
114
+ interface OnShowOptions {
115
+ /**
116
+ * 应用启动页面路径
117
+ */
118
+ path: string
112
119
  }
113
120
 
114
121
  interface PageNotFoundOption {
@@ -183,17 +190,8 @@ interface AppInstance<T extends AnyObject = {}> {
183
190
  * "hostVer": "√",
184
191
  * "uniVer": "√",
185
192
  * "unixVer": "x"
186
- * },
187
- * "360": {
188
- * "hostVer": "√",
189
- * "uniVer": "√",
190
- * "unixVer": "x"
191
193
  * }
192
194
  * },
193
- * "quickapp": {
194
- * "uniVer": "√",
195
- * "unixVer": "x"
196
- * },
197
195
  * "web": {
198
196
  * "uniVer": "√",
199
197
  * "unixVer": "x"
@@ -206,7 +204,7 @@ interface AppInstance<T extends AnyObject = {}> {
206
204
  *
207
205
  * 应用初始化完成时触发,全局只触发一次。
208
206
  *
209
- * 文档: [https://uniapp.dcloud.io/collocation/frame/lifecycle](https://uniapp.dcloud.io/collocation/frame/lifecycle)
207
+ * @tutorial [https://uniapp.dcloud.io/collocation/frame/lifecycle](https://uniapp.dcloud.io/collocation/frame/lifecycle)
210
208
  * @uniPlatform {
211
209
  * "app": {
212
210
  * "android": {
@@ -260,30 +258,21 @@ interface AppInstance<T extends AnyObject = {}> {
260
258
  * "hostVer": "√",
261
259
  * "uniVer": "√",
262
260
  * "unixVer": "x"
263
- * },
264
- * "360": {
265
- * "hostVer": "√",
266
- * "uniVer": "√",
267
- * "unixVer": "x"
268
261
  * }
269
262
  * },
270
- * "quickapp": {
271
- * "uniVer": "√",
272
- * "unixVer": "x"
273
- * },
274
263
  * "web": {
275
264
  * "uniVer": "√",
276
265
  * "unixVer": "x"
277
266
  * }
278
267
  *}
279
268
  */
280
- onLaunch?(options?: LaunchShowOption): void;
269
+ onLaunch?(options?: OnLaunchOptions): void;
281
270
  /**
282
271
  * 生命周期回调 监听应用显示
283
272
  *
284
273
  * 应用启动,或从后台进入前台显示时触发
285
274
  *
286
- * 文档: [https://uniapp.dcloud.io/collocation/frame/lifecycle](https://uniapp.dcloud.io/collocation/frame/lifecycle)
275
+ * @tutorial [https://uniapp.dcloud.io/collocation/frame/lifecycle](https://uniapp.dcloud.io/collocation/frame/lifecycle)
287
276
  * @uniPlatform {
288
277
  * "app": {
289
278
  * "android": {
@@ -337,30 +326,21 @@ interface AppInstance<T extends AnyObject = {}> {
337
326
  * "hostVer": "√",
338
327
  * "uniVer": "√",
339
328
  * "unixVer": "x"
340
- * },
341
- * "360": {
342
- * "hostVer": "√",
343
- * "uniVer": "√",
344
- * "unixVer": "x"
345
329
  * }
346
330
  * },
347
- * "quickapp": {
348
- * "uniVer": "√",
349
- * "unixVer": "x"
350
- * },
351
331
  * "web": {
352
332
  * "uniVer": "√",
353
333
  * "unixVer": "x"
354
334
  * }
355
335
  *}
356
336
  */
357
- onShow?(options?: LaunchShowOption): void;
337
+ onShow?(options?: OnShowOptions): void;
358
338
  /**
359
339
  * 生命周期回调 监听应用隐藏
360
340
  *
361
341
  * 应用从前台进入后台时触发
362
342
  *
363
- * 文档: [https://uniapp.dcloud.io/collocation/frame/lifecycle](https://uniapp.dcloud.io/collocation/frame/lifecycle)
343
+ * @tutorial [https://uniapp.dcloud.io/collocation/frame/lifecycle](https://uniapp.dcloud.io/collocation/frame/lifecycle)
364
344
  * @uniPlatform {
365
345
  * "app": {
366
346
  * "android": {
@@ -414,17 +394,8 @@ interface AppInstance<T extends AnyObject = {}> {
414
394
  * "hostVer": "√",
415
395
  * "uniVer": "√",
416
396
  * "unixVer": "x"
417
- * },
418
- * "360": {
419
- * "hostVer": "√",
420
- * "uniVer": "√",
421
- * "unixVer": "x"
422
397
  * }
423
398
  * },
424
- * "quickapp": {
425
- * "uniVer": "√",
426
- * "unixVer": "x"
427
- * },
428
399
  * "web": {
429
400
  * "uniVer": "√",
430
401
  * "unixVer": "x"
@@ -437,7 +408,7 @@ interface AppInstance<T extends AnyObject = {}> {
437
408
  * 小程序发生脚本错误或 API 调用报错时触发
438
409
  * @param error 错误信息,包含堆栈
439
410
  *
440
- * 文档: [https://uniapp.dcloud.io/collocation/frame/lifecycle](https://uniapp.dcloud.io/collocation/frame/lifecycle)
411
+ * @tutorial [https://uniapp.dcloud.io/collocation/frame/lifecycle](https://uniapp.dcloud.io/collocation/frame/lifecycle)
441
412
  * @uniPlatform {
442
413
  * "app": {
443
414
  * "android": {
@@ -491,17 +462,8 @@ interface AppInstance<T extends AnyObject = {}> {
491
462
  * "hostVer": "√",
492
463
  * "uniVer": "√",
493
464
  * "unixVer": "x"
494
- * },
495
- * "360": {
496
- * "hostVer": "√",
497
- * "uniVer": "√",
498
- * "unixVer": "x"
499
465
  * }
500
466
  * },
501
- * "quickapp": {
502
- * "uniVer": "√",
503
- * "unixVer": "x"
504
- * },
505
467
  * "web": {
506
468
  * "uniVer": "√",
507
469
  * "unixVer": "x"
@@ -518,7 +480,7 @@ interface AppInstance<T extends AnyObject = {}> {
518
480
  * 1. 如果开发者没有添加 `onPageNotFound` 监听,当跳转页面不存在时,将推入微信客户端原生的页面不存在提示页面。
519
481
  * 2. 如果 `onPageNotFound` 回调中又重定向到另一个不存在的页面,将推入微信客户端原生的页面不存在提示页面,并且不再回调 `onPageNotFound`。
520
482
  *
521
- * 文档: [https://uniapp.dcloud.io/collocation/frame/lifecycle](https://uniapp.dcloud.io/collocation/frame/lifecycle)
483
+ * @tutorial [https://uniapp.dcloud.io/collocation/frame/lifecycle](https://uniapp.dcloud.io/collocation/frame/lifecycle)
522
484
  * @uniPlatform {
523
485
  * "app": {
524
486
  * "android": {
@@ -572,17 +534,8 @@ interface AppInstance<T extends AnyObject = {}> {
572
534
  * "hostVer": "√",
573
535
  * "uniVer": "√",
574
536
  * "unixVer": "x"
575
- * },
576
- * "360": {
577
- * "hostVer": "√",
578
- * "uniVer": "√",
579
- * "unixVer": "x"
580
537
  * }
581
538
  * },
582
- * "quickapp": {
583
- * "uniVer": "√",
584
- * "unixVer": "x"
585
- * },
586
539
  * "web": {
587
540
  * "uniVer": "√",
588
541
  * "unixVer": "x"
@@ -593,7 +546,7 @@ interface AppInstance<T extends AnyObject = {}> {
593
546
  /**
594
547
  * 未处理的 Promise 拒绝事件监听函数
595
548
  *
596
- * 文档: [https://uniapp.dcloud.io/collocation/frame/lifecycle](https://uniapp.dcloud.io/collocation/frame/lifecycle)
549
+ * @tutorial [https://uniapp.dcloud.io/collocation/frame/lifecycle](https://uniapp.dcloud.io/collocation/frame/lifecycle)
597
550
  * @uniPlatform {
598
551
  * "app": {
599
552
  * "android": {
@@ -664,11 +617,13 @@ interface AppInstance<T extends AnyObject = {}> {
664
617
  * }
665
618
  *}
666
619
  */
667
- onUnhandledRejection?(options: UniNamespace.OnUnhandledRejectionCallbackResult): void;
620
+
621
+ // onUnhandledRejection?(options: UniNamespace.OnUnhandledRejectionCallbackResult): void;
622
+
668
623
  /**
669
624
  * 监听系统主题变化
670
625
  *
671
- * 文档: [https://uniapp.dcloud.io/collocation/frame/lifecycle](https://uniapp.dcloud.io/collocation/frame/lifecycle)
626
+ * @tutorial [https://uniapp.dcloud.io/collocation/frame/lifecycle](https://uniapp.dcloud.io/collocation/frame/lifecycle)
672
627
  * @uniPlatform {
673
628
  * "app": {
674
629
  * "android": {
@@ -739,13 +694,15 @@ interface AppInstance<T extends AnyObject = {}> {
739
694
  * }
740
695
  *}
741
696
  */
742
- onThemeChange?(options: UniNamespace.OnThemeChangeCallbackResult): void;
697
+
698
+ // onThemeChange?(options: UniNamespace.OnThemeChangeCallbackResult): void;
699
+
743
700
  /**
744
701
  * 监听 nvue 页面消息
745
702
  *
746
703
  * nvue 页面使用 `uni.postMessage` 发送消息时触发
747
704
  *
748
- * 文档: [https://uniapp.dcloud.io/collocation/frame/lifecycle](https://uniapp.dcloud.io/collocation/frame/lifecycle)
705
+ * @tutorial [https://uniapp.dcloud.io/collocation/frame/lifecycle](https://uniapp.dcloud.io/collocation/frame/lifecycle)
749
706
  * @uniPlatform {
750
707
  * "app": {
751
708
  * "android": {
@@ -820,7 +777,7 @@ interface AppInstance<T extends AnyObject = {}> {
820
777
  /**
821
778
  * 监听应用退出。app-uvue-android 3.9+
822
779
  *
823
- * 文档: [https://uniapp.dcloud.io/collocation/frame/lifecycle](https://uniapp.dcloud.io/collocation/frame/lifecycle)
780
+ * @tutorial [https://uniapp.dcloud.io/collocation/frame/lifecycle](https://uniapp.dcloud.io/collocation/frame/lifecycle)
824
781
  * @uniPlatform {
825
782
  * "app": {
826
783
  * "android": {
@@ -895,7 +852,7 @@ interface AppInstance<T extends AnyObject = {}> {
895
852
  /**
896
853
  * 最后一个页面按下Android back键,常用于自定义退出。app-uvue-android 3.9+
897
854
  *
898
- * 文档: [https://uniapp.dcloud.io/collocation/frame/lifecycle](https://uniapp.dcloud.io/collocation/frame/lifecycle)
855
+ * @tutorial [https://uniapp.dcloud.io/collocation/frame/lifecycle](https://uniapp.dcloud.io/collocation/frame/lifecycle)
899
856
  * @uniPlatform {
900
857
  * "app": {
901
858
  * "android": {
@@ -973,14 +930,11 @@ type AppConstructor = <T extends AnyObject & AppInstance>(
973
930
  options: AppInstance<T> & T,
974
931
  ) => void;
975
932
 
976
- interface GetAppOption {
977
- /**
978
- * 在 `App` 未定义时返回默认实现。当App被调用时,默认实现中定义的属性会被覆盖合并到App中。一般用于独立分包
979
- */
980
- allowDefault: boolean;
981
- }
982
-
983
- type GetApp = <T extends AnyObject>(opts?: GetAppOption) => AppInstance<T> & T;
984
933
 
934
+ /**
935
+ * `getApp()` 函数用于获取当前应用实例。
936
+ * @tutorial https://uniapp.dcloud.net.cn/uni-app-x/api/getapp.html#getapp
937
+ */
938
+ type GetApp = <T extends AnyObject>() => AppInstance<T> & T;
985
939
 
986
940
  declare const getApp: GetApp;
@@ -9,12 +9,12 @@ declare class CSSStyleDeclaration {
9
9
  * @param name CSS样式名称
10
10
  * @param value 要设置的新CSS样式值
11
11
  */
12
- setProperty(name: string, value: any|null): void
12
+ setProperty(name: string|HBuilderX.cssPropertyString, value: any|null): void
13
13
 
14
14
  /**
15
15
  * 获取CSS指定的样式值,如果指定的样式不存在则返回null。
16
16
  * @param property 要获取的CSS样式名称
17
17
  */
18
- getPropertyValue(property: string): any|null
18
+ getPropertyValue(property: string|HBuilderX.cssPropertyString): any|null
19
19
 
20
20
  }
@@ -2,7 +2,6 @@
2
2
 
3
3
  /**
4
4
  * @package io.dcloud.uniapp.runtime
5
- * @autodoc false
6
5
  */
7
6
  declare class CustomEventOptions<T>{
8
7
  detail: T
@@ -11,7 +10,6 @@ declare class CustomEventOptions<T>{
11
10
 
12
11
  /**
13
12
  * @package io.dcloud.uniapp.runtime
14
- * @autodoc false
15
13
  */
16
14
  declare class CustomEvent<T> extends Event {
17
15
  get detail(): T
@@ -6,10 +6,10 @@ declare class DOMRect {
6
6
 
7
7
  /**
8
8
  * 创建一个新的 DOMRect 对象
9
- * @param x 矩形原点的x坐标
10
- * @param y 矩形原点的y坐标
11
- * @param width 矩形的宽
12
- * @param height 矩形的高
9
+ * @param {number} [x=0] 矩形原点的x坐标
10
+ * @param {number} [y=0] 矩形原点的y坐标
11
+ * @param {number} [width=0] 矩形的宽
12
+ * @param {number} [height=0] 矩形的高
13
13
  */
14
14
  constructor(x?: number, y?: number, width?: number, height?: number);
15
15
 
@@ -0,0 +1,48 @@
1
+ /// <reference path="./Element.d.ts" />
2
+
3
+ /**
4
+ * @package io.dcloud.uniapp.runtime
5
+ */
6
+ declare class DomNode implements Element {
7
+ firstChild: Element | null
8
+ lastChild: Element | null
9
+ parentNode: Element | null
10
+ parentElement: Element | null
11
+ previousSibling: Element | null
12
+ nextSibling: Element | null
13
+ nextElementSibling: Element | null
14
+ children: Element[]
15
+ tagName: string
16
+ nodeName: string
17
+ ext: Map<string, any>
18
+ dataset: Map<string, any | null>
19
+ attributes: Map<string, any | null>
20
+ style: CSSStyleDeclaration
21
+ scrollWidth: number
22
+ scrollHeight: number
23
+ scrollLeft: number
24
+ scrollTop: number
25
+ offsetLeft: number
26
+ offsetTop: number
27
+ offsetWidth: number
28
+ offsetHeight: number
29
+ getNodeId(): string
30
+ appendChild(aChild: Element): void
31
+ insertBefore(newChild: Element, refChild: Element): void
32
+ setAttribute(key: string, value: any | null): void
33
+ getAttribute(key: string): any | null
34
+ hasAttribute(key: string): boolean
35
+ removeAttribute(key: string): void
36
+ updateStyle(map: Map<string, any>): void
37
+ getBoundingClientRect(): DOMRect
38
+ getDrawableContext(): DrawableContext | null
39
+ addEventListener<T extends Event, R>(type: string, callback: (event: T) => R): void
40
+ removeEventListener(type: string): void
41
+ removeChild(aChild: Element): Element
42
+ remove(): void
43
+ dispatchEvent(type: string, value: Event): void
44
+ scrollTo(x: number, y: number): void
45
+ scrollBy(x: number, y: number): void
46
+ focus(): void
47
+ blur(): void
48
+ }
@@ -1,20 +1,21 @@
1
- /// <reference path='./INode.d.ts' />
2
-
3
1
  /**
4
2
  * @package io.dcloud.uniapp.runtime
5
3
  */
6
4
 
7
5
  declare class DrawableContext {
8
6
  /**
9
- * 设置字体大小,默认为`10px`
7
+ * 设置字体大小
8
+ * @defaultValue 10px
10
9
  */
11
10
  font : string
12
11
  /**
13
- * 设置填充颜色,默认为`#000 (黑色)`
12
+ * 设置填充颜色
13
+ * @defaultValue #000 (黑色)
14
14
  */
15
15
  fillStyle : string
16
16
  /**
17
- * 指定如何绘制每一条线条末端的属性,默认为`butt`
17
+ * 指定如何绘制每一条线条末端的属性,可选值:`butt`线段末端以方形结束;`round`线段末端以圆形结束;`square`线段末端以方形结束,但是会增加一个一半宽度的矩形区域。
18
+ * @defaultValue butt
18
19
  */
19
20
  lineCap : string
20
21
  /**
@@ -22,19 +23,23 @@ declare class DrawableContext {
22
23
  */
23
24
  lineDashOffset : number
24
25
  /**
25
- * 设置 2 个长度不为 0 的线条相连部分如何连接在一起的属性,默认值`miter`
26
+ * 设置 2 个长度不为 0 的线条相连部分如何连接在一起的属性,可选值:`bevel`斜角;`round`圆角;`miter`尖角。
27
+ * @defaultValue miter
26
28
  */
27
29
  lineJoin : string
28
30
  /**
29
- * 设置线条的宽度,默认为`1px`
31
+ * 设置线条的宽度
32
+ * @defaultValue 1px
30
33
  */
31
34
  lineWidth : number
32
35
  /**
33
- * 设置边框的颜色,默认为`#000 (黑色)`
36
+ * 设置边框的颜色
37
+ * @defaultValue #000 (黑色)
34
38
  */
35
39
  strokeStyle : string
36
40
  /**
37
- * 设置文本的对齐方式,默认为`left`
41
+ * 设置文本的对齐方式,可取值:`left`左对齐;`center`居中对齐;`right`右对齐。
42
+ * @defaultValue left
38
43
  */
39
44
  textAlign : string
40
45
  /**
@@ -49,9 +54,9 @@ declare class DrawableContext {
49
54
  * @param {number} radius 圆弧的半径
50
55
  * @param {number} startAngle 圆弧的起始点,x 轴方向开始计算,单位为弧度
51
56
  * @param {number} endAngle 圆弧的终点,单位为弧度
52
- * @param {number} anticlockwise 圆弧绘制方向,true:逆时针绘制,false:顺时针绘制。默认为true。可选
57
+ * @param {number} [anticlockwise=true] 圆弧绘制方向,true:逆时针绘制,false:顺时针绘制。
53
58
  */
54
- arc(x : number, y : number, radius : number, startAngle : number, endAngle : number, anticlockwise ?: boolean) : void
59
+ arc(x : number, y : number, radius : number, startAngle : number, endAngle : number, anticlockwise ?: boolean | null) : void
55
60
 
56
61
  /**
57
62
  * 将一个新的路径的起始点移动到 (x,y) 坐标
@@ -59,7 +64,7 @@ declare class DrawableContext {
59
64
  * @param {number} y 点的Y轴坐标
60
65
  */
61
66
  moveTo(x : number, y : number) : void
62
-
67
+
63
68
  /**
64
69
  * 创建一个矩形路径
65
70
  * @param {number} x 矩形起点的X轴坐标
@@ -101,10 +106,10 @@ declare class DrawableContext {
101
106
 
102
107
  /**
103
108
  * 填充当前或已存在的路径
104
- * @param {string} fillRule 填充规则,默认为`nonzero`。可选
109
+ * @param {string} [fillRule=nonzero] 填充规则。可取值:`nonzero`非零环绕规则;`evenodd`奇偶环绕规则。
105
110
  */
106
- fill(fillRule ?: string) : void
107
-
111
+ fill(fillRule ?: string | null) : void
112
+
108
113
  /**
109
114
  * 绘制一个实心矩形
110
115
  * @param {number} x 矩形起点的X轴坐标
@@ -113,7 +118,7 @@ declare class DrawableContext {
113
118
  * @param {number} height 矩形高度
114
119
  */
115
120
  fillRect(x : number, y : number, width : number, height : number) : void
116
-
121
+
117
122
  /**
118
123
  * 绘制实心字符
119
124
  * @param {string} text 要绘制的字符
@@ -134,4 +139,25 @@ declare class DrawableContext {
134
139
  * @param {Array<number>} segments 一组描述交替绘制线段和间距长度的数字。
135
140
  */
136
141
  setLineDash(segments : Array<number>) : void
142
+
143
+ /**
144
+ * 根据控制点和半径绘制圆弧路径
145
+ * @param {number} x1 第一个控制点的 x 轴坐标
146
+ * @param {number} y1 第一个控制点的 y 轴坐标
147
+ * @param {number} x2 第二个控制点的 x 轴坐标
148
+ * @param {number} y2 第二个控制点的 y 轴坐标
149
+ * @param {number} radius 圆弧的半径
150
+ */
151
+ // arcTo(x1 : number, y1 : number, x2 : number, y2 : number, radius : number) : void
152
+
153
+ /**
154
+ * 创建三次方贝塞尔曲线路径
155
+ * @param {number} cp1x 第一个贝塞尔控制点的 x 坐标
156
+ * @param {number} cp1y 第一个贝塞尔控制点的 y 坐标
157
+ * @param {number} cp2x 第二个贝塞尔控制点的 x 坐标
158
+ * @param {number} cp2y 第二个贝塞尔控制点的 y 坐标
159
+ * @param {number} x 结束点的 x 坐标
160
+ * @param {number} y 结束点的 y 坐标
161
+ */
162
+ bezierCurveTo(cp1x : number, cp1y : number, cp2x : number, cp2y : number, x : number, y : number) : void
137
163
  }