@dcloudio/uni-app-x 0.5.15 → 0.5.17

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dcloudio/uni-app-x",
3
- "version": "0.5.15",
3
+ "version": "0.5.17",
4
4
  "description": "uni-app x types",
5
5
  "typings": "index.d.ts",
6
6
  "author": "DCloud",
@@ -4,17 +4,20 @@
4
4
  */
5
5
  declare class CSSStyleDeclaration {
6
6
 
7
- /**
8
- * 对CSS指定样式设置一个新值,如有此样式已存在则更新。
9
- * @param name CSS样式名称
10
- * @param value 要设置的新CSS样式值
11
- */
12
- setProperty(name: string|string.cssPropertyString, value: any|null): void
7
+ /**
8
+ * 对CSS指定样式设置一个新值,如有此样式已存在则更新。
9
+ * @param name CSS样式名称
10
+ * @param value 要设置的新CSS样式值
11
+ */
12
+ setProperty(name: string | string.cssPropertyString, value: any | null): void
13
13
 
14
- /**
15
- * 获取CSS指定的样式值,如果指定的样式不存在则返回null。
16
- * @param property 要获取的CSS样式名称
17
- */
18
- getPropertyValue(property: string|string.cssPropertyString): any|null
14
+ /**
15
+ * 获取CSS指定的样式值,如果指定的样式不存在则返回null。
16
+ * @param property 要获取的CSS样式名称
17
+ */
18
+ getPropertyValue(property: string | string.cssPropertyString): any | null
19
+
20
+ removeProperty(property: string | string.cssPropertyString): any | null
19
21
 
22
+ getStyleMap(): Map<String, any | null>
20
23
  }
@@ -68,17 +68,17 @@ declare interface IPage {
68
68
  startRender(callback?: () => void): void
69
69
  /**
70
70
  * 显示页面
71
- * @param {Map<String, Any>} options 显示配置项
71
+ * @param options 显示配置项
72
72
  * @param callback 显示完毕监听器
73
73
  */
74
- show(options?: any, callback?: () => void): void
74
+ show(options?: Map<String, any>, callback?: () => void): void
75
75
  hide(options?: Map<string, any>): void
76
76
  /**
77
77
  * 关闭页面
78
- * @param {Map<String, Any>} options 关闭配置项
78
+ * @param options 关闭配置项
79
79
  * @param callback 关闭完毕监听器
80
80
  */
81
- close(options?: any, callback?: () => void): void
81
+ close(options?: Map<String, any>, callback?: () => void): void
82
82
  destroy(): void;
83
83
  updateStyle(style: Map<string, any>): void
84
84
  createDocument(documentData: INodeData): IDocument
@@ -1,13 +1,13 @@
1
- /// <reference path='./lib/route/index.d.ts' />
2
1
  /// <reference path='./lib/performance/index.d.ts' />
3
2
  /// <reference path='./lib/lifecycle/index.d.ts' />
4
- /// <reference path='./lib/ui/tab-bar/index.d.ts' />
3
+ /// <reference path='./lib/route/index.d.ts' />
5
4
  /// <reference path='./lib/ui/set-navigation-bar-title/index.d.ts' />
5
+ /// <reference path='./lib/ui/tab-bar/index.d.ts' />
6
6
  /// <reference path='./lib/ui/set-navigation-bar-color/index.d.ts' />
7
7
  /// <reference path='./lib/ui/pull-down-refresh/index.d.ts' />
8
8
  /// <reference path='./lib/ui/page-scroll-to/index.d.ts' />
9
- /// <reference path='./lib/ui/load-font-face/index.d.ts' />
10
9
  /// <reference path='./lib/ui/get-element-by-id/index.d.ts' />
10
+ /// <reference path='./lib/ui/load-font-face/index.d.ts' />
11
11
  /// <reference path='./lib/ui/create-selector-query/index.d.ts' />
12
12
  /// <reference path='./lib/base/interceptor/index.d.ts' />
13
13
  /// <reference path='./lib/base/event/index.d.ts' />
@@ -1,4 +1,6 @@
1
1
  import {
2
+ PageScrollToErrorCode as PageScrollToErrorCodeOrigin,
3
+ PageScrollToError as PageScrollToErrorOrigin,
2
4
  PageScrollToSuccess as PageScrollToSuccessOrigin,
3
5
  PageScrollToSuccessCallback as PageScrollToSuccessCallbackOrigin,
4
6
  PageScrollToFail as PageScrollToFailOrigin,
@@ -10,6 +12,8 @@ import {
10
12
  } from './interface'
11
13
 
12
14
  declare global {
15
+ type PageScrollToErrorCode = PageScrollToErrorCodeOrigin
16
+ type PageScrollToError = PageScrollToErrorOrigin
13
17
  type PageScrollToSuccess = PageScrollToSuccessOrigin
14
18
  type PageScrollToSuccessCallback = PageScrollToSuccessCallbackOrigin
15
19
  type PageScrollToFail = PageScrollToFailOrigin
@@ -1,5 +1,14 @@
1
1
  import { AsyncApiSuccessResult } from '../../interface'
2
2
 
3
+ /**
4
+ * 设置页面滚动错误码
5
+ * - 4: 框架内部异常
6
+ */
7
+ export type PageScrollToErrorCode = 4
8
+ export interface PageScrollToError extends IUniError {
9
+ errCode: PageScrollToErrorCode
10
+ }
11
+
3
12
  export type PageScrollToSuccess = AsyncApiSuccessResult
4
13
  export type PageScrollToSuccessCallback = (result: PageScrollToSuccess) => void
5
14
  export type PageScrollToFail = UniError
@@ -1,6 +1,6 @@
1
- import { ComponentPublicInstance } from 'vue'
1
+ import { ComponentPublicInstance } from 'vue';
2
2
 
3
- export type CreateWebviewContext = (webviewId : WebviewIdString, component : ComponentPublicInstance | null) => WebviewContext | null
3
+ export type CreateWebviewContext = (webviewId : string.WebviewIdString, component : ComponentPublicInstance | null) => WebviewContext | null;
4
4
 
5
5
  export interface WebviewContext {
6
6
  /**
@@ -94,5 +94,5 @@ export interface Uni {
94
94
  * @uniVueVersion 2,3
95
95
  * @return {CreateWebviewContext} web-view组件上下文对象
96
96
  */
97
- createWebviewContext(webviewId : string | HBuilderX.WebviewIdString, component : ComponentPublicInstance | null) : WebviewContext | null
97
+ createWebviewContext : CreateWebviewContext
98
98
  }
@@ -11,7 +11,7 @@ export interface Uni {
11
11
  * "android": {
12
12
  * "osVer": "4.4",
13
13
  * "uniVer": "√",
14
- * "unixVer": "3.97"
14
+ * "unixVer": "3.98"
15
15
  * },
16
16
  * "ios": {
17
17
  * "osVer": "9.0",
@@ -42,7 +42,7 @@ export interface Uni {
42
42
  * "android": {
43
43
  * "osVer": "4.4",
44
44
  * "uniVer": "√",
45
- * "unixVer": "3.97"
45
+ * "unixVer": "3.98"
46
46
  * },
47
47
  * "ios": {
48
48
  * "osVer": "9.0",
@@ -71,7 +71,7 @@ export interface Uni {
71
71
  * "android": {
72
72
  * "osVer": "4.4",
73
73
  * "uniVer": "√",
74
- * "unixVer": "3.97"
74
+ * "unixVer": "3.98"
75
75
  * },
76
76
  * "ios": {
77
77
  * "osVer": "9.0",
@@ -99,8 +99,8 @@ export interface Uni {
99
99
  * "app": {
100
100
  * "android": {
101
101
  * "osVer": "4.4",
102
- * "uniVer": "3.97",
103
- * "unixVer": "3.97"
102
+ * "uniVer": "3.98",
103
+ * "unixVer": "3.98"
104
104
  * },
105
105
  * "ios": {
106
106
  * "osVer": "9.0",
@@ -135,7 +135,7 @@ export interface Uni {
135
135
  * "android": {
136
136
  * "osVer": "4.4",
137
137
  * "uniVer": "√",
138
- * "unixVer": "3.97"
138
+ * "unixVer": "3.98"
139
139
  * },
140
140
  * "ios": {
141
141
  * "osVer": "9.0",
@@ -257,7 +257,7 @@ export interface ChannelManager {
257
257
  * "android": {
258
258
  * "osVer": "4.4",
259
259
  * "uniVer": "√",
260
- * "unixVer": "3.97"
260
+ * "unixVer": "3.98"
261
261
  * },
262
262
  * "ios": {
263
263
  * "osVer": "9.0",
@@ -276,7 +276,7 @@ export interface ChannelManager {
276
276
  * "android": {
277
277
  * "osVer": "4.4",
278
278
  * "uniVer": "√",
279
- * "unixVer": "3.97"
279
+ * "unixVer": "3.98"
280
280
  * },
281
281
  * "ios": {
282
282
  * "osVer": "9.0",
@@ -348,7 +348,7 @@ export type CreatePushMessageOptions = {
348
348
  * "android": {
349
349
  * "osVer": "4.4",
350
350
  * "uniVer": "√",
351
- * "unixVer": "3.97"
351
+ * "unixVer": "3.98"
352
352
  * },
353
353
  * "ios": {
354
354
  * "osVer": "9.0",
@@ -367,7 +367,7 @@ export type CreatePushMessageOptions = {
367
367
  * "android": {
368
368
  * "osVer": "4.4",
369
369
  * "uniVer": "√",
370
- * "unixVer": "3.97"
370
+ * "unixVer": "3.98"
371
371
  * },
372
372
  * "ios": {
373
373
  * "osVer": "9.0",
@@ -3,12 +3,19 @@ import {
3
3
  Danmu as DanmuOrigin,
4
4
  RequestFullScreenOptions as RequestFullScreenOptionsOrigin,
5
5
  VideoContext as VideoContextOrigin,
6
+ VideoTimeUpdateEvent as VideoTimeUpdateEventOrigin,
6
7
  VideoTimeUpdateEventDetail as VideoTimeUpdateEventDetailOrigin,
8
+ VideoFullScreenChangeEvent as VideoFullScreenChangeEventOrigin,
7
9
  VideoFullScreenChangeEventDetail as VideoFullScreenChangeEventDetailOrigin,
8
- VideoProgressChangeEventDetail as VideoProgressChangeEventDetailOrigin,
10
+ VideoErrorEvent as VideoErrorEventOrigin,
11
+ VideoErrorCode as VideoErrorCodeOrigin,
12
+ VideoError as VideoErrorOrigin,
13
+ VideoProgressEvent as VideoProgressEventOrigin,
14
+ VideoProgressEventDetail as VideoProgressEventDetailOrigin,
15
+ VideoFullScreenClickEvent as VideoFullScreenClickEventOrigin,
9
16
  VideoFullScreenClickEventDetail as VideoFullScreenClickEventDetailOrigin,
17
+ VideoControlsToggleEvent as VideoControlsToggleEventOrigin,
10
18
  VideoControlsToggleEventDetail as VideoControlsToggleEventDetailOrigin,
11
- VideoErrorCode as VideoErrorCodeOrigin,
12
19
  Uni as UniOrigin
13
20
  } from './interface'
14
21
 
@@ -17,11 +24,18 @@ declare global {
17
24
  type Danmu = DanmuOrigin
18
25
  type RequestFullScreenOptions = RequestFullScreenOptionsOrigin
19
26
  type VideoContext = VideoContextOrigin
27
+ type VideoTimeUpdateEvent = VideoTimeUpdateEventOrigin
20
28
  type VideoTimeUpdateEventDetail = VideoTimeUpdateEventDetailOrigin
29
+ type VideoFullScreenChangeEvent = VideoFullScreenChangeEventOrigin
21
30
  type VideoFullScreenChangeEventDetail = VideoFullScreenChangeEventDetailOrigin
22
- type VideoProgressChangeEventDetail = VideoProgressChangeEventDetailOrigin
31
+ type VideoErrorEvent = VideoErrorEventOrigin
32
+ type VideoErrorCode = VideoErrorCodeOrigin
33
+ type VideoError = VideoErrorOrigin
34
+ type VideoProgressEvent = VideoProgressEventOrigin
35
+ type VideoProgressEventDetail = VideoProgressEventDetailOrigin
36
+ type VideoFullScreenClickEvent = VideoFullScreenClickEventOrigin
23
37
  type VideoFullScreenClickEventDetail = VideoFullScreenClickEventDetailOrigin
38
+ type VideoControlsToggleEvent = VideoControlsToggleEventOrigin
24
39
  type VideoControlsToggleEventDetail = VideoControlsToggleEventDetailOrigin
25
- type VideoErrorCode = VideoErrorCodeOrigin
26
40
  interface Uni extends UniOrigin { }
27
41
  }
@@ -1,6 +1,6 @@
1
1
  import { ComponentPublicInstance } from 'vue';
2
2
 
3
- export type CreateVideoContext = (videoId : string, component ?: ComponentPublicInstance | null) => VideoContext | null;
3
+ export type CreateVideoContext = (videoId : string.VideoIdString, component : ComponentPublicInstance | null) => VideoContext | null;
4
4
 
5
5
  export type Danmu = {
6
6
  /**
@@ -170,14 +170,22 @@ export interface Uni {
170
170
  createVideoContext(videoId : string, component ?: ComponentPublicInstance | null) : VideoContext | null
171
171
  }
172
172
 
173
+ /**
174
+ * 通用事件
175
+ */
176
+ interface VideoEvent {
177
+ type : string
178
+ target : Element | null
179
+ currentTarget : Element | null
180
+ timeStamp : Long
181
+ }
182
+
173
183
  /**
174
184
  * timeupdate 事件
175
185
  * 播放进度变化时触发
176
186
  */
177
- export class VideoTimeUpdateEvent extends CustomEvent<VideoTimeUpdateEventDetail> {
178
- constructor(detail : VideoTimeUpdateEventDetail) {
179
- super("timeupdate", detail);
180
- }
187
+ export interface VideoTimeUpdateEvent extends VideoEvent {
188
+ detail : VideoTimeUpdateEventDetail
181
189
  }
182
190
 
183
191
  export type VideoTimeUpdateEventDetail = {
@@ -195,10 +203,8 @@ export type VideoTimeUpdateEventDetail = {
195
203
  * fullscreenchange 事件
196
204
  * 当视频进入和退出全屏是触发
197
205
  */
198
- export class VideoFullScreenChangeEvent extends CustomEvent<VideoFullScreenChangeEventDetail> {
199
- constructor(detail : VideoFullScreenChangeEventDetail) {
200
- super("fullscreenchange", detail);
201
- }
206
+ export interface VideoFullScreenChangeEvent extends VideoEvent {
207
+ detail : VideoFullScreenChangeEventDetail
202
208
  }
203
209
 
204
210
  export type VideoFullScreenChangeEventDetail = {
@@ -216,23 +222,31 @@ export type VideoFullScreenChangeEventDetail = {
216
222
  * error 事件
217
223
  * 视频播放出错时触发
218
224
  */
219
- export class VideoErrorEvent extends CustomEvent<VideoError> {
220
- constructor(detail : VideoError) {
221
- super("error", detail);
222
- }
225
+ export interface VideoErrorEvent extends VideoEvent {
226
+ detail : VideoError
227
+ }
228
+
229
+ /**
230
+ * 统一错误码
231
+ * 100001 网络错误
232
+ * 200001 内部错误
233
+ * 300001 SDK错误
234
+ */
235
+ export type VideoErrorCode = 100001 | 200001 | 300001
236
+
237
+ export interface VideoError extends IUniError {
238
+ errCode : VideoErrorCode
223
239
  }
224
240
 
225
241
  /**
226
242
  * progress 事件
227
243
  * 加载进度变化时触发
228
244
  */
229
- export class VideoProgressChangeEvent extends CustomEvent<VideoProgressChangeEventDetail> {
230
- constructor(detail : VideoProgressChangeEventDetail) {
231
- super("progress", detail);
232
- }
245
+ export interface VideoProgressEvent extends VideoEvent {
246
+ detail : VideoProgressEventDetail
233
247
  }
234
248
 
235
- export type VideoProgressChangeEventDetail = {
249
+ export type VideoProgressEventDetail = {
236
250
  /**
237
251
  * 加载进度百分比
238
252
  */
@@ -243,10 +257,8 @@ export type VideoProgressChangeEventDetail = {
243
257
  * fullscreenclick 事件
244
258
  * 视频播放全屏播放时点击事件
245
259
  */
246
- export class VideoFullScreenClickEvent extends CustomEvent<VideoFullScreenClickEventDetail> {
247
- constructor(detail : VideoFullScreenClickEventDetail) {
248
- super("fullscreenclick", detail);
249
- }
260
+ export interface VideoFullScreenClickEvent extends VideoEvent {
261
+ detail : VideoFullScreenClickEventDetail
250
262
  }
251
263
 
252
264
  export type VideoFullScreenClickEventDetail = {
@@ -272,10 +284,8 @@ export type VideoFullScreenClickEventDetail = {
272
284
  * controlstoggle 事件
273
285
  * 切换播放控件显示隐藏时触发
274
286
  */
275
- export class VideoControlsToggleEvent extends CustomEvent<VideoControlsToggleEventDetail> {
276
- constructor(detail : VideoControlsToggleEventDetail) {
277
- super("controlstoggle", detail);
278
- }
287
+ export interface VideoControlsToggleEvent extends VideoEvent {
288
+ detail : VideoControlsToggleEventDetail
279
289
  }
280
290
 
281
291
  export type VideoControlsToggleEventDetail = {
@@ -283,36 +293,4 @@ export type VideoControlsToggleEventDetail = {
283
293
  * 是否显示
284
294
  */
285
295
  show : boolean
286
- }
287
-
288
- /**
289
- * 统一错误主题(模块)名称
290
- */
291
- export const UniErrorSubject = 'uni-video';
292
-
293
- /**
294
- * 统一错误码
295
- * 100001 网络错误
296
- * 200001 内部错误
297
- * 300001 SDK错误
298
- */
299
- export type VideoErrorCode = 100001 | 200001 | 300001
300
-
301
- /**
302
- * 统一错误描述信息
303
- */
304
- export const UniErrors : Map<VideoErrorCode, string> = new Map([
305
- [100001, 'network error'],
306
- [200001, 'internal error'],
307
- [300001, 'sdk error']
308
- ]);
309
-
310
- export class VideoError extends UniError {
311
- constructor(errCode : VideoErrorCode, cause : SourceError | null = null) {
312
- super();
313
- this.errSubject = UniErrorSubject;
314
- this.errCode = errCode;
315
- this.errMsg = UniErrors[errCode] ?? "";
316
- this.cause = cause;
317
- }
318
296
  }
package/uts-plugin.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  /// <reference path='./types/native/UniError.d.ts' />
2
2
  /// <reference path='./types/native/SourceError.d.ts' />
3
3
  /// <reference path='./types/native/UniAggregateError.d.ts' />
4
+ /// <reference path='./types/native/UTSAndroidHookProxy.d.ts' />
4
5
  /// <reference path='./types/uni/base/index.d.ts' />
5
6
  /// <reference path='./types/uni/uts-plugin-api/lib/uni-getAppBaseInfo/utssdk/index.d.ts' />
6
7
  /// <reference path='./types/uni/uts-plugin-api/lib/uni-getDeviceInfo/utssdk/index.d.ts' />