@dcloudio/uni-app-x 0.4.5 → 0.4.6

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 (70) hide show
  1. package/.env +1 -1
  2. package/package.json +1 -1
  3. package/tsconfig.json +5 -0
  4. package/types/app.d.ts +986 -0
  5. package/types/common.d.ts +7 -0
  6. package/types/index.d.ts +3 -0
  7. package/types/native/AsyncApiResult.d.ts +1 -0
  8. package/types/native/CSSStyleDeclaration.d.ts +20 -0
  9. package/types/native/CustomEvent.d.ts +3 -0
  10. package/types/native/DOMRect.d.ts +56 -0
  11. package/types/native/DrawableContext.d.ts +102 -11
  12. package/types/native/Event.d.ts +25 -10
  13. package/types/native/IApp.d.ts +1 -0
  14. package/types/native/IDocument.d.ts +1 -0
  15. package/types/native/INode.d.ts +136 -5
  16. package/types/native/IPage.d.ts +1 -0
  17. package/types/native/IPageManager.d.ts +1 -0
  18. package/types/native/ITabsNode.d.ts +1 -0
  19. package/types/native/IWebViewNode.d.ts +28 -0
  20. package/types/native/ImageErrorEvent.d.ts +13 -0
  21. package/types/native/ImageLoadEvent.d.ts +17 -0
  22. package/types/native/MouseEvent.d.ts +44 -19
  23. package/types/native/NodeData.d.ts +1 -0
  24. package/types/native/PageEvent.d.ts +1 -0
  25. package/types/native/PageScrollEvent.d.ts +3 -0
  26. package/types/native/ResizeEvent.d.ts +26 -6
  27. package/types/native/RichTextItemClickEvent.d.ts +21 -0
  28. package/types/native/ScrollEvent.d.ts +27 -9
  29. package/types/native/SourceError.d.ts +38 -0
  30. package/types/native/TabTapEvent.d.ts +10 -2
  31. package/types/native/TouchEvent.d.ts +37 -10
  32. package/types/native/UTSError.d.ts +5 -2
  33. package/types/native/UTSPromise.d.ts +74 -0
  34. package/types/native/UniAggregateError.d.ts +17 -0
  35. package/types/native/UniAppManager.d.ts +1 -0
  36. package/types/native/UniError.d.ts +54 -5
  37. package/types/native/WebViewErrorEvent.d.ts +13 -0
  38. package/types/native/WebViewLoadedEvent.d.ts +8 -0
  39. package/types/native/WebViewLoadingEvent.d.ts +8 -0
  40. package/types/native/WebViewMessageEvent.d.ts +13 -0
  41. package/types/native/index.d.ts +15 -1
  42. package/types/page.d.ts +1729 -0
  43. package/types/shims-vue.d.ts +12 -0
  44. package/types/uni/core/lib/performance/index.d.ts +21 -0
  45. package/types/uni/core/lib/performance/interface.d.ts +152 -0
  46. package/types/uni/core/lib/ui/create-selector-query/index.d.ts +4 -0
  47. package/types/uni/ext/index.d.ts +0 -1
  48. package/types/uni/ext/lib/uni-audio/utssdk/index.d.ts +4 -0
  49. package/types/uni/ext/lib/uni-exit/utssdk/interface.d.ts +4 -4
  50. package/types/uni/ext/lib/uni-file-manager/utssdk/index.d.ts +2 -0
  51. package/types/uni/ext/lib/uni-file-manager/utssdk/interface.d.ts +6 -6
  52. package/types/uni/ext/lib/uni-getLocation-system/utssdk/interface.d.ts +39 -17
  53. package/types/uni/ext/lib/uni-getNetworkType/utssdk/interface.d.ts +3 -10
  54. package/types/uni/ext/lib/uni-getRecorderManager/utssdk/index.d.ts +2 -0
  55. package/types/uni/ext/lib/uni-getSystemInfo/utssdk/interface.d.ts +3 -10
  56. package/types/uni/ext/lib/uni-media/utssdk/interface.d.ts +55 -55
  57. package/types/uni/ext/lib/uni-network/utssdk/app-ios/index.d.ts +67 -0
  58. package/types/uni/ext/lib/uni-network/utssdk/app-ios/interface.d.ts +530 -0
  59. package/types/uni/ext/lib/uni-network/utssdk/index.d.ts +10 -4
  60. package/types/uni/ext/lib/uni-network/utssdk/interface.d.ts +37 -77
  61. package/types/uni/ext/lib/uni-openAppAuthorizeSetting/utssdk/interface.d.ts +3 -3
  62. package/types/uni/ext/lib/uni-prompt/utssdk/index.d.ts +0 -8
  63. package/types/uni/ext/lib/uni-prompt/utssdk/interface.d.ts +35 -112
  64. package/types/uni/ext/lib/uni-storage/utssdk/interface.d.ts +12 -12
  65. package/types/uni/ext/lib/uni-websocket/utssdk/index.d.ts +2 -0
  66. package/types/uni/ext/lib/uni-websocket/utssdk/interface.d.ts +11 -18
  67. package/types/uni-cloud/index.d.ts +333 -274
  68. package/types/vue/index.d.ts +1 -1
  69. package/types/uni/ext/lib/uni-getLocation-tencent/utssdk/index.d.ts +0 -15
  70. package/types/uni/ext/lib/uni-getLocation-tencent/utssdk/interface.d.ts +0 -93
@@ -1,274 +1,333 @@
1
- type UniCloudInitOptions = {
2
- /**
3
- * 服务商,目前支持 aliyun、tencent
4
- */
5
- provider: string;
6
- /**
7
- * 服务空间名
8
- */
9
- spaceName?: string;
10
- /**
11
- * 服务空间id
12
- */
13
- spaceId: string;
14
- /**
15
- * 阿里云clientSecret
16
- */
17
- clientSecret?: string;
18
- /**
19
- * 阿里云endpoint
20
- */
21
- endpoint?: string;
22
- };
23
- type UniCloudCallFunctionOptions = {
24
- /**
25
- * 云函数名
26
- */
27
- name: string;
28
- /**
29
- * 云函数参数
30
- */
31
- data?: UTSJSONObject;
32
- };
33
- type UniCloudCallFunctionResult = {
34
- /**
35
- * 云函数返回结果
36
- */
37
- result: UTSJSONObject;
38
- /**
39
- * 云函数请求id
40
- */
41
- requestId?: string;
42
- };
43
- type UniCloudUploadProgress = {
44
- /**
45
- * 已上传大小
46
- */
47
- loaded: number;
48
- /**
49
- * 总大小
50
- */
51
- total: number;
52
- };
53
- type UniCloudUploadFileOptions = {
54
- /**
55
- * 文件路径
56
- */
57
- filePath: string;
58
- /**
59
- * 云端路径
60
- */
61
- cloudPath: string;
62
- /**
63
- * 是否以云端路径是否为真实路径保存上传的文件
64
- */
65
- cloudPathAsRealPath?: boolean;
66
- /**
67
- * 上传进度回调
68
- * @param options 上传进度回调参数
69
- * @returns
70
- */
71
- onUploadProgress?: (options: UniCloudUploadProgress) => any;
72
- };
73
- type UniCloudUploadFileResult = {
74
- /**
75
- * 文件路径
76
- */
77
- filePath: string;
78
- /**
79
- * 文件id
80
- */
81
- fileID: string;
82
- };
83
- type UniCloudGetTempFileURLOptions = {
84
- /**
85
- * 文件列表
86
- */
87
- fileList: Array<string>;
88
- };
89
- type UniCloudGetTempFileURLResultItem = {
90
- /**
91
- * 文件id
92
- */
93
- fileID: string;
94
- /**
95
- * 文件临时url
96
- */
97
- tempFileURL: string;
98
- };
99
- type UniCloudGetTempFileURLResult = {
100
- /**
101
- * 文件列表
102
- */
103
- fileList: Array<UniCloudGetTempFileURLResultItem>;
104
- };
105
-
106
- // export const UTSPromise = Promise
107
- type UTSPromise<T> = Promise<T>;
108
-
109
- type UniCloudCallback = (arg?: any) => any | null;
110
-
111
- declare class UniCloudError extends Error {
112
- code: any;
113
- errMsg: string;
114
- errCode?: any;
115
- errSubject?: string;
116
- requestId?: string;
117
- constructor(message: string, code?: string, subject?: string, options?: UTSJSONObject);
118
- private _init;
119
- toJson(): UTSJSONObject;
120
- }
121
-
122
- declare class UniCloud {
123
- private _client;
124
- private _provider;
125
- private _spaceId;
126
- config: UniCloudInitOptions;
127
- constructor(options: UniCloudInitOptions);
128
- /**
129
- * 请求云函数
130
- * @description 请求云函数
131
- * @uniPlatform {
132
- * "app": {
133
- * "android": {
134
- * "osVer": "4.4",
135
- * "uniVer": "√",
136
- * "unixVer": "3.9.0 仅支持阿里云"
137
- * },
138
- * "ios": {
139
- * "uniVer": "√",
140
- * "unixVer": "x"
141
- * }
142
- * }
143
- * }
144
- */
145
- callFunction(options: UniCloudCallFunctionOptions): UTSPromise<UniCloudCallFunctionResult>;
146
- /**
147
- * 上传文件到云存储
148
- * @description 上传文件到云存储
149
- * @uniPlatform {
150
- * "app": {
151
- * "android": {
152
- * "osVer": "4.4",
153
- * "uniVer": "√",
154
- * "unixVer": "3.9.0 仅支持阿里云"
155
- * },
156
- * "ios": {
157
- * "uniVer": "√",
158
- * "unixVer": "x"
159
- * }
160
- * }
161
- * }
162
- */
163
- uploadFile(options: UniCloudUploadFileOptions): UTSPromise<UniCloudUploadFileResult>;
164
- /**
165
- * 获取文件临时URL
166
- * @description 获取文件临时URL
167
- * @uniPlatform {
168
- * "app": {
169
- * "android": {
170
- * "osVer": "4.4",
171
- * "uniVer": "√",
172
- * "unixVer": "3.9.0 仅支持阿里云"
173
- * },
174
- * "ios": {
175
- * "uniVer": "√",
176
- * "unixVer": "x"
177
- * }
178
- * }
179
- * }
180
- */
181
- getTempFileURL(options: UniCloudGetTempFileURLOptions): UTSPromise<UniCloudGetTempFileURLResult>;
182
- /**
183
- * 引用云对象
184
- * @description 引用云对象
185
- * @uniPlatform {
186
- * "app": {
187
- * "android": {
188
- * "osVer": "4.4",
189
- * "uniVer": "√",
190
- * "unixVer": "3.9.0 仅支持阿里云"
191
- * },
192
- * "ios": {
193
- * "uniVer": "",
194
- * "unixVer": "x"
195
- * }
196
- * }
197
- * }
198
- */
199
- importObject(objectName: string): any;
200
- /**
201
- * 监听响应事件
202
- * @description 监听响应事件
203
- * @uniPlatform {
204
- * "app": {
205
- * "android": {
206
- * "osVer": "4.4",
207
- * "uniVer": "√",
208
- * "unixVer": "3.9.0 仅支持阿里云"
209
- * },
210
- * "ios": {
211
- * "uniVer": "",
212
- * "unixVer": "x"
213
- * }
214
- * }
215
- * }
216
- */
217
- onResponse(callback: UniCloudCallback): void;
218
- /**
219
- * 移除响应事件监听
220
- * @description 移除响应事件监听
221
- * @uniPlatform {
222
- * "app": {
223
- * "android": {
224
- * "osVer": "4.4",
225
- * "uniVer": "√",
226
- * "unixVer": "3.9.0 仅支持阿里云"
227
- * },
228
- * "ios": {
229
- * "uniVer": "",
230
- * "unixVer": "x"
231
- * }
232
- * }
233
- * }
234
- */
235
- offResponse(callback: UniCloudCallback): void;
236
- /**
237
- * 监听token刷新事件
238
- * @description 监听token刷新事件
239
- * @uniPlatform {
240
- * "app": {
241
- * "android": {
242
- * "osVer": "4.4",
243
- * "uniVer": "√",
244
- * "unixVer": "3.9.0 仅支持阿里云"
245
- * },
246
- * "ios": {
247
- * "uniVer": "",
248
- * "unixVer": "x"
249
- * }
250
- * }
251
- * }
252
- */
253
- onRefreshToken(callback: UniCloudCallback): void;
254
- /**
255
- * 移除token刷新事件监听
256
- * @description 移除token刷新事件监听
257
- * @uniPlatform {
258
- * "app": {
259
- * "android": {
260
- * "osVer": "4.4",
261
- * "uniVer": "√",
262
- * "unixVer": "3.9.0 仅支持阿里云"
263
- * },
264
- * "ios": {
265
- * "uniVer": "",
266
- * "unixVer": "x"
267
- * }
268
- * }
269
- * }
270
- */
271
- offRefreshToken(callback: UniCloudCallback): void;
272
- }
273
-
274
- declare const uniCloud: UniCloud;
1
+ type UniCloudCallback<T> = (arg: T) => any | null;
2
+
3
+ type UniCloudInitOptions = {
4
+ /**
5
+ * 服务商,目前支持 aliyun、tencent
6
+ */
7
+ provider: string;
8
+ /**
9
+ * 服务空间名
10
+ */
11
+ spaceName?: string;
12
+ /**
13
+ * 服务空间id
14
+ */
15
+ spaceId: string;
16
+ /**
17
+ * 阿里云clientSecret
18
+ */
19
+ clientSecret?: string;
20
+ /**
21
+ * 阿里云endpoint
22
+ */
23
+ endpoint?: string;
24
+ };
25
+ type UniCloudCallFunctionOptions = {
26
+ /**
27
+ * 云函数名
28
+ */
29
+ name: string;
30
+ /**
31
+ * 云函数参数
32
+ */
33
+ data?: UTSJSONObject;
34
+ };
35
+ type UniCloudCallFunctionResult = {
36
+ /**
37
+ * 云函数返回结果
38
+ */
39
+ result: UTSJSONObject;
40
+ /**
41
+ * 云函数请求id
42
+ */
43
+ requestId?: string;
44
+ };
45
+ type UniCloudUploadProgress = {
46
+ /**
47
+ * 已上传大小
48
+ */
49
+ loaded: number;
50
+ /**
51
+ * 总大小
52
+ */
53
+ total: number;
54
+ };
55
+ type UniCloudUploadFileOptions = {
56
+ /**
57
+ * 文件路径
58
+ */
59
+ filePath: string;
60
+ /**
61
+ * 云端路径
62
+ */
63
+ cloudPath: string;
64
+ /**
65
+ * 是否以云端路径是否为真实路径保存上传的文件
66
+ */
67
+ cloudPathAsRealPath?: boolean;
68
+ /**
69
+ * 上传进度回调
70
+ * @param options 上传进度回调参数
71
+ * @returns
72
+ */
73
+ onUploadProgress?: (options: UniCloudUploadProgress) => any;
74
+ };
75
+ type UniCloudUploadFileResult = {
76
+ /**
77
+ * 文件路径
78
+ */
79
+ filePath: string;
80
+ /**
81
+ * 文件id
82
+ */
83
+ fileID: string;
84
+ };
85
+ type UniCloudGetTempFileURLOptions = {
86
+ /**
87
+ * 文件列表
88
+ */
89
+ fileList: Array<string>;
90
+ };
91
+ type UniCloudGetTempFileURLResultItem = {
92
+ /**
93
+ * 文件id
94
+ */
95
+ fileID: string;
96
+ /**
97
+ * 文件临时url
98
+ */
99
+ tempFileURL: string;
100
+ };
101
+ type UniCloudGetTempFileURLResult = {
102
+ /**
103
+ * 文件列表
104
+ */
105
+ fileList: Array<UniCloudGetTempFileURLResultItem>;
106
+ };
107
+ type UniCloudResponseEvent = {
108
+ /**
109
+ * 响应事件类型
110
+ */
111
+ type: string;
112
+ /**
113
+ * 响应事件由哪个云函数触发
114
+ */
115
+ name: string;
116
+ /**
117
+ * 响应结果、错误内容
118
+ */
119
+ content: any;
120
+ };
121
+ type UniCloudRefreshTokenEvent = {
122
+ /**
123
+ * token内容
124
+ */
125
+ token: string;
126
+ /**
127
+ * token过期时间
128
+ */
129
+ tokenExpired: number;
130
+ };
131
+
132
+ // export const UTSPromise = Promise
133
+ type UTSPromise<T> = Promise<T>;
134
+
135
+ declare class UniCloudError extends Error {
136
+ code: any;
137
+ errMsg: string;
138
+ errCode: any;
139
+ errSubject?: string;
140
+ requestId?: string;
141
+ constructor(message: string, code?: string, subject?: string, options?: UTSJSONObject);
142
+ private _init;
143
+ toJson(): UTSJSONObject;
144
+ }
145
+
146
+ type UniCloudImportObjectLoadingOptions = {
147
+ /**
148
+ * 加载框标题
149
+ */
150
+ title?: string | null;
151
+ /**
152
+ * 加载框是否显示mask
153
+ */
154
+ mask?: boolean | null;
155
+ };
156
+ type UniCloudImportObjectErrorOptions = {
157
+ /**
158
+ * 错误提示类型,可以是modal或者toast
159
+ */
160
+ type?: string | null;
161
+ /**
162
+ * 是否显示重试按钮
163
+ */
164
+ retry?: boolean | null;
165
+ };
166
+ type UniCloudImportObjectOptions = {
167
+ /**
168
+ * 是否移除自动展示的ui
169
+ */
170
+ customUI?: boolean | null;
171
+ /**
172
+ * loading界面配置
173
+ */
174
+ loadingOptions?: UniCloudImportObjectLoadingOptions | null;
175
+ /**
176
+ * 错误提示配置
177
+ */
178
+ errorOptions?: UniCloudImportObjectErrorOptions | null;
179
+ };
180
+
181
+ declare class UniCloud {
182
+ private _client;
183
+ private _provider;
184
+ private _spaceId;
185
+ config: UniCloudInitOptions;
186
+ constructor(options: UniCloudInitOptions);
187
+ /**
188
+ * 请求云函数
189
+ * @description 请求云函数
190
+ * @uniPlatform {
191
+ * "app": {
192
+ * "android": {
193
+ * "osVer": "5.0",
194
+ * "uniVer": "",
195
+ * "unixVer": "3.9.0 仅支持阿里云"
196
+ * },
197
+ * "ios": {
198
+ * "uniVer": "√",
199
+ * "unixVer": "x"
200
+ * }
201
+ * }
202
+ * }
203
+ */
204
+ callFunction(options: UniCloudCallFunctionOptions): UTSPromise<UniCloudCallFunctionResult>;
205
+ /**
206
+ * 上传文件到云存储
207
+ * @description 上传文件到云存储
208
+ * @uniPlatform {
209
+ * "app": {
210
+ * "android": {
211
+ * "osVer": "5.0",
212
+ * "uniVer": "",
213
+ * "unixVer": "3.9.0 仅支持阿里云"
214
+ * },
215
+ * "ios": {
216
+ * "uniVer": "√",
217
+ * "unixVer": "x"
218
+ * }
219
+ * }
220
+ * }
221
+ */
222
+ uploadFile(options: UniCloudUploadFileOptions): UTSPromise<UniCloudUploadFileResult>;
223
+ /**
224
+ * 获取文件临时URL
225
+ * @description 获取文件临时URL
226
+ * @uniPlatform {
227
+ * "app": {
228
+ * "android": {
229
+ * "osVer": "5.0",
230
+ * "uniVer": "",
231
+ * "unixVer": "3.9.0 仅支持阿里云"
232
+ * },
233
+ * "ios": {
234
+ * "uniVer": "√",
235
+ * "unixVer": "x"
236
+ * }
237
+ * }
238
+ * }
239
+ */
240
+ getTempFileURL(options: UniCloudGetTempFileURLOptions): UTSPromise<UniCloudGetTempFileURLResult>;
241
+ /**
242
+ * 引用云对象
243
+ * @description 引用云对象
244
+ * @uniPlatform {
245
+ * "app": {
246
+ * "android": {
247
+ * "osVer": "5.0",
248
+ * "uniVer": "",
249
+ * "unixVer": "3.9.0 仅支持阿里云"
250
+ * },
251
+ * "ios": {
252
+ * "uniVer": "√",
253
+ * "unixVer": "x"
254
+ * }
255
+ * }
256
+ * }
257
+ */
258
+ importObject(objectName: string, options?: UniCloudImportObjectOptions): any;
259
+ /**
260
+ * 监听响应事件
261
+ * @description 监听响应事件
262
+ * @uniPlatform {
263
+ * "app": {
264
+ * "android": {
265
+ * "osVer": "5.0",
266
+ * "uniVer": "",
267
+ * "unixVer": "3.9.0 仅支持阿里云"
268
+ * },
269
+ * "ios": {
270
+ * "uniVer": "√",
271
+ * "unixVer": "x"
272
+ * }
273
+ * }
274
+ * }
275
+ */
276
+ onResponse(callback: UniCloudCallback<UniCloudResponseEvent>): void;
277
+ /**
278
+ * 移除响应事件监听
279
+ * @description 移除响应事件监听
280
+ * @uniPlatform {
281
+ * "app": {
282
+ * "android": {
283
+ * "osVer": "5.0",
284
+ * "uniVer": "√",
285
+ * "unixVer": "3.9.0 仅支持阿里云"
286
+ * },
287
+ * "ios": {
288
+ * "uniVer": "√",
289
+ * "unixVer": "x"
290
+ * }
291
+ * }
292
+ * }
293
+ */
294
+ offResponse(callback: UniCloudCallback<UniCloudResponseEvent>): void;
295
+ /**
296
+ * 监听token刷新事件
297
+ * @description 监听token刷新事件
298
+ * @uniPlatform {
299
+ * "app": {
300
+ * "android": {
301
+ * "osVer": "5.0",
302
+ * "uniVer": "√",
303
+ * "unixVer": "3.9.0 仅支持阿里云"
304
+ * },
305
+ * "ios": {
306
+ * "uniVer": "√",
307
+ * "unixVer": "x"
308
+ * }
309
+ * }
310
+ * }
311
+ */
312
+ onRefreshToken(callback: UniCloudCallback<UniCloudRefreshTokenEvent>): void;
313
+ /**
314
+ * 移除token刷新事件监听
315
+ * @description 移除token刷新事件监听
316
+ * @uniPlatform {
317
+ * "app": {
318
+ * "android": {
319
+ * "osVer": "5.0",
320
+ * "uniVer": "√",
321
+ * "unixVer": "3.9.0 仅支持阿里云"
322
+ * },
323
+ * "ios": {
324
+ * "uniVer": "√",
325
+ * "unixVer": "x"
326
+ * }
327
+ * }
328
+ * }
329
+ */
330
+ offRefreshToken(callback: UniCloudCallback<UniCloudRefreshTokenEvent>): void;
331
+ }
332
+
333
+ declare const uniCloud: UniCloud;
@@ -1,6 +1,6 @@
1
1
  /// <reference path='./CheckboxGroupChangeEvent.d.ts' />
2
2
  /// <reference path='./PickerViewChangeEvent.d.ts' />
3
- /// <reference path='./CheckboxGroupChangeEvent.d.ts' />
3
+ /// <reference path='./ProgressActiveendEvent.d.ts' />
4
4
  /// <reference path='./RadioGroupChangeEvent.d.ts' />
5
5
  /// <reference path='./SliderChangeEvent.d.ts' />
6
6
  /// <reference path='./SwitchChangeEvent.d.ts' />
@@ -1,15 +0,0 @@
1
- import {
2
- GetLocation as GetLocationOrigin,
3
- GetLocationSuccess as GetLocationSuccessOrigin,
4
- GetLocationFail as GetLocationFailOrigin,
5
- GetLocationOptions as GetLocationOptionsOrigin,
6
- Uni as UniOrigin
7
- } from './interface'
8
-
9
- declare global {
10
- type GetLocation = GetLocationOrigin
11
- type GetLocationSuccess = GetLocationSuccessOrigin
12
- type GetLocationFail = GetLocationFailOrigin
13
- type GetLocationOptions = GetLocationOptionsOrigin
14
- interface Uni extends UniOrigin { }
15
- }