mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-16 09:36:16 -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,17 @@
|
||||
/* eslint-disable ts/no-require-imports, ts/no-this-alias -- Exercise actual CJS syntax and callback receiver types. */
|
||||
import Artplayer = require('artplayer/runtime')
|
||||
import LegacyRuntime = require('artplayer/runtime/legacy')
|
||||
|
||||
const option: Artplayer.OptionInput = { container: '#player' }
|
||||
const art: Artplayer = new Artplayer(option)
|
||||
const legacy: Artplayer = new LegacyRuntime(option)
|
||||
const factory: Artplayer.PluginFactory<{ name: string }> = function (instance) {
|
||||
const receiver: Artplayer.PluginHost = this
|
||||
const value: undefined = instance.seek
|
||||
void [receiver, value]
|
||||
return { name: 'cjs' }
|
||||
}
|
||||
const registry: Artplayer.Plugins = art.plugins.add(factory)
|
||||
// @ts-expect-error CJS must not reintroduce legacy false getter values.
|
||||
const falseSeek: number = legacy.seek
|
||||
void [registry, falseSeek]
|
||||
Reference in new issue
Block a user