mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-27 09:41:20 -08:00
update d.ts
This commit is contained in:
1 parent
8904130837
commit
81edd00afc
5 files changed
+21
-7
No files matched your search
+4
-1
@@ -40,6 +40,7 @@ declare class Artplayer extends Player {
|
|||||||
static SCROLL_GAP: number;
|
static SCROLL_GAP: number;
|
||||||
static AUTO_PLAYBACK_MAX: number;
|
static AUTO_PLAYBACK_MAX: number;
|
||||||
static AUTO_PLAYBACK_MIN: number;
|
static AUTO_PLAYBACK_MIN: number;
|
||||||
|
static AUTO_PLAYBACK_TIMEOUT: number;
|
||||||
static RECONNECT_TIME_MAX: number;
|
static RECONNECT_TIME_MAX: number;
|
||||||
static RECONNECT_SLEEP_TIME: number;
|
static RECONNECT_SLEEP_TIME: number;
|
||||||
static CONTROL_HIDE_TIME: number;
|
static CONTROL_HIDE_TIME: number;
|
||||||
@@ -122,7 +123,7 @@ declare class Artplayer extends Player {
|
|||||||
};
|
};
|
||||||
|
|
||||||
readonly notice: {
|
readonly notice: {
|
||||||
time: number;
|
timer: number;
|
||||||
set show(msg: string);
|
set show(msg: string);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -146,6 +147,7 @@ declare class Artplayer extends Player {
|
|||||||
readonly hotkey: {
|
readonly hotkey: {
|
||||||
keys: Record<string, ((event: Event) => any)[]>;
|
keys: Record<string, ((event: Event) => any)[]>;
|
||||||
add(key: number, callback: (this: Artplayer, event: Event) => any): Artplayer['hotkey'];
|
add(key: number, callback: (this: Artplayer, event: Event) => any): Artplayer['hotkey'];
|
||||||
|
remove(key: number, callback: Function): Artplayer['hotkey'];
|
||||||
};
|
};
|
||||||
|
|
||||||
readonly mask: Component;
|
readonly mask: Component;
|
||||||
@@ -155,6 +157,7 @@ declare class Artplayer extends Player {
|
|||||||
add(setting: Setting): SettingOption;
|
add(setting: Setting): SettingOption;
|
||||||
update(settings: Setting[]): SettingOption[];
|
update(settings: Setting[]): SettingOption[];
|
||||||
updateStyle(width?: number): void;
|
updateStyle(width?: number): void;
|
||||||
|
remove(): void;
|
||||||
} & Component;
|
} & Component;
|
||||||
|
|
||||||
readonly plugins: {
|
readonly plugins: {
|
||||||
|
|||||||
Vendored
+12
-1
@@ -1,4 +1,15 @@
|
|||||||
type I18nKeys = 'en' | 'zh-cn' | 'zh-tw' | 'pl' | 'cs' | 'es' | 'fa' | 'fr' | `id` | (string & Record<never, never>);
|
type I18nKeys =
|
||||||
|
| 'en'
|
||||||
|
| 'zh-cn'
|
||||||
|
| 'zh-tw'
|
||||||
|
| 'pl'
|
||||||
|
| 'cs'
|
||||||
|
| 'es'
|
||||||
|
| 'fa'
|
||||||
|
| 'fr'
|
||||||
|
| `id`
|
||||||
|
| `ru`
|
||||||
|
| (string & Record<never, never>);
|
||||||
|
|
||||||
type I18nValue = {
|
type I18nValue = {
|
||||||
'Video Info': string;
|
'Video Info': string;
|
||||||
|
|||||||
Vendored
+1
-1
@@ -306,7 +306,7 @@ export type Option = {
|
|||||||
/**
|
/**
|
||||||
* Custom css variables
|
* Custom css variables
|
||||||
*/
|
*/
|
||||||
cssVar?: CssVar;
|
cssVar?: Partial<CssVar>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Custom video type function
|
* Custom video type function
|
||||||
|
|||||||
Vendored
+3
-1
@@ -1,3 +1,5 @@
|
|||||||
|
import { CssVar } from './cssVar';
|
||||||
|
|
||||||
export type AspectRatio = 'default' | '4:3' | '16:9' | (string & Record<never, never>);
|
export type AspectRatio = 'default' | '4:3' | '16:9' | (string & Record<never, never>);
|
||||||
export type PlaybackRate = 0.5 | 0.75 | 1.0 | 1.25 | 1.5 | 1.75 | 2.0 | (number & Record<never, never>);
|
export type PlaybackRate = 0.5 | 0.75 | 1.0 | 1.25 | 1.5 | 1.75 | 2.0 | (number & Record<never, never>);
|
||||||
export type Flip = 'normal' | 'horizontal' | 'vertical' | (string & Record<never, never>);
|
export type Flip = 'normal' | 'horizontal' | 'vertical' | (string & Record<never, never>);
|
||||||
@@ -65,7 +67,7 @@ export declare class Player {
|
|||||||
play(): Promise<void>;
|
play(): Promise<void>;
|
||||||
toggle(): void;
|
toggle(): void;
|
||||||
attr(key: string, value?: any): unknown;
|
attr(key: string, value?: any): unknown;
|
||||||
cssVar(key: `--art-${string}`, value?: string): unknown;
|
cssVar<T extends keyof CssVar>(key: T, value?: CssVar[T]): CssVar[T];
|
||||||
switchUrl(url: string): Promise<string>;
|
switchUrl(url: string): Promise<string>;
|
||||||
switchQuality(url: string): Promise<string>;
|
switchQuality(url: string): Promise<string>;
|
||||||
getDataURL(): Promise<string>;
|
getDataURL(): Promise<string>;
|
||||||
|
|||||||
+1
-3
@@ -22,8 +22,6 @@ export type Template = {
|
|||||||
readonly $info: HTMLDivElement;
|
readonly $info: HTMLDivElement;
|
||||||
readonly $infoPanel: HTMLDivElement;
|
readonly $infoPanel: HTMLDivElement;
|
||||||
readonly $infoClose: HTMLDivElement;
|
readonly $infoClose: HTMLDivElement;
|
||||||
readonly $miniHeader: HTMLDivElement;
|
|
||||||
readonly $miniTitle: HTMLDivElement;
|
|
||||||
readonly $miniClose: HTMLDivElement;
|
|
||||||
readonly $contextmenu: HTMLDivElement;
|
readonly $contextmenu: HTMLDivElement;
|
||||||
|
readonly $mini: HTMLDivElement;
|
||||||
};
|
};
|
||||||
Reference in new issue
Block a user