update d.ts

This commit is contained in:
Harvey committed 2022-07-11 11:18:36 +08:00
1 parent bff84f9cb6
commit 55c7560ce2
4 files changed
+134 -11

No files matched your search

+1 -2
View File
@@ -7,10 +7,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
### Added
- url 选项允许传空字符串,可用于异步设置 art.url
### Added
- art.play() 方法统一返回 Promise
- play 事件改为异步触发
- 添加事件列表到 d.ts
## [4.5.2] - 2022-6-22
+66 -4
View File
@@ -495,6 +495,67 @@ type Option = {
type AspectRatio = 'default' | '4:3' | '16:9' | void;
type PlaybackRate = 0.5 | 0.75 | 1.0 | 1.25 | 1.5 | 1.75 | 2.0 | void;
type Flip = 'normal' | 'horizontal' | 'vertical' | void;
type Events =
| 'video:canplay'
| 'video:canplaythrough'
| 'video:complete'
| 'video:durationchange'
| 'video:emptied'
| 'video:ended'
| 'video:loadeddata'
| 'video:loadeddata'
| 'video:loadedmetadata'
| 'video:pause'
| 'video:play'
| 'video:playing'
| 'video:progress'
| 'video:ratechange'
| 'video:seeked'
| 'video:seeking'
| 'video:stalled'
| 'video:suspend'
| 'video:timeupdate'
| 'video:volumechange'
| 'video:waiting'
| 'hotkey'
| 'destroy'
| 'customType'
| 'url'
| 'subtitleUpdate'
| 'subtitleLoad'
| 'subtitleSwitch'
| 'focus'
| 'blur'
| 'dblclick'
| 'click'
| 'setBar'
| 'hover'
| 'mousemove'
| 'resize'
| 'view'
| 'aspectRatio'
| 'autoHeight'
| 'autoSize'
| 'ready'
| 'error'
| 'flip'
| 'fullscreen'
| 'fullscreenWeb'
| 'loop'
| 'mini'
| 'pause'
| 'pip'
| 'playbackRate'
| 'play'
| 'screenshot'
| 'seek'
| 'subtitleOffset'
| 'switch'
| 'restart'
| 'volume'
| 'lock'
| 'selector'
| string;
declare class Player {
get aspectRatio(): AspectRatio;
@@ -623,10 +684,11 @@ declare class Artplayer extends Player {
static FAST_FORWARD_VALUE: number;
static FAST_FORWARD_TIME: number;
on(name: string, fn: Function, ctx?: object): void;
once(name: string, fn: Function, ctx?: object): void;
emit(name: string): void;
off(name: string, callback?: Function): void;
on(name: Events, fn: Function, ctx?: object): void;
once(name: Events, fn: Function, ctx?: object): void;
emit(name: Events): void;
off(name: Events, callback?: Function): void;
query(selector: string): HTMLElement;
proxy(
target: HTMLElement,
+1 -1
View File
@@ -240,7 +240,7 @@ class Artplayer extends (0, _emitterDefault.default) {
return "development";
}
static get build() {
return "1656296990952";
return "1657509322912";
}
static get config() {
return 0, _configDefault.default;
+66 -4
View File
@@ -495,6 +495,67 @@ type Option = {
type AspectRatio = 'default' | '4:3' | '16:9' | void;
type PlaybackRate = 0.5 | 0.75 | 1.0 | 1.25 | 1.5 | 1.75 | 2.0 | void;
type Flip = 'normal' | 'horizontal' | 'vertical' | void;
type Events =
| 'video:canplay'
| 'video:canplaythrough'
| 'video:complete'
| 'video:durationchange'
| 'video:emptied'
| 'video:ended'
| 'video:loadeddata'
| 'video:loadeddata'
| 'video:loadedmetadata'
| 'video:pause'
| 'video:play'
| 'video:playing'
| 'video:progress'
| 'video:ratechange'
| 'video:seeked'
| 'video:seeking'
| 'video:stalled'
| 'video:suspend'
| 'video:timeupdate'
| 'video:volumechange'
| 'video:waiting'
| 'hotkey'
| 'destroy'
| 'customType'
| 'url'
| 'subtitleUpdate'
| 'subtitleLoad'
| 'subtitleSwitch'
| 'focus'
| 'blur'
| 'dblclick'
| 'click'
| 'setBar'
| 'hover'
| 'mousemove'
| 'resize'
| 'view'
| 'aspectRatio'
| 'autoHeight'
| 'autoSize'
| 'ready'
| 'error'
| 'flip'
| 'fullscreen'
| 'fullscreenWeb'
| 'loop'
| 'mini'
| 'pause'
| 'pip'
| 'playbackRate'
| 'play'
| 'screenshot'
| 'seek'
| 'subtitleOffset'
| 'switch'
| 'restart'
| 'volume'
| 'lock'
| 'selector'
| string;
declare class Player {
get aspectRatio(): AspectRatio;
@@ -623,10 +684,11 @@ declare class Artplayer extends Player {
static FAST_FORWARD_VALUE: number;
static FAST_FORWARD_TIME: number;
on(name: string, fn: Function, ctx?: object): void;
once(name: string, fn: Function, ctx?: object): void;
emit(name: string): void;
off(name: string, callback?: Function): void;
on(name: Events, fn: Function, ctx?: object): void;
once(name: Events, fn: Function, ctx?: object): void;
emit(name: Events): void;
off(name: Events, callback?: Function): void;
query(selector: string): HTMLElement;
proxy(
target: HTMLElement,