@dcloudio/uni-app-x 0.7.0 → 0.7.2

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 (27) hide show
  1. package/package.json +1 -1
  2. package/types/native/IUniElement.d.ts +1 -1
  3. package/types/native/InputBlurEvent.d.ts +4 -0
  4. package/types/native/NodeData.d.ts +3 -2
  5. package/types/native/PageNode.d.ts +6 -0
  6. package/types/native/{MouseEvent.d.ts → PointerEvent.ts} +2 -2
  7. package/types/native/TextareaFocusEvent.d.ts +14 -1
  8. package/types/native/UniDocument.d.ts +2 -0
  9. package/types/native/UniFormControl.d.ts +8 -0
  10. package/types/native/UniFormControlElement.d.ts +14 -0
  11. package/types/native/ViewToTempFilePathOptions.d.ts +9 -0
  12. package/types/native/global.d.ts +6 -3
  13. package/types/native/index.d.ts +3 -1
  14. package/types/page.d.ts +7 -7
  15. package/types/uni/core/lib/ui/create-selector-query/interface.d.ts +3 -3
  16. package/types/uni/core/lib/ui/page-scroll-to/interface.d.ts +5 -5
  17. package/types/uni/uts-plugin-api/lib/uni-createWebviewContext/utssdk/interface.d.ts +6 -6
  18. package/types/uni/uts-plugin-api/lib/uni-getAccessibilityInfo/utssdk/interface.d.ts +15 -14
  19. package/types/uni/uts-plugin-api/lib/uni-getAppAuthorizeSetting/utssdk/interface.d.ts +125 -117
  20. package/types/uni/uts-plugin-api/lib/uni-getAppBaseInfo/utssdk/interface.d.ts +200 -147
  21. package/types/uni/uts-plugin-api/lib/uni-getDeviceInfo/utssdk/interface.d.ts +29 -68
  22. package/types/uni/uts-plugin-api/lib/uni-getNetworkType/utssdk/interface.d.ts +15 -14
  23. package/types/uni/uts-plugin-api/lib/uni-getSystemInfo/utssdk/interface.d.ts +114 -119
  24. package/types/uni/uts-plugin-api/lib/uni-getSystemSetting/utssdk/interface.d.ts +16 -15
  25. package/types/uni/uts-plugin-api/lib/uni-network/utssdk/interface.d.ts +149 -140
  26. package/types/uni/uts-plugin-api/lib/uni-openAppAuthorizeSetting/utssdk/interface.d.ts +15 -14
  27. package/types/uni/uts-plugin-api/lib/uni-websocket/utssdk/interface.d.ts +195 -182
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dcloudio/uni-app-x",
3
- "version": "0.7.0",
3
+ "version": "0.7.2",
4
4
  "description": "uni-app x types",
5
5
  "typings": "index.d.ts",
6
6
  "author": "DCloud",
@@ -705,7 +705,7 @@ export interface UniTextElement extends UniElement {
705
705
  getTextExtra(): any | null
706
706
  }
707
707
 
708
- export type TextElement = UniTabsElement
708
+ export type TextElement = UniTextElement
709
709
 
710
710
  /**
711
711
  * web-view元素对象
@@ -9,5 +9,9 @@ export class InputBlurEvent extends Event {
9
9
  * 输入框内容
10
10
  */
11
11
  value: string,
12
+ /**
13
+ * 选择区域的起始位置
14
+ */
15
+ cursor: number
12
16
  }
13
17
  }
@@ -5,7 +5,7 @@
5
5
  export interface INodeData {
6
6
  id: string
7
7
  name: string
8
- attrs?: Map<string, any | null>
8
+ attrs: Map<string, any | null>
9
9
  style: Map<string, any | null>
10
10
  }
11
11
 
@@ -16,6 +16,7 @@ export interface INodeData {
16
16
  export class NodeData implements INodeData {
17
17
  id: string
18
18
  name: string
19
- attrs?: Map<string, any | null>
19
+ attrs: Map<string, any | null>
20
20
  style: Map<string, any | null>
21
+ constructor (id: string, name: string, attrs: Map<string, any | null>, style: Map<string, any | null>)
21
22
  }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * @package io.dcloud.uniapp.dom.node
3
+ */
4
+ export class PageNode {
5
+
6
+ }
@@ -3,7 +3,7 @@ import { Event } from './Event'
3
3
  /**
4
4
  * @package io.dcloud.uniapp.runtime
5
5
  */
6
- export class MouseEvent extends Event {
6
+ export class PointerEvent extends Event {
7
7
  /**
8
8
  * 相对于页面可显示区域左边的距离
9
9
  */
@@ -38,7 +38,7 @@ export class MouseEvent extends Event {
38
38
  screenY: number
39
39
 
40
40
  /**
41
- * 创建一个新的 MouseEvent 对象
41
+ * 创建一个新的 PointerEvent 对象
42
42
  * @param {string} type 事件类型
43
43
  * @param {number} x 相对于页面可显示区域左边的距离
44
44
  * @param {number} y 相对于页面可显示区域顶部的距离
@@ -7,6 +7,19 @@ export class TextareaFocusEvent extends Event {
7
7
  detail: {
8
8
  /**
9
9
  * 键盘高度
10
+ * @uniPlatform {
11
+ * "app": {
12
+ * "android": {
13
+ * "osVer": "5.0",
14
+ * "uniVer": "√",
15
+ * "unixVer": "√"
16
+ * }
17
+ * },
18
+ * "web": {
19
+ * "uniVer": "x",
20
+ * "unixVer": "x"
21
+ * }
22
+ * }
10
23
  */
11
24
  height: number,
12
25
  /**
@@ -14,4 +27,4 @@ export class TextareaFocusEvent extends Event {
14
27
  */
15
28
  value: string
16
29
  }
17
- }
30
+ }
@@ -28,6 +28,8 @@ export interface UniDocument extends UniElement {
28
28
  * 页面排版完毕回调callback
29
29
  */
30
30
  waitNativeRender(callback: () => void): void
31
+
32
+ getElementById(id: string): UniElement | null
31
33
  }
32
34
 
33
35
  export type IDocument = UniDocument
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @package io.dcloud.uniapp.runtime
3
+ */
4
+ export declare interface UniFormControl<T> {
5
+ reset(): void,
6
+ value: T,
7
+ name: string
8
+ }
@@ -0,0 +1,14 @@
1
+ import { PageNode } from "./PageNode";
2
+ import { UniElementImpl } from "./UniElement"
3
+ import { UniFormControl } from "./UniFormControl"
4
+
5
+ /**
6
+ * @package io.dcloud.uniapp.dom.node
7
+ */
8
+ export class UniFormControlElement<T> extends UniElementImpl implements UniFormControl<T> {
9
+ constructor (data: INodeData, pageNode: PageNode)
10
+ reset(): void;
11
+ get value(): T;
12
+ set value(value: T);
13
+ name: string
14
+ }
@@ -23,6 +23,15 @@ export class ViewToTempFilePathOptions {
23
23
  * 组件id
24
24
  */
25
25
  id: string | null
26
+ /**
27
+ * X轴偏移量,单位px
28
+ */
29
+ offsetX: string | null
30
+ /**
31
+ * Y轴偏移量,单位px
32
+ */
33
+ offsetY: string | null
34
+
26
35
  /**
27
36
  * 是否截取完整内容,包括屏幕外不可见的内容。传入id时会忽略此参数
28
37
  */
@@ -25,6 +25,7 @@ import {
25
25
  IPageManager as IPageManagerOrigin,
26
26
  UniPage as UniPageOrigin,
27
27
  IPage as IPageOrigin,
28
+ UniFormControlElement as UniFormControlElementOrigin,
28
29
  UniError as UniErrorOrigin,
29
30
  UniElementImpl as UniElementImplOrigin,
30
31
  UniViewElementImpl as UniViewElementImplOrigin,
@@ -60,13 +61,13 @@ import {
60
61
  ResizeEvent as ResizeEventOrigin,
61
62
  RefresherEvent as RefresherEventOrigin,
62
63
  PageScrollEvent as PageScrollEventOrigin,
64
+ PageNode as PageNodeOrigin,
63
65
  PageEvent as PageEventOrigin,
64
66
  NodeData as NodeDataOrigin,
65
67
  INodeData as INodeDataOrigin,
66
68
  NestedPreScrollEvent as NestedPreScrollEventOrigin,
67
69
  NativeLoadFontFaceFail as NativeLoadFontFaceFailOrigin,
68
70
  NativeLoadFontFaceOptions as NativeLoadFontFaceOptionsOrigin,
69
- MouseEvent as MouseEventOrigin,
70
71
  InputKeyboardHeightChangeEvent as InputKeyboardHeightChangeEventOrigin,
71
72
  InputFocusEvent as InputFocusEventOrigin,
72
73
  InputEvent as InputEventOrigin,
@@ -153,6 +154,8 @@ declare global {
153
154
  type IPageManager = IPageManagerOrigin
154
155
  type UniPage = UniPageOrigin
155
156
  type IPage = IPageOrigin
157
+ const UniFormControlElement: typeof UniFormControlElementOrigin
158
+ type UniFormControlElement<T> = UniFormControlElementOrigin<T>
156
159
  const UniError: typeof UniErrorOrigin
157
160
  type UniError = UniErrorOrigin
158
161
  const UniElementImpl: typeof UniElementImplOrigin
@@ -213,6 +216,8 @@ declare global {
213
216
  type RefresherEvent = RefresherEventOrigin
214
217
  const PageScrollEvent: typeof PageScrollEventOrigin
215
218
  type PageScrollEvent = PageScrollEventOrigin
219
+ const PageNode: typeof PageNodeOrigin
220
+ type PageNode = PageNodeOrigin
216
221
  const PageEvent: typeof PageEventOrigin
217
222
  type PageEvent = PageEventOrigin
218
223
  const NodeData: typeof NodeDataOrigin
@@ -224,8 +229,6 @@ declare global {
224
229
  type NativeLoadFontFaceFail = NativeLoadFontFaceFailOrigin
225
230
  const NativeLoadFontFaceOptions: typeof NativeLoadFontFaceOptionsOrigin
226
231
  type NativeLoadFontFaceOptions = NativeLoadFontFaceOptionsOrigin
227
- const MouseEvent: typeof MouseEventOrigin
228
- type MouseEvent = MouseEventOrigin
229
232
  const InputKeyboardHeightChangeEvent: typeof InputKeyboardHeightChangeEventOrigin
230
233
  type InputKeyboardHeightChangeEvent = InputKeyboardHeightChangeEventOrigin
231
234
  const InputFocusEvent: typeof InputFocusEventOrigin
@@ -12,6 +12,8 @@ export * from './UniTextElement'
12
12
  export * from './UniTabsElement'
13
13
  export * from './UniPageManager'
14
14
  export * from './UniPage'
15
+ export * from './UniFormControlElement'
16
+ export * from './UniFormControl'
15
17
  export * from './UniError'
16
18
  export * from './UniElement'
17
19
  export * from './UniDocument'
@@ -38,11 +40,11 @@ export * from './RichTextItemClickEvent'
38
40
  export * from './ResizeEvent'
39
41
  export * from './RefresherEvent'
40
42
  export * from './PageScrollEvent'
43
+ export * from './PageNode'
41
44
  export * from './PageEvent'
42
45
  export * from './NodeData'
43
46
  export * from './NestedPreScrollEvent'
44
47
  export * from './NativeLoadFontFaceOptions'
45
- export * from './MouseEvent'
46
48
  export * from './InputKeyboardHeightChangeEvent'
47
49
  export * from './InputFocusEvent'
48
50
  export * from './InputEvent'
package/types/page.d.ts CHANGED
@@ -849,7 +849,7 @@ interface PageInstance<D extends AnyObject = any, T extends AnyObject = any> ext
849
849
  * }
850
850
  *}
851
851
  */
852
- onShareAppMessage?(options: OnShareAppMessageOption): CustomShareContent | Promise<Omit<CustomShareContent, "promise">>;
852
+ onShareAppMessage?(options: OnShareAppMessageOption): CustomShareContent | Promise<Omit<CustomShareContent, "promise">>;
853
853
  /**
854
854
  * 用户点击右上角转发到朋友圈
855
855
  *
@@ -985,7 +985,7 @@ interface PageInstance<D extends AnyObject = any, T extends AnyObject = any> ext
985
985
  * }
986
986
  *}
987
987
  */
988
- onAddToFavorites?(options: OnAddToFavoritesOption): CustomFavoritesContent;
988
+ onAddToFavorites?(options: OnAddToFavoritesOption): CustomFavoritesContent;
989
989
  /**
990
990
  * 页面滚动触发事件的处理函数
991
991
  *
@@ -1054,7 +1054,7 @@ interface PageInstance<D extends AnyObject = any, T extends AnyObject = any> ext
1054
1054
  * }
1055
1055
  *}
1056
1056
  */
1057
- onPageScroll?(options: OnPageScrollOptions): void;
1057
+ onPageScroll?(options: OnPageScrollOptions): void;
1058
1058
  /**
1059
1059
  * 页面尺寸改变时触发
1060
1060
  * @param options 页面滚动参数
@@ -1121,7 +1121,7 @@ interface PageInstance<D extends AnyObject = any, T extends AnyObject = any> ext
1121
1121
  * }
1122
1122
  *}
1123
1123
  */
1124
- onResize?(options: OnResizeOptions): void;
1124
+ onResize?(options: OnResizeOptions): void;
1125
1125
  /**
1126
1126
  * 当前是 tab 页时,点击 tab 时触发
1127
1127
  * @param options tab 点击参数
@@ -1188,7 +1188,7 @@ interface PageInstance<D extends AnyObject = any, T extends AnyObject = any> ext
1188
1188
  * }
1189
1189
  *}
1190
1190
  */
1191
- onTabItemTap?(options: OnTabItemTapOption): void;
1191
+ onTabItemTap?(options: OnTabItemTapOption): void;
1192
1192
  /**
1193
1193
  * 监听原生标题栏按钮点击事件
1194
1194
  * @param options tab 点击参数
@@ -1255,7 +1255,7 @@ interface PageInstance<D extends AnyObject = any, T extends AnyObject = any> ext
1255
1255
  * }
1256
1256
  *}
1257
1257
  */
1258
- onNavigationBarButtonTap?(options: OnNavigationBarButtonTapOption): void;
1258
+ onNavigationBarButtonTap?(options: OnNavigationBarButtonTapOption): void;
1259
1259
  /**
1260
1260
  * 监听页面返回
1261
1261
  * @param options tab 点击参数
@@ -1323,7 +1323,7 @@ interface PageInstance<D extends AnyObject = any, T extends AnyObject = any> ext
1323
1323
  * }
1324
1324
  *}
1325
1325
  */
1326
- onBackPress?(options: OnBackPressOptions): any;
1326
+ onBackPress?(options: OnBackPressOptions): boolean | null;
1327
1327
  /**
1328
1328
  * 监听原生标题栏搜索输入框输入内容变化事件
1329
1329
  *
@@ -346,7 +346,7 @@ export interface Uni {
346
346
  /**
347
347
  * 返回一个SelectorQuery对象实例
348
348
  *
349
- * @tutorial http://uniapp.dcloud.io/api/ui/nodes-info?id=createselectorquery
349
+ * @tutorial https://uniapp.dcloud.io/uni-app-x/api/nodes-info.html
350
350
  * @uniPlatform {
351
351
  * "app": {
352
352
  * "android": {
@@ -357,7 +357,7 @@ export interface Uni {
357
357
  * "ios": {
358
358
  * "osVer": "10.0",
359
359
  * "uniVer": "√",
360
- * "unixVer": ""
360
+ * "unixVer": "x"
361
361
  * }
362
362
  * },
363
363
  * "mp": {
@@ -404,7 +404,7 @@ export interface Uni {
404
404
  * },
405
405
  * "web": {
406
406
  * "uniVer": "√",
407
- * "unixVer": ""
407
+ * "unixVer": "4.0+"
408
408
  * }
409
409
  * }
410
410
  */
@@ -49,8 +49,8 @@ export type PageScrollToOptions = {
49
49
  * }
50
50
  * },
51
51
  * "web": {
52
- * "uniVer": "x",
53
- * "unixVer": "x"
52
+ * "uniVer": "",
53
+ * "unixVer": "4.0+"
54
54
  * }
55
55
  * }
56
56
  */
@@ -77,7 +77,7 @@ export interface Uni {
77
77
  /**
78
78
  * 将页面滚动到目标位置
79
79
  *
80
- * @tutorial http://uniapp.dcloud.io/api/ui/scroll?id=pagescrollto
80
+ * @tutorial https://doc.dcloud.net.cn/uni-app-x/api/page-scroll-to.html
81
81
  * @uniPlatform {
82
82
  * "app": {
83
83
  * "android": {
@@ -88,7 +88,7 @@ export interface Uni {
88
88
  * "ios": {
89
89
  * "osVer": "10.0",
90
90
  * "uniVer": "√",
91
- * "unixVer": ""
91
+ * "unixVer": "x"
92
92
  * }
93
93
  * },
94
94
  * "mp": {
@@ -135,7 +135,7 @@ export interface Uni {
135
135
  * },
136
136
  * "web": {
137
137
  * "uniVer": "√",
138
- * "unixVer": ""
138
+ * "unixVer": "4.0+"
139
139
  * }
140
140
  * }
141
141
  */
@@ -5,7 +5,7 @@ export type CreateWebviewContext = (webviewId : string.WebviewIdString, componen
5
5
  export interface WebviewContext {
6
6
  /**
7
7
  * @description 后退到 web-view 组件网页加载历史的上一页,如果不存在上一页则没有任何效果。
8
- * @uniplatform {
8
+ * @uniPlatform {
9
9
  * "app": {
10
10
  * "android": {
11
11
  * "osVer": "4.4",
@@ -20,7 +20,7 @@ export interface WebviewContext {
20
20
 
21
21
  /**
22
22
  * @description 前进到 web-view 组件网页加载历史的下一页,如果不存在下一页则没有任何效果。
23
- * @uniplatform {
23
+ * @uniPlatform {
24
24
  * "app": {
25
25
  * "android": {
26
26
  * "osVer": "4.4",
@@ -35,7 +35,7 @@ export interface WebviewContext {
35
35
 
36
36
  /**
37
37
  * @description 重新加载 web-view 组件当前页面。
38
- * @uniplatform {
38
+ * @uniPlatform {
39
39
  * "app": {
40
40
  * "android": {
41
41
  * "osVer": "4.4",
@@ -50,7 +50,7 @@ export interface WebviewContext {
50
50
 
51
51
  /**
52
52
  * @description 停止加载 web-view 组件当前网页,该方法不能阻止已经加载的 html 文档,但是能够阻止未完成的图片及延迟加载的资源。
53
- * @uniplatform {
53
+ * @uniPlatform {
54
54
  * "app": {
55
55
  * "android": {
56
56
  * "osVer": "4.4",
@@ -65,7 +65,7 @@ export interface WebviewContext {
65
65
 
66
66
  /**
67
67
  * @description 在网页中执行指定的js脚本,在 uvue 页面中可通过此方法向 web-view 组件加载的页面发送数据
68
- * @uniplatform {
68
+ * @uniPlatform {
69
69
  * "app": {
70
70
  * "android": {
71
71
  * "osVer": "4.4",
@@ -82,7 +82,7 @@ export interface WebviewContext {
82
82
  export interface Uni {
83
83
  /**
84
84
  * @description 创建 web-view 组件的上下文对象,用于操作 web-view 的行为。
85
- * @uniplatform {
85
+ * @uniPlatform {
86
86
  * "app": {
87
87
  * "android": {
88
88
  * "osVer": "4.4",
@@ -8,20 +8,21 @@ export interface Uni {
8
8
  * @description
9
9
  * 获取app基本信息
10
10
  * @return {object}
11
- * @uniPlatform {
12
- * "app": {
13
- * "android": {
14
- * "osVer": "4.4",
15
- * "uniVer": "x",
16
- * "unixVer": "3.9+"
17
- * },
18
- * "ios": {
19
- * "osVer": "9.0",
20
- * "uniVer": "x",
21
- * "unixVer": "3.9+"
22
- * }
23
- * }
24
- * }
11
+ * @uniPlatform
12
+ * {
13
+ * "app": {
14
+ * "android": {
15
+ * "osVer": "4.4",
16
+ * "uniVer": "x",
17
+ * "unixVer": "3.9+"
18
+ * },
19
+ * "ios": {
20
+ * "osVer": "x",
21
+ * "uniVer": "x",
22
+ * "unixVer": "x"
23
+ * }
24
+ * }
25
+ * }
25
26
  * @example
26
27
  ```typescript
27
28
  uni.getAccessibilityInfo()