mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-19 11:21:20 -08:00
fix(auto-thumbnail): [PKG-AUTO-THUMB-09] restore historical default calls
This commit is contained in:
1 parent
c4f5dcf17f
commit
f30c701d88
29 files changed
+3331
-44
No files matched your search
@@ -1,10 +1,10 @@
|
||||
import type Artplayer from 'artplayer'
|
||||
import type { Factory, Option, Result } from 'artplayer-plugin-auto-thumbnail/runtime'
|
||||
import type { Factory, Option, Result, RuntimeFactory } from 'artplayer-plugin-auto-thumbnail/runtime'
|
||||
import runtime from 'artplayer-plugin-auto-thumbnail/runtime'
|
||||
|
||||
type Equal<A, B> = (<T>() => T extends A ? 1 : 2) extends (<T>() => T extends B ? 1 : 2) ? true : false
|
||||
type Assert<T extends true> = T
|
||||
type ExactFactory = Assert<Equal<typeof runtime, Factory>>
|
||||
type ExactFactory = Assert<Equal<typeof runtime, RuntimeFactory>>
|
||||
type ExactOption = Assert<Equal<Parameters<typeof runtime>, [option: Option]>>
|
||||
type ExactResult = Assert<Equal<ReturnType<ReturnType<typeof runtime>>, Promise<Result>>>
|
||||
|
||||
@@ -14,5 +14,8 @@ const pending: Promise<Result> = runtime(option)(art)
|
||||
const name: Promise<'artplayerPluginAutoThumbnail'> = pending.then(value => value.name)
|
||||
const plugins: NonNullable<Artplayer['option']['plugins']> = [runtime(option)]
|
||||
const replacement: Factory = _option => async _art => ({ name: 'artplayerPluginAutoThumbnail' })
|
||||
void [name, plugins, replacement]
|
||||
const alias: RuntimeFactory = runtime.default.default
|
||||
const aliasResult: Promise<Result> = alias(option)(art)
|
||||
runtime.default = runtime
|
||||
void [name, plugins, replacement, aliasResult]
|
||||
export type { ExactFactory, ExactOption, ExactResult }
|
||||
Reference in new issue
Block a user