mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-31 04:31:20 -08:00
update d.ts
This commit is contained in:
1 parent
e2e15994c6
commit
0aa9189d17
2 files changed
+18
-26
No files matched your search
Vendored
+9
-13
@@ -174,7 +174,7 @@ type Component = {
|
|||||||
|
|
||||||
type PluginFunction = (art: Artplayer) => any | ((option: any) => (art: Artplayer) => any);
|
type PluginFunction = (art: Artplayer) => any | ((option: any) => (art: Artplayer) => any);
|
||||||
type CustomType = (video: HTMLVideoElement, url: string, art: Artplayer) => any;
|
type CustomType = (video: HTMLVideoElement, url: string, art: Artplayer) => any;
|
||||||
type WhitelistFunction = (ua: string) => Boolean;
|
type WhitelistFunction = (ua: string) => boolean;
|
||||||
type EventCallback = (event: Event) => any;
|
type EventCallback = (event: Event) => any;
|
||||||
|
|
||||||
type SubtitleOption = {
|
type SubtitleOption = {
|
||||||
@@ -712,13 +712,9 @@ declare class Artplayer extends Player {
|
|||||||
emit(name: Events): void;
|
emit(name: Events): void;
|
||||||
off(name: Events, callback?: Function): void;
|
off(name: Events, callback?: Function): void;
|
||||||
|
|
||||||
query(selector: string): HTMLElement;
|
query: Artplayer['template']['query'];
|
||||||
proxy(
|
proxy: Artplayer['events']['proxy'];
|
||||||
target: HTMLElement,
|
|
||||||
name: string,
|
|
||||||
callback: EventCallback,
|
|
||||||
option?: { passive?: boolean; once?: boolean; capture?: boolean } | Boolean,
|
|
||||||
): Function;
|
|
||||||
destroy(removeHtml?: boolean): void;
|
destroy(removeHtml?: boolean): void;
|
||||||
|
|
||||||
readonly template: {
|
readonly template: {
|
||||||
@@ -752,11 +748,11 @@ declare class Artplayer extends Player {
|
|||||||
};
|
};
|
||||||
|
|
||||||
readonly events: {
|
readonly events: {
|
||||||
proxy(
|
proxy<K extends keyof WindowEventMap, T extends HTMLElement = HTMLDivElement>(
|
||||||
target: HTMLElement,
|
target: T,
|
||||||
name: string,
|
name: K,
|
||||||
callback: EventCallback,
|
callback: (event: WindowEventMap[K]) => void,
|
||||||
option?: { passive?: boolean; once?: boolean; capture?: boolean } | Boolean,
|
options?: boolean | AddEventListenerOptions,
|
||||||
): Function;
|
): Function;
|
||||||
hover(target: HTMLElement, mouseenter?: EventCallback, mouseleave?: EventCallback): Function;
|
hover(target: HTMLElement, mouseenter?: EventCallback, mouseleave?: EventCallback): Function;
|
||||||
loadImg(target: HTMLImageElement | string): Promise<HTMLImageElement>;
|
loadImg(target: HTMLImageElement | string): Promise<HTMLImageElement>;
|
||||||
|
|||||||
+9
-13
@@ -174,7 +174,7 @@ type Component = {
|
|||||||
|
|
||||||
type PluginFunction = (art: Artplayer) => any | ((option: any) => (art: Artplayer) => any);
|
type PluginFunction = (art: Artplayer) => any | ((option: any) => (art: Artplayer) => any);
|
||||||
type CustomType = (video: HTMLVideoElement, url: string, art: Artplayer) => any;
|
type CustomType = (video: HTMLVideoElement, url: string, art: Artplayer) => any;
|
||||||
type WhitelistFunction = (ua: string) => Boolean;
|
type WhitelistFunction = (ua: string) => boolean;
|
||||||
type EventCallback = (event: Event) => any;
|
type EventCallback = (event: Event) => any;
|
||||||
|
|
||||||
type SubtitleOption = {
|
type SubtitleOption = {
|
||||||
@@ -712,13 +712,9 @@ declare class Artplayer extends Player {
|
|||||||
emit(name: Events): void;
|
emit(name: Events): void;
|
||||||
off(name: Events, callback?: Function): void;
|
off(name: Events, callback?: Function): void;
|
||||||
|
|
||||||
query(selector: string): HTMLElement;
|
query: Artplayer['template']['query'];
|
||||||
proxy(
|
proxy: Artplayer['events']['proxy'];
|
||||||
target: HTMLElement,
|
|
||||||
name: string,
|
|
||||||
callback: EventCallback,
|
|
||||||
option?: { passive?: boolean; once?: boolean; capture?: boolean } | Boolean,
|
|
||||||
): Function;
|
|
||||||
destroy(removeHtml?: boolean): void;
|
destroy(removeHtml?: boolean): void;
|
||||||
|
|
||||||
readonly template: {
|
readonly template: {
|
||||||
@@ -752,11 +748,11 @@ declare class Artplayer extends Player {
|
|||||||
};
|
};
|
||||||
|
|
||||||
readonly events: {
|
readonly events: {
|
||||||
proxy(
|
proxy<K extends keyof WindowEventMap, T extends HTMLElement = HTMLDivElement>(
|
||||||
target: HTMLElement,
|
target: T,
|
||||||
name: string,
|
name: K,
|
||||||
callback: EventCallback,
|
callback: (event: WindowEventMap[K]) => void,
|
||||||
option?: { passive?: boolean; once?: boolean; capture?: boolean } | Boolean,
|
options?: boolean | AddEventListenerOptions,
|
||||||
): Function;
|
): Function;
|
||||||
hover(target: HTMLElement, mouseenter?: EventCallback, mouseleave?: EventCallback): Function;
|
hover(target: HTMLElement, mouseenter?: EventCallback, mouseleave?: EventCallback): Function;
|
||||||
loadImg(target: HTMLImageElement | string): Promise<HTMLImageElement>;
|
loadImg(target: HTMLImageElement | string): Promise<HTMLImageElement>;
|
||||||
|
|||||||
Reference in new issue
Block a user