Add ts to demo

This commit is contained in:
Harvey committed 2021-12-08 14:01:42 +08:00
1 parent d906a860c9
commit 0e0bdd00dd
3 files changed
+346 -11

No files matched your search

+4 -3
View File
@@ -1,4 +1,5 @@
export = Artplayer;
export as namespace Artplayer;
interface Selector {
default?: boolean;
@@ -29,7 +30,7 @@ interface Component {
add(option: ComponentOption): HTMLElement;
}
type Plugin = (art: Artplayer) => any;
type PluginFunction = (art: Artplayer) => any;
type WhitelistFunction = (ua: string) => Boolean;
type CustomType = (video: HTMLVideoElement, url: string, art: Artplayer) => any;
type EventCallback = (event: Event) => any;
@@ -66,7 +67,7 @@ interface Option {
localVideo?: boolean;
localSubtitle?: boolean;
useSSR?: boolean;
plugins?: Plugin[];
plugins?: PluginFunction[];
whitelist?: (string | WhitelistFunction | RegExp)[];
layers?: ComponentOption[];
contextmenu?: ComponentOption[];
@@ -271,7 +272,7 @@ declare class Artplayer extends Player {
readonly plugins: {
readonly id: number;
add(plugin: Plugin): Artplayer['plugins'];
add(plugin: PluginFunction): Artplayer['plugins'];
};
readonly i18n: {