Update option.d.ts

This commit is contained in:
Harvey committed 2022-10-09 17:14:43 +08:00
1 parent d2d0e2d8db
commit 57f5c44d17
1 file changed
+6 -2
+6 -2
View File
@@ -5,6 +5,8 @@ import { I18n } from './i18n';
import { ComponentOption } from './component'; import { ComponentOption } from './component';
import Artplayer = require('./artplayer'); import Artplayer = require('./artplayer');
type CustomType = 'flv' | 'm3u8' | 'hls' | 'ts' | 'mpd' | 'torrent' | (string & Record<never, never>);
export type Option = { export type Option = {
/** /**
* The player id * The player id
@@ -34,7 +36,7 @@ export type Option = {
/** /**
* Video url type * Video url type
*/ */
type?: string; type?: CustomType;
/** /**
* Player color theme * Player color theme
@@ -296,7 +298,9 @@ export type Option = {
/** /**
* Custom video type function * Custom video type function
*/ */
customType?: Record<string, (this: Artplayer, video: HTMLVideoElement, url: string, art: Artplayer) => any>; customType?: Partial<
Record<CustomType, (this: Artplayer, video: HTMLVideoElement, url: string, art: Artplayer) => any>
>;
}; };
export default Option; export default Option;