@dcloudio/uni-app-x 0.5.14 → 0.5.16

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.14",
3
+ "version": "0.5.16",
4
4
  "description": "uni-app x types",
5
5
  "typings": "index.d.ts",
6
6
  "author": "DCloud",
@@ -68,21 +68,21 @@ 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
85
- createDocument(tagName: string, data: Map<string, any>): IDocument
85
+ // createDocument(tagName: string, data: Map<string, any>): IDocument
86
86
  addPageEventListener(
87
87
  type:
88
88
  | 'onReady'
@@ -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,
10
+ VideoErrorEvent as VideoErrorEventOrigin,
11
+ VideoErrorCode as VideoErrorCodeOrigin,
12
+ VideoError as VideoErrorOrigin,
13
+ VideoProgressChangeEvent as VideoProgressChangeEventOrigin,
8
14
  VideoProgressChangeEventDetail as VideoProgressChangeEventDetailOrigin,
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
31
+ type VideoErrorEvent = VideoErrorEventOrigin
32
+ type VideoErrorCode = VideoErrorCodeOrigin
33
+ type VideoError = VideoErrorOrigin
34
+ type VideoProgressChangeEvent = VideoProgressChangeEventOrigin
22
35
  type VideoProgressChangeEventDetail = VideoProgressChangeEventDetailOrigin
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
  }
@@ -174,10 +174,8 @@ export interface Uni {
174
174
  * timeupdate 事件
175
175
  * 播放进度变化时触发
176
176
  */
177
- export class VideoTimeUpdateEvent extends CustomEvent<VideoTimeUpdateEventDetail> {
178
- constructor(detail : VideoTimeUpdateEventDetail) {
179
- super("timeupdate", detail);
180
- }
177
+ export interface VideoTimeUpdateEvent {
178
+ detail : VideoTimeUpdateEventDetail
181
179
  }
182
180
 
183
181
  export type VideoTimeUpdateEventDetail = {
@@ -195,10 +193,8 @@ export type VideoTimeUpdateEventDetail = {
195
193
  * fullscreenchange 事件
196
194
  * 当视频进入和退出全屏是触发
197
195
  */
198
- export class VideoFullScreenChangeEvent extends CustomEvent<VideoFullScreenChangeEventDetail> {
199
- constructor(detail : VideoFullScreenChangeEventDetail) {
200
- super("fullscreenchange", detail);
201
- }
196
+ export interface VideoFullScreenChangeEvent {
197
+ detail : VideoFullScreenChangeEventDetail
202
198
  }
203
199
 
204
200
  export type VideoFullScreenChangeEventDetail = {
@@ -216,20 +212,28 @@ export type VideoFullScreenChangeEventDetail = {
216
212
  * error 事件
217
213
  * 视频播放出错时触发
218
214
  */
219
- export class VideoErrorEvent extends CustomEvent<VideoError> {
220
- constructor(detail : VideoError) {
221
- super("error", detail);
222
- }
215
+ export interface VideoErrorEvent {
216
+ detail : VideoError
217
+ }
218
+
219
+ /**
220
+ * 统一错误码
221
+ * 100001 网络错误
222
+ * 200001 内部错误
223
+ * 300001 SDK错误
224
+ */
225
+ export type VideoErrorCode = 100001 | 200001 | 300001
226
+
227
+ export interface VideoError extends IUniError {
228
+ errCode : VideoErrorCode
223
229
  }
224
230
 
225
231
  /**
226
232
  * progress 事件
227
233
  * 加载进度变化时触发
228
234
  */
229
- export class VideoProgressChangeEvent extends CustomEvent<VideoProgressChangeEventDetail> {
230
- constructor(detail : VideoProgressChangeEventDetail) {
231
- super("progress", detail);
232
- }
235
+ export interface VideoProgressChangeEvent {
236
+ detail : VideoProgressChangeEventDetail
233
237
  }
234
238
 
235
239
  export type VideoProgressChangeEventDetail = {
@@ -243,10 +247,8 @@ export type VideoProgressChangeEventDetail = {
243
247
  * fullscreenclick 事件
244
248
  * 视频播放全屏播放时点击事件
245
249
  */
246
- export class VideoFullScreenClickEvent extends CustomEvent<VideoFullScreenClickEventDetail> {
247
- constructor(detail : VideoFullScreenClickEventDetail) {
248
- super("fullscreenclick", detail);
249
- }
250
+ export interface VideoFullScreenClickEvent {
251
+ detail : VideoFullScreenClickEventDetail
250
252
  }
251
253
 
252
254
  export type VideoFullScreenClickEventDetail = {
@@ -272,10 +274,8 @@ export type VideoFullScreenClickEventDetail = {
272
274
  * controlstoggle 事件
273
275
  * 切换播放控件显示隐藏时触发
274
276
  */
275
- export class VideoControlsToggleEvent extends CustomEvent<VideoControlsToggleEventDetail> {
276
- constructor(detail : VideoControlsToggleEventDetail) {
277
- super("controlstoggle", detail);
278
- }
277
+ export interface VideoControlsToggleEvent {
278
+ detail : VideoControlsToggleEventDetail
279
279
  }
280
280
 
281
281
  export type VideoControlsToggleEventDetail = {
@@ -283,36 +283,4 @@ export type VideoControlsToggleEventDetail = {
283
283
  * 是否显示
284
284
  */
285
285
  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
286
  }