mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-28 02:01:20 -08:00
refactor(types): CORE-07 reconcile public declarations and preserve legacy consumers
This commit is contained in:
1 parent
ee859e4804
commit
f9707bad71
34 files changed
+2806
-85
No files matched your search
@@ -1,4 +1,4 @@
|
||||
import type { Events } from 'artplayer'
|
||||
import type { Events, Emitter as PublicEmitter } from 'artplayer'
|
||||
import Emitter from '../../packages/artplayer/src/utils/emitter'
|
||||
|
||||
const symbol = Symbol('message')
|
||||
@@ -12,6 +12,7 @@ class TypedEmitter extends Emitter<Messages> {
|
||||
count = 0
|
||||
}
|
||||
const events = new TypedEmitter()
|
||||
const publicShape: PublicEmitter<Messages> = events
|
||||
const context = { total: 0 }
|
||||
const chain: TypedEmitter = events.on('value', function (count, label) {
|
||||
this.total += count
|
||||
@@ -39,4 +40,4 @@ events.on('ready', contextListener, { total: 'zero' })
|
||||
function contextListener(this: { total: number }) {
|
||||
return this.total
|
||||
}
|
||||
void chain
|
||||
void [chain, publicShape]
|
||||
Reference in new issue
Block a user