@dcloudio/uni-app-x 0.5.5 → 0.5.7
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/package.json +1 -1
- package/types/app.d.ts +17 -8
- package/types/native/AsyncApiResult.d.ts +1 -1
- package/types/native/CSSStyleDeclaration.d.ts +2 -2
- package/types/native/DrawableContext.d.ts +2 -2
- package/types/native/Element.d.ts +58 -27
- package/types/native/IDocument.d.ts +2 -3
- package/types/native/IPage.d.ts +1 -1
- package/types/native/IUniError.d.ts +1 -1
- package/types/native/NodeData.d.ts +1 -1
- package/types/native/SnapshotOptions.d.ts +63 -0
- package/types/native/UTSAndroidHookProxy.d.ts +14 -0
- package/types/native/UniAppManager.d.ts +1 -1
- package/types/native/UniElement.d.ts +140 -0
- package/types/native/UniTabsElement.d.ts +89 -0
- package/types/native/UniTextElement.d.ts +22 -0
- package/types/native/UniVideoElement.d.ts +70 -0
- package/types/native/{IWebViewNode.d.ts → UniWebViewElement.d.ts} +5 -2
- package/types/native/WebViewDownloadEvent.d.ts +37 -0
- package/types/native/WebViewErrorEvent.d.ts +26 -7
- package/types/native/WebViewLoadedEvent.d.ts +15 -2
- package/types/native/WebViewLoadingEvent.d.ts +15 -2
- package/types/native/WebViewMessageEvent.d.ts +15 -7
- package/types/native/WebViewStyles.d.ts +20 -0
- package/types/native/index.d.ts +9 -3
- package/types/shims-vue.d.ts +4 -2
- package/types/uni/core/index.d.ts +1 -0
- package/types/uni/core/lib/base/event/interface.d.ts +3 -6
- package/types/uni/core/lib/base/interceptor/index.d.ts +11 -0
- package/types/uni/core/lib/base/interceptor/interface.d.ts +15 -0
- package/types/uni/core/lib/interface.d.ts +8 -0
- package/types/uni/core/lib/ui/get-element-by-id/interface.d.ts +3 -2
- package/types/uni/core/lib/ui/pull-down-refresh/index.d.ts +4 -0
- package/types/uni/core/lib/ui/pull-down-refresh/interface.d.ts +10 -1
- package/types/uni/core/lib/ui/tab-bar/interface.d.ts +4 -8
- package/types/uni/uts-plugin-api/index.d.ts +1 -2
- package/types/uni/uts-plugin-api/lib/uni-getAccessibilityInfo/utssdk/interface.d.ts +2 -2
- package/types/uni/uts-plugin-api/lib/uni-getAppAuthorizeSetting/utssdk/interface.d.ts +86 -86
- package/types/uni/uts-plugin-api/lib/uni-getAppBaseInfo/utssdk/interface.d.ts +103 -103
- package/types/uni/uts-plugin-api/lib/uni-getDeviceInfo/utssdk/interface.d.ts +52 -52
- package/types/uni/uts-plugin-api/lib/uni-getNetworkType/utssdk/interface.d.ts +4 -4
- package/types/uni/uts-plugin-api/lib/uni-getSystemInfo/utssdk/interface.d.ts +82 -82
- package/types/uni/uts-plugin-api/lib/uni-getSystemSetting/utssdk/interface.d.ts +2 -2
- package/types/uni/uts-plugin-api/lib/uni-media/utssdk/interface.d.ts +10 -10
- package/types/uni/uts-plugin-api/lib/uni-network/utssdk/app-ios/interface.d.ts +59 -56
- package/types/uni/uts-plugin-api/lib/uni-network/utssdk/interface.d.ts +116 -97
- package/types/uni/uts-plugin-api/lib/uni-openAppAuthorizeSetting/utssdk/interface.d.ts +4 -4
- package/types/uni/uts-plugin-api/lib/uni-push/utssdk/index.d.ts +55 -0
- package/types/uni/uts-plugin-api/lib/uni-push/utssdk/interface.d.ts +338 -0
- package/types/uni/uts-plugin-api/lib/uni-websocket/utssdk/interface.d.ts +39 -39
- package/types/uni-cloud/interface.d.ts +10 -10
- package/types/vue/CheckboxGroupChangeEvent.d.ts +13 -0
- package/types/vue/PickerViewChangeEvent.d.ts +13 -0
- package/types/vue/ProgressActiveendEvent.d.ts +7 -0
- package/types/vue/RadioGroupChangeEvent.d.ts +13 -0
- package/types/vue/SliderChangeEvent.d.ts +2 -2
- package/types/vue/SwitchChangeEvent.d.ts +7 -0
- package/types/vue/UniButtonElement.d.ts +7 -0
- package/types/vue/UniCloudDBElement.d.ts +213 -0
- package/types/vue/UniNavigatorElement.d.ts +7 -0
- package/types/vue/index.d.ts +3 -0
- package/types/native/DomNode.d.ts +0 -48
- package/types/native/ITabsNode.d.ts +0 -36
- package/types/uni/uts-plugin-api/lib/uni-audio/utssdk/index.d.ts +0 -17
- package/types/uni/uts-plugin-api/lib/uni-audio/utssdk/interface.d.ts +0 -804
- package/types/uni/uts-plugin-api/lib/uni-getRecorderManager/utssdk/index.d.ts +0 -15
- package/types/uni/uts-plugin-api/lib/uni-getRecorderManager/utssdk/interface.d.ts +0 -213
package/package.json
CHANGED
package/types/app.d.ts
CHANGED
|
@@ -137,6 +137,7 @@ interface AppInstance<T extends AnyObject = {}> {
|
|
|
137
137
|
/**
|
|
138
138
|
* 全局对象
|
|
139
139
|
* 文档:[https://uniapp.dcloud.io/collocation/App?id=globaldata](https://uniapp.dcloud.io/collocation/App?id=globaldata)
|
|
140
|
+
* @autodoc false
|
|
140
141
|
* @uniPlatform {
|
|
141
142
|
* "app": {
|
|
142
143
|
* "android": {
|
|
@@ -205,6 +206,7 @@ interface AppInstance<T extends AnyObject = {}> {
|
|
|
205
206
|
* 应用初始化完成时触发,全局只触发一次。
|
|
206
207
|
*
|
|
207
208
|
* @tutorial [https://uniapp.dcloud.io/collocation/frame/lifecycle](https://uniapp.dcloud.io/collocation/frame/lifecycle)
|
|
209
|
+
* @autodoc false
|
|
208
210
|
* @uniPlatform {
|
|
209
211
|
* "app": {
|
|
210
212
|
* "android": {
|
|
@@ -266,13 +268,14 @@ interface AppInstance<T extends AnyObject = {}> {
|
|
|
266
268
|
* }
|
|
267
269
|
*}
|
|
268
270
|
*/
|
|
269
|
-
onLaunch?(options
|
|
271
|
+
onLaunch?(options: OnLaunchOptions): void;
|
|
270
272
|
/**
|
|
271
273
|
* 生命周期回调 监听应用显示
|
|
272
274
|
*
|
|
273
275
|
* 应用启动,或从后台进入前台显示时触发
|
|
274
276
|
*
|
|
275
277
|
* @tutorial [https://uniapp.dcloud.io/collocation/frame/lifecycle](https://uniapp.dcloud.io/collocation/frame/lifecycle)
|
|
278
|
+
* @autodoc false
|
|
276
279
|
* @uniPlatform {
|
|
277
280
|
* "app": {
|
|
278
281
|
* "android": {
|
|
@@ -334,13 +337,14 @@ interface AppInstance<T extends AnyObject = {}> {
|
|
|
334
337
|
* }
|
|
335
338
|
*}
|
|
336
339
|
*/
|
|
337
|
-
onShow?(options
|
|
340
|
+
onShow?(options: OnShowOptions): void;
|
|
338
341
|
/**
|
|
339
342
|
* 生命周期回调 监听应用隐藏
|
|
340
343
|
*
|
|
341
344
|
* 应用从前台进入后台时触发
|
|
342
345
|
*
|
|
343
346
|
* @tutorial [https://uniapp.dcloud.io/collocation/frame/lifecycle](https://uniapp.dcloud.io/collocation/frame/lifecycle)
|
|
347
|
+
* @autodoc false
|
|
344
348
|
* @uniPlatform {
|
|
345
349
|
* "app": {
|
|
346
350
|
* "android": {
|
|
@@ -409,6 +413,7 @@ interface AppInstance<T extends AnyObject = {}> {
|
|
|
409
413
|
* @param error 错误信息,包含堆栈
|
|
410
414
|
*
|
|
411
415
|
* @tutorial [https://uniapp.dcloud.io/collocation/frame/lifecycle](https://uniapp.dcloud.io/collocation/frame/lifecycle)
|
|
416
|
+
* @autodoc false
|
|
412
417
|
* @uniPlatform {
|
|
413
418
|
* "app": {
|
|
414
419
|
* "android": {
|
|
@@ -481,6 +486,7 @@ interface AppInstance<T extends AnyObject = {}> {
|
|
|
481
486
|
* 2. 如果 `onPageNotFound` 回调中又重定向到另一个不存在的页面,将推入微信客户端原生的页面不存在提示页面,并且不再回调 `onPageNotFound`。
|
|
482
487
|
*
|
|
483
488
|
* @tutorial [https://uniapp.dcloud.io/collocation/frame/lifecycle](https://uniapp.dcloud.io/collocation/frame/lifecycle)
|
|
489
|
+
* @autodoc false
|
|
484
490
|
* @uniPlatform {
|
|
485
491
|
* "app": {
|
|
486
492
|
* "android": {
|
|
@@ -617,9 +623,9 @@ interface AppInstance<T extends AnyObject = {}> {
|
|
|
617
623
|
* }
|
|
618
624
|
*}
|
|
619
625
|
*/
|
|
620
|
-
|
|
626
|
+
|
|
621
627
|
// onUnhandledRejection?(options: UniNamespace.OnUnhandledRejectionCallbackResult): void;
|
|
622
|
-
|
|
628
|
+
|
|
623
629
|
/**
|
|
624
630
|
* 监听系统主题变化
|
|
625
631
|
*
|
|
@@ -696,13 +702,14 @@ interface AppInstance<T extends AnyObject = {}> {
|
|
|
696
702
|
*/
|
|
697
703
|
|
|
698
704
|
// onThemeChange?(options: UniNamespace.OnThemeChangeCallbackResult): void;
|
|
699
|
-
|
|
705
|
+
|
|
700
706
|
/**
|
|
701
707
|
* 监听 nvue 页面消息
|
|
702
708
|
*
|
|
703
709
|
* nvue 页面使用 `uni.postMessage` 发送消息时触发
|
|
704
710
|
*
|
|
705
711
|
* @tutorial [https://uniapp.dcloud.io/collocation/frame/lifecycle](https://uniapp.dcloud.io/collocation/frame/lifecycle)
|
|
712
|
+
* @autodoc false
|
|
706
713
|
* @uniPlatform {
|
|
707
714
|
* "app": {
|
|
708
715
|
* "android": {
|
|
@@ -778,6 +785,7 @@ interface AppInstance<T extends AnyObject = {}> {
|
|
|
778
785
|
* 监听应用退出。app-uvue-android 3.9+
|
|
779
786
|
*
|
|
780
787
|
* @tutorial [https://uniapp.dcloud.io/collocation/frame/lifecycle](https://uniapp.dcloud.io/collocation/frame/lifecycle)
|
|
788
|
+
* @autodoc false
|
|
781
789
|
* @uniPlatform {
|
|
782
790
|
* "app": {
|
|
783
791
|
* "android": {
|
|
@@ -853,6 +861,7 @@ interface AppInstance<T extends AnyObject = {}> {
|
|
|
853
861
|
* 最后一个页面按下Android back键,常用于自定义退出。app-uvue-android 3.9+
|
|
854
862
|
*
|
|
855
863
|
* @tutorial [https://uniapp.dcloud.io/collocation/frame/lifecycle](https://uniapp.dcloud.io/collocation/frame/lifecycle)
|
|
864
|
+
* @autodoc false
|
|
856
865
|
* @uniPlatform {
|
|
857
866
|
* "app": {
|
|
858
867
|
* "android": {
|
|
@@ -932,9 +941,9 @@ type AppConstructor = <T extends AnyObject & AppInstance>(
|
|
|
932
941
|
|
|
933
942
|
|
|
934
943
|
/**
|
|
935
|
-
* `getApp()`
|
|
936
|
-
* @tutorial https://uniapp.dcloud.net.cn/
|
|
944
|
+
* `getApp()` 函数用于获取当前应用实例,可通过应用实例调用 App.uvue methods 中定义的方法。
|
|
945
|
+
* @tutorial https://uniapp.dcloud.net.cn/tutorial/page.html#getapp
|
|
937
946
|
*/
|
|
938
|
-
type GetApp =
|
|
947
|
+
type GetApp = () => AppInstance;
|
|
939
948
|
|
|
940
949
|
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|
|
|
12
|
+
setProperty(name: string|string.cssPropertyString, value: any|null): void
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* 获取CSS指定的样式值,如果指定的样式不存在则返回null。
|
|
16
16
|
* @param property 要获取的CSS样式名称
|
|
17
17
|
*/
|
|
18
|
-
getPropertyValue(property: string|
|
|
18
|
+
getPropertyValue(property: string|string.cssPropertyString): any|null
|
|
19
19
|
|
|
20
20
|
}
|
|
@@ -12,7 +12,7 @@ declare class DrawableContext {
|
|
|
12
12
|
* 设置填充颜色
|
|
13
13
|
* @defaultValue #000 (黑色)
|
|
14
14
|
*/
|
|
15
|
-
fillStyle : string
|
|
15
|
+
fillStyle : string.ColorString
|
|
16
16
|
/**
|
|
17
17
|
* 指定如何绘制每一条线条末端的属性,可选值:`butt`线段末端以方形结束;`round`线段末端以圆形结束;`square`线段末端以方形结束,但是会增加一个一半宽度的矩形区域。
|
|
18
18
|
* @defaultValue butt
|
|
@@ -36,7 +36,7 @@ declare class DrawableContext {
|
|
|
36
36
|
* 设置边框的颜色
|
|
37
37
|
* @defaultValue #000 (黑色)
|
|
38
38
|
*/
|
|
39
|
-
strokeStyle : string
|
|
39
|
+
strokeStyle : string.ColorString
|
|
40
40
|
/**
|
|
41
41
|
* 设置文本的对齐方式,可取值:`left`左对齐;`center`居中对齐;`right`右对齐。
|
|
42
42
|
* @defaultValue left
|
|
@@ -1,120 +1,127 @@
|
|
|
1
1
|
/// <reference path="./Event.d.ts" />
|
|
2
|
+
/// <reference path='./SnapshotOptions.d.ts' />
|
|
2
3
|
|
|
3
4
|
/**
|
|
5
|
+
* UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。
|
|
4
6
|
* @package io.dcloud.uniapp.runtime
|
|
5
7
|
*/
|
|
6
|
-
interface Element {
|
|
8
|
+
declare interface Element {
|
|
7
9
|
/**
|
|
8
|
-
* 获取当前元素的的第一个子元素,如果元素是无子元素,则返回 null。
|
|
10
|
+
* 只读属性 获取当前元素的的第一个子元素,如果元素是无子元素,则返回 null。
|
|
9
11
|
*/
|
|
10
12
|
firstChild: Element | null
|
|
11
13
|
|
|
12
14
|
/**
|
|
13
|
-
* 获取当前元素的最后一个子元素,如果没有子元素,则返回 null。
|
|
15
|
+
* 只读属性 获取当前元素的最后一个子元素,如果没有子元素,则返回 null。
|
|
14
16
|
*/
|
|
15
17
|
lastChild: Element | null
|
|
16
18
|
|
|
17
19
|
/**
|
|
18
|
-
* 获取当前元素在 DOM 树中的父元素,如果没有父元素(如未添加到DOM树中),则返回null。
|
|
20
|
+
* 只读属性 获取当前元素在 DOM 树中的父元素,如果没有父元素(如未添加到DOM树中),则返回null。
|
|
19
21
|
* @autodoc false
|
|
20
22
|
*/
|
|
21
23
|
parentNode: Element | null
|
|
22
24
|
|
|
23
25
|
/**
|
|
24
|
-
* 获取当前元素在 DOM 树中的父元素,如果没有父元素(如未添加到DOM树中),则返回null。
|
|
26
|
+
* 只读属性 获取当前元素在 DOM 树中的父元素,如果没有父元素(如未添加到DOM树中),则返回null。
|
|
25
27
|
*/
|
|
26
28
|
parentElement: Element | null
|
|
27
29
|
|
|
28
30
|
/**
|
|
29
|
-
* 获取当前元素的前一个同级元素,没有则返回null。
|
|
31
|
+
* 只读属性 获取当前元素的前一个同级元素,没有则返回null。
|
|
30
32
|
*/
|
|
31
33
|
previousSibling: Element | null
|
|
32
34
|
|
|
33
35
|
/**
|
|
34
|
-
* 获取在 DOM 树中紧跟在其后面的同级元素,如果指定的元素为最后一个元素,则返回 null。
|
|
36
|
+
* 只读属性 获取在 DOM 树中紧跟在其后面的同级元素,如果指定的元素为最后一个元素,则返回 null。
|
|
37
|
+
* @autodoc false
|
|
35
38
|
*/
|
|
36
39
|
nextSibling: Element | null
|
|
37
40
|
|
|
38
41
|
/**
|
|
39
|
-
* 获取在 DOM 树中紧跟在其后面的同级元素,如果指定的元素为最后一个元素,则返回 null。
|
|
40
|
-
* @autodoc false
|
|
42
|
+
* 只读属性 获取在 DOM 树中紧跟在其后面的同级元素,如果指定的元素为最后一个元素,则返回 null。
|
|
41
43
|
*/
|
|
42
44
|
nextElementSibling: Element | null
|
|
43
45
|
|
|
44
46
|
/**
|
|
45
|
-
* 获取当前元素包含的子元素的集合
|
|
47
|
+
* 只读属性 获取当前元素包含的子元素的集合
|
|
46
48
|
*/
|
|
47
49
|
children: Element[]
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* 只读属性 获取当前节点包含的子节点的集合
|
|
53
|
+
* @autodoc false
|
|
54
|
+
*/
|
|
48
55
|
childNodes: Element[]
|
|
49
56
|
|
|
50
57
|
/**
|
|
51
|
-
* 获取当前元素的标签名
|
|
58
|
+
* 只读属性 获取当前元素的标签名
|
|
52
59
|
*/
|
|
53
60
|
tagName: string
|
|
54
61
|
|
|
55
62
|
/**
|
|
56
|
-
* 获取当前元素的元素名称
|
|
63
|
+
* 只读属性 获取当前元素的元素名称
|
|
57
64
|
* @autodoc false
|
|
58
65
|
*/
|
|
59
66
|
nodeName: string
|
|
60
67
|
|
|
61
68
|
/**
|
|
62
|
-
* 获取元素上自定义数据属性(data-*)的集合
|
|
69
|
+
* 只读属性 获取元素上自定义数据属性(data-*)的集合
|
|
63
70
|
*/
|
|
64
71
|
dataset: Map<string, any | null>
|
|
65
72
|
|
|
66
73
|
/**
|
|
67
|
-
* 获取元素上所有属性元素的集合
|
|
74
|
+
* 只读属性 获取元素上所有属性元素的集合
|
|
68
75
|
*/
|
|
69
76
|
attributes: Map<string, any | null>
|
|
70
77
|
|
|
71
78
|
/**
|
|
72
|
-
* 获取元素的CSS样式对象
|
|
79
|
+
* 只读属性 获取元素的CSS样式对象
|
|
73
80
|
*/
|
|
74
81
|
style: CSSStyleDeclaration
|
|
75
82
|
|
|
76
83
|
/**
|
|
77
|
-
* 获取可滚动元素内容的总宽度,仅scroll-view、list-view组件支持,其他组件返回视图宽度
|
|
84
|
+
* 只读属性 获取可滚动元素内容的总宽度,仅scroll-view、list-view组件支持,其他组件返回视图宽度
|
|
78
85
|
*/
|
|
79
86
|
scrollWidth: number
|
|
80
87
|
|
|
81
88
|
/**
|
|
82
|
-
* 获取可滚动元素内容的总高度,仅scroll-view、list-view组件支持,其他组件返回视图高度
|
|
89
|
+
* 只读属性 获取可滚动元素内容的总高度,仅scroll-view、list-view组件支持,其他组件返回视图高度
|
|
83
90
|
*/
|
|
84
91
|
scrollHeight: number
|
|
85
92
|
|
|
86
93
|
/**
|
|
87
|
-
*
|
|
94
|
+
* 获取或修改元素滚动条到元素左边的距离像素数,仅scroll-view、list-view组件支持。其他组件返回0
|
|
88
95
|
*/
|
|
89
96
|
scrollLeft: number
|
|
90
97
|
|
|
91
98
|
/**
|
|
92
|
-
*
|
|
99
|
+
* 获取或修改元素滚动条到元素顶部的距离像素数,仅scroll-view、list-view组件支持。其他组件返回0
|
|
93
100
|
*/
|
|
94
101
|
scrollTop: number
|
|
95
102
|
|
|
96
103
|
/**
|
|
97
|
-
* 元素的左边界偏移值 单位px
|
|
104
|
+
* 只读属性 元素的左边界偏移值 单位px
|
|
98
105
|
*/
|
|
99
106
|
offsetLeft: number
|
|
100
107
|
|
|
101
108
|
/**
|
|
102
|
-
* 元素的右边界偏移值 单位px
|
|
109
|
+
* 只读属性 元素的右边界偏移值 单位px
|
|
103
110
|
*/
|
|
104
111
|
offsetTop: number
|
|
105
112
|
|
|
106
113
|
/**
|
|
107
|
-
* 元素高度 单位px
|
|
114
|
+
* 只读属性 元素高度 单位px
|
|
108
115
|
*/
|
|
109
116
|
offsetWidth: number
|
|
110
117
|
|
|
111
118
|
/**
|
|
112
|
-
* 元素宽度 单位px
|
|
119
|
+
* 只读属性 元素宽度 单位px
|
|
113
120
|
*/
|
|
114
121
|
offsetHeight: number
|
|
115
122
|
|
|
116
123
|
/**
|
|
117
|
-
* 扩展属性
|
|
124
|
+
* 只读属性 扩展属性
|
|
118
125
|
*/
|
|
119
126
|
ext: Map<string, any>
|
|
120
127
|
|
|
@@ -124,6 +131,29 @@ interface Element {
|
|
|
124
131
|
*/
|
|
125
132
|
getNodeId(): string
|
|
126
133
|
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* 对当前组件进行截图,调用此方法会将当前组件(包含子节点)渲染结果导出成图片。
|
|
137
|
+
* 成功会返回图片对应的临时文件路径,目前默认png格式
|
|
138
|
+
*
|
|
139
|
+
* @param options 组件截图的参数对象
|
|
140
|
+
* @uniPlatform {
|
|
141
|
+
* "app": {
|
|
142
|
+
* "android": {
|
|
143
|
+
* "osVer": "5.0",
|
|
144
|
+
* "uniVer": "x",
|
|
145
|
+
* "unixVer": "3.93"
|
|
146
|
+
* },
|
|
147
|
+
* "ios": {
|
|
148
|
+
* "osVer": "x",
|
|
149
|
+
* "uniVer": "x",
|
|
150
|
+
* "unixVer": "x"
|
|
151
|
+
* }
|
|
152
|
+
* }
|
|
153
|
+
* }
|
|
154
|
+
*/
|
|
155
|
+
takeSnapshot(options: TakeSnapshotOptions):void
|
|
156
|
+
|
|
127
157
|
/**
|
|
128
158
|
* 将一个元素添加到指定父元素的子元素列表的末尾处。如果将被插入的元素已经存在于当前文档的文档树中,那么将会它从原先的位置移动到新的位置。
|
|
129
159
|
* @param {Element} aChild 插入子元素对象
|
|
@@ -140,15 +170,15 @@ interface Element {
|
|
|
140
170
|
/**
|
|
141
171
|
* 设置指定元素上的某个属性值。如果设置的属性已经存在,则更新该属性值;否则使用指定的名称和值添加一个新的属性。
|
|
142
172
|
* @param {string} key 属性名称
|
|
143
|
-
* @param {
|
|
173
|
+
* @param {string} value 属性值域
|
|
144
174
|
*/
|
|
145
|
-
setAttribute(key: string, value:
|
|
175
|
+
setAttribute(key: string, value: string): void
|
|
146
176
|
|
|
147
177
|
/**
|
|
148
178
|
* 获取元素指定的属性值,如果指定的属性不存在则返回null。
|
|
149
179
|
* @param {string} key 属性名称
|
|
150
180
|
*/
|
|
151
|
-
getAttribute(key: string):
|
|
181
|
+
getAttribute(key: string): string | null
|
|
152
182
|
|
|
153
183
|
/**
|
|
154
184
|
* 返回改元素是否包含有指定的属性,属性存在则返回true,否则返回false。
|
|
@@ -236,3 +266,4 @@ interface Element {
|
|
|
236
266
|
}
|
|
237
267
|
|
|
238
268
|
type INode = Element
|
|
269
|
+
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
/// <reference path='./Element.d.ts' />
|
|
2
|
-
/// <reference path='./ITabsNode.d.ts' />
|
|
3
2
|
/// <reference path='./NodeData.d.ts' />
|
|
4
3
|
|
|
5
4
|
/**
|
|
6
5
|
* @package io.dcloud.uniapp.runtime
|
|
7
6
|
* @autodoc false
|
|
8
7
|
*/
|
|
9
|
-
interface IDocument extends Element {
|
|
8
|
+
declare interface IDocument extends Element {
|
|
10
9
|
body: Element
|
|
11
10
|
|
|
12
|
-
getRealDomNodeById<T>(tag: string):
|
|
11
|
+
getRealDomNodeById<T>(tag: string): T | null
|
|
13
12
|
|
|
14
13
|
startRender(): unknown
|
|
15
14
|
|
package/types/native/IPage.d.ts
CHANGED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 组件截图成功的返回数据
|
|
3
|
+
*/
|
|
4
|
+
declare type TakeSnapshotSuccess = {
|
|
5
|
+
/**
|
|
6
|
+
* 截图保存的临时文件路径
|
|
7
|
+
*/
|
|
8
|
+
tempFilePath: string
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* 组件截图失败的返回数据
|
|
13
|
+
*/
|
|
14
|
+
declare type TakeSnapshotFail = {
|
|
15
|
+
errMsg: string
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* 成功回调函数定义
|
|
21
|
+
*/
|
|
22
|
+
declare type TakeSnapshotSuccessCallback = (res: TakeSnapshotSuccess) => void
|
|
23
|
+
/**
|
|
24
|
+
* 失败回调函数定义
|
|
25
|
+
*/
|
|
26
|
+
declare type TakeSnapshotFailCallback = (res: TakeSnapshotFail) => void
|
|
27
|
+
/**
|
|
28
|
+
* 完成回调函数定义
|
|
29
|
+
*/
|
|
30
|
+
declare type TakeSnapshotCompleteCallback = (res: any) => void
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* 组件截图的参数配置选项
|
|
34
|
+
*/
|
|
35
|
+
declare class TakeSnapshotOptions{
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* 截图导出类型,目前仅支持 'file' 保存到临时文件目录
|
|
39
|
+
* @default "file"
|
|
40
|
+
*/
|
|
41
|
+
type : string
|
|
42
|
+
/**
|
|
43
|
+
* 截图文件格式,目前仅支持 'png'
|
|
44
|
+
* @default "png"
|
|
45
|
+
*/
|
|
46
|
+
format : string
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* 接口调用成功的回调函数
|
|
50
|
+
*/
|
|
51
|
+
success?: TakeSnapshotSuccessCallback | null
|
|
52
|
+
/**
|
|
53
|
+
* 接口调用失败的回调函数
|
|
54
|
+
*/
|
|
55
|
+
fail?: TakeSnapshotFailCallback | null
|
|
56
|
+
/**
|
|
57
|
+
* 接口调用结束的回调函数(调用成功、失败都会执行)
|
|
58
|
+
*/
|
|
59
|
+
complete?: TakeSnapshotCompleteCallback | null
|
|
60
|
+
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* 安卓原应用初始化回调代理
|
|
4
|
+
* 注意:不支持调用uni api 仅适用于原生SDK初始化等
|
|
5
|
+
* @package io.dcloud.uts
|
|
6
|
+
* @autodoc false
|
|
7
|
+
*/
|
|
8
|
+
declare interface UTSAndroidHookProxy {
|
|
9
|
+
/**
|
|
10
|
+
* 安卓原生应用初始化时会调用此接口 可在此处进行相关资源数据初始化 和 模块注册逻辑
|
|
11
|
+
* @param application 安卓原生上下文
|
|
12
|
+
*/
|
|
13
|
+
onCreate(application: Application): void
|
|
14
|
+
}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/// <reference path='./Element.d.ts' />
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* view元素对象
|
|
5
|
+
* @package io.dcloud.uniapp.runtime
|
|
6
|
+
* @autodoc false
|
|
7
|
+
*/
|
|
8
|
+
declare class UniElement implements Element {
|
|
9
|
+
firstChild: Element;
|
|
10
|
+
lastChild: Element;
|
|
11
|
+
parentNode: Element;
|
|
12
|
+
parentElement: Element;
|
|
13
|
+
previousSibling: Element;
|
|
14
|
+
nextSibling: Element;
|
|
15
|
+
nextElementSibling: Element;
|
|
16
|
+
children: Element[];
|
|
17
|
+
childNodes: Element[];
|
|
18
|
+
tagName: string;
|
|
19
|
+
nodeName: string;
|
|
20
|
+
dataset: Map<string, any>;
|
|
21
|
+
attributes: Map<string, any>;
|
|
22
|
+
style: CSSStyleDeclaration;
|
|
23
|
+
scrollWidth: number;
|
|
24
|
+
scrollHeight: number;
|
|
25
|
+
scrollLeft: number;
|
|
26
|
+
scrollTop: number;
|
|
27
|
+
offsetLeft: number;
|
|
28
|
+
offsetTop: number;
|
|
29
|
+
offsetWidth: number;
|
|
30
|
+
offsetHeight: number;
|
|
31
|
+
ext: Map<string, any>;
|
|
32
|
+
getNodeId(): string;
|
|
33
|
+
takeSnapshot(options: TakeSnapshotOptions): void;
|
|
34
|
+
appendChild(aChild: Element): void;
|
|
35
|
+
insertBefore(newChild: Element, refChild?: Element): void;
|
|
36
|
+
setAttribute(key: string, value: string): void;
|
|
37
|
+
getAttribute(key: string): string;
|
|
38
|
+
hasAttribute(key: string): boolean;
|
|
39
|
+
removeAttribute(key: string): void;
|
|
40
|
+
updateStyle(map: Map<string, any>): void;
|
|
41
|
+
getBoundingClientRect(): DOMRect;
|
|
42
|
+
getDrawableContext(): DrawableContext;
|
|
43
|
+
addEventListener<T extends Event, R>(type: string, callback: (event: T) => R): void;
|
|
44
|
+
removeEventListener<T extends Event, R>(type: string, callback?: (event: T) => R): void;
|
|
45
|
+
removeChild(aChild: Element): Element;
|
|
46
|
+
remove(): void;
|
|
47
|
+
dispatchEvent(type: string, value: Event): void;
|
|
48
|
+
scrollTo(x: number, y: number): void;
|
|
49
|
+
scrollBy(x: number, y: number): void;
|
|
50
|
+
focus(): void;
|
|
51
|
+
blur(): void;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* view元素对象
|
|
56
|
+
* @package io.dcloud.uniapp.runtime
|
|
57
|
+
* @autodoc false
|
|
58
|
+
*/
|
|
59
|
+
declare interface UniViewElement extends UniElement {
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* scroll-view元素对象
|
|
64
|
+
* @package io.dcloud.uniapp.runtime
|
|
65
|
+
* @autodoc false
|
|
66
|
+
*/
|
|
67
|
+
declare interface UniScrollViewElement extends UniElement {
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* list-view元素对象
|
|
72
|
+
* @package io.dcloud.uniapp.runtime
|
|
73
|
+
* @autodoc false
|
|
74
|
+
*/
|
|
75
|
+
declare interface UniListViewElement extends UniScrollViewElement {
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* list-item元素对象
|
|
80
|
+
* @package io.dcloud.uniapp.runtime
|
|
81
|
+
* @autodoc false
|
|
82
|
+
*/
|
|
83
|
+
declare interface UniListItemElement extends UniElement {
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* swiper元素对象
|
|
88
|
+
* @package io.dcloud.uniapp.runtime
|
|
89
|
+
* @autodoc false
|
|
90
|
+
*/
|
|
91
|
+
declare interface UniSwiperElement extends UniElement {
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* swiper-item元素对象
|
|
96
|
+
* @package io.dcloud.uniapp.runtime
|
|
97
|
+
* @autodoc false
|
|
98
|
+
*/
|
|
99
|
+
declare interface UniSwiperItemElement extends UniElement {
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* image元素对象
|
|
104
|
+
* @package io.dcloud.uniapp.runtime
|
|
105
|
+
* @autodoc false
|
|
106
|
+
*/
|
|
107
|
+
declare interface UniImageElement extends UniElement {
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* input元素对象
|
|
112
|
+
* @package io.dcloud.uniapp.runtime
|
|
113
|
+
* @autodoc false
|
|
114
|
+
*/
|
|
115
|
+
declare interface UniInputElement extends UniElement {
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* textarea元素对象
|
|
120
|
+
* @package io.dcloud.uniapp.runtime
|
|
121
|
+
* @autodoc false
|
|
122
|
+
*/
|
|
123
|
+
declare interface UniTextareaElement extends UniElement {
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* rich-text元素对象
|
|
128
|
+
* @package io.dcloud.uniapp.runtime
|
|
129
|
+
* @autodoc false
|
|
130
|
+
*/
|
|
131
|
+
declare interface UniRichTextElement extends UniElement {
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* sticky-header元素对象
|
|
136
|
+
* @package io.dcloud.uniapp.runtime
|
|
137
|
+
* @autodoc false
|
|
138
|
+
*/
|
|
139
|
+
declare interface UniStickyHeaderElement extends UniElement {
|
|
140
|
+
}
|