mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-29 02: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,26 @@
|
||||
import type { Events as LegacyEvents } from '../events'
|
||||
import type { SubtitleCue, SubtitleOption } from './subtitle'
|
||||
|
||||
type NativeEvents = { [Name in Extract<keyof LegacyEvents, `video:${string}`>]: [event: Event] }
|
||||
|
||||
interface BuiltinEvents {
|
||||
[name: `video:${string}`]: [event: Event]
|
||||
'document:keydown': [KeyboardEvent]
|
||||
'document:mousemove': [MouseEvent]
|
||||
'document:mouseup': [MouseEvent]
|
||||
'mousemove': [MouseEvent]
|
||||
'click': [MouseEvent]
|
||||
'blur': [Event]
|
||||
'error': [error: unknown, attempt: number]
|
||||
'fullscreenError': [error: unknown]
|
||||
'aspectRatio': [string]
|
||||
'flip': [string]
|
||||
'seek': [time: number, requestedTime: number | string]
|
||||
'setBar': [type: string, percentage: number, event?: MouseEvent | TouchEvent]
|
||||
'subtitleBeforeUpdate': [cues: SubtitleCue[]]
|
||||
'subtitleAfterUpdate': [cues: SubtitleCue[]]
|
||||
'subtitleLoad': [cues: SubtitleCue[], option: SubtitleOption | null]
|
||||
}
|
||||
|
||||
/** Legacy custom event augmentation is retained; builtin payload corrections take precedence. */
|
||||
export interface Events extends Omit<LegacyEvents, keyof BuiltinEvents>, NativeEvents, BuiltinEvents, Record<PropertyKey, unknown[]> {}
|
||||
Reference in new issue
Block a user