update d.ts

This commit is contained in:
Harvey Zack committed 2023-04-21 16:44:32 +08:00
1 parent 8904130837
commit 81edd00afc
5 files changed
+21 -7

No files matched your search

+4 -1
View File
@@ -40,6 +40,7 @@ declare class Artplayer extends Player {
static SCROLL_GAP: number;
static AUTO_PLAYBACK_MAX: number;
static AUTO_PLAYBACK_MIN: number;
static AUTO_PLAYBACK_TIMEOUT: number;
static RECONNECT_TIME_MAX: number;
static RECONNECT_SLEEP_TIME: number;
static CONTROL_HIDE_TIME: number;
@@ -122,7 +123,7 @@ declare class Artplayer extends Player {
};
readonly notice: {
time: number;
timer: number;
set show(msg: string);
};
@@ -146,6 +147,7 @@ declare class Artplayer extends Player {
readonly hotkey: {
keys: Record<string, ((event: Event) => any)[]>;
add(key: number, callback: (this: Artplayer, event: Event) => any): Artplayer['hotkey'];
remove(key: number, callback: Function): Artplayer['hotkey'];
};
readonly mask: Component;
@@ -155,6 +157,7 @@ declare class Artplayer extends Player {
add(setting: Setting): SettingOption;
update(settings: Setting[]): SettingOption[];
updateStyle(width?: number): void;
remove(): void;
} & Component;
readonly plugins: {
+12 -1
View File
@@ -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 = {
'Video Info': string;
+1 -1
View File
@@ -306,7 +306,7 @@ export type Option = {
/**
* Custom css variables
*/
cssVar?: CssVar;
cssVar?: Partial<CssVar>;
/**
* Custom video type function
+3 -1
View File
@@ -1,3 +1,5 @@
import { CssVar } from './cssVar';
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 Flip = 'normal' | 'horizontal' | 'vertical' | (string & Record<never, never>);
@@ -65,7 +67,7 @@ export declare class Player {
play(): Promise<void>;
toggle(): void;
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>;
switchQuality(url: string): Promise<string>;
getDataURL(): Promise<string>;
+1 -3
View File
@@ -22,8 +22,6 @@ export type Template = {
readonly $info: HTMLDivElement;
readonly $infoPanel: HTMLDivElement;
readonly $infoClose: HTMLDivElement;
readonly $miniHeader: HTMLDivElement;
readonly $miniTitle: HTMLDivElement;
readonly $miniClose: HTMLDivElement;
readonly $contextmenu: HTMLDivElement;
readonly $mini: HTMLDivElement;
};