mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-27 01:21:20 -08:00
fix(types): PKG-CHAPTER-04 preserve CJS ESM and legacy consumer contracts
This commit is contained in:
1 parent
48660c4e12
commit
bab80ff886
41 files changed
+1087
-119
No files matched your search
@@ -0,0 +1,13 @@
|
||||
import Artplayer = require('artplayer')
|
||||
import chapter = require('artplayer-plugin-chapter')
|
||||
import legacy = require('artplayer-plugin-chapter/legacy')
|
||||
import french = require('artplayer/i18n/fr')
|
||||
|
||||
const option: Artplayer.Option = { container: '#player', url: 'video.mp4', i18n: { fr: french } }
|
||||
const art: Artplayer = new Artplayer(option)
|
||||
const result: chapter.Result = chapter()(art)
|
||||
const old: legacy.Result = legacy()(art)
|
||||
result.update({})
|
||||
old.update({})
|
||||
// @ts-expect-error CommonJS callers retain strict endpoint types.
|
||||
chapter({ chapters: [{ start: '0', end: 8, title: 'Invalid' }] })
|
||||
Reference in new issue
Block a user