mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-18 02:21:20 -08:00
refactor(core): [CORE-20] type entry and converge initialization
This commit is contained in:
1 parent
ccf77c4ed2
commit
ee895a558f
100 files changed
+33854
-839
No files matched your search
@@ -1,3 +1,16 @@
|
||||
import type { MediaSurface } from '../media/types'
|
||||
import type Template from '../template'
|
||||
|
||||
// Consumers of the canonical template require these nodes. SSR callers supply
|
||||
// the same structure and proxy callers supply a media-like element; neither
|
||||
// contract is proven by a DOM query. Keep this assertion at the entry boundary.
|
||||
// Template itself and all public query helpers retain nullable query results.
|
||||
type RequiredPlayerNode = Exclude<keyof TemplateNodes, '$danmuku' | '$controlsCenter' | '$notice' | '$mask' | '$info'>
|
||||
|
||||
export type PlayerTemplate<Host extends TemplateHost<Host>> = Template<Host> & {
|
||||
[Name in RequiredPlayerNode]: NonNullable<TemplateNodes[Name]>
|
||||
} & { $video: MediaSurface, $mini?: HTMLElement }
|
||||
|
||||
export interface TemplateHost<Host> {
|
||||
id: number
|
||||
option: {
|
||||
|
||||
Reference in new issue
Block a user