mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-27 17:51:20 -08:00
refactor(core): [CORE-21] generate compatible public and editor declarations
This commit is contained in:
1 parent
ee895a558f
commit
faaa3e8c2d
123 files changed
+31305
-1712
No files matched your search
@@ -0,0 +1,19 @@
|
||||
import type { Emitter } from '../emitter'
|
||||
import type Artplayer from '../runtime'
|
||||
import type { Events } from './events'
|
||||
import type { Player } from './player'
|
||||
|
||||
/** Safe fields before Template returns; video/query/proxy getters are not usable yet. */
|
||||
export interface ProxyHost extends Emitter<Events>, Pick<Artplayer, 'constructor' | 'id' | 'option' | 'isLock' | 'isReady' | 'isFocus' | 'isInput' | 'isRotate' | 'isDestroy' | 'destroy'> {}
|
||||
|
||||
// Mapped types collapse distinct getter/setter types; preserve Player directly.
|
||||
type Pending<Names extends keyof Artplayer> = Player & Omit<Artplayer, Names | keyof Player> & Partial<Pick<Artplayer, Names>>
|
||||
type AfterPlayer = 'layers' | 'controls' | 'contextmenu' | 'subtitle' | 'info' | 'loading' | 'hotkey' | 'mask' | 'setting' | 'plugins'
|
||||
|
||||
/** URL assignment awaits its owned delay before invoking customType. */
|
||||
export type CustomTypeHost = Artplayer
|
||||
export type LayerHost = Pending<AfterPlayer>
|
||||
export type ControlHost = Pending<Exclude<AfterPlayer, 'layers'>>
|
||||
export type ContextmenuHost = Pending<Exclude<AfterPlayer, 'layers' | 'controls'>>
|
||||
/** Constructor factories run before the Plugins registry is assigned to the player. */
|
||||
export type PluginHost = Pending<'plugins'>
|
||||
Reference in new issue
Block a user