import type Artplayer from 'artplayer' import thumbnail from 'artplayer-plugin-auto-thumbnail' import legacy from 'artplayer-plugin-auto-thumbnail/legacy' type Equal = (() => T extends A ? 1 : 2) extends (() => T extends B ? 1 : 2) ? true : false type Assert = T interface Option { url?: string, width?: number, number?: number, scale?: number } interface Result { name: 'artplayerPluginAutoThumbnail' } type HistoricalFactory = (option: Option) => (art: Artplayer) => Result type ExactFactory = Assert> type ExactOption = Assert, [option: Option]>> type ExactResult = Assert>, Result>> type ExactLegacy = Assert> declare const art: Artplayer const result: Result = thumbnail({ url: '/video.mp4', width: 80, number: 12, scale: 0.5 })(art) const replacement: typeof thumbnail = (_option: Option) => (_art: Artplayer) => result const assignBack: HistoricalFactory = thumbnail const legacyReplacement: typeof legacy = replacement const moduleReplacement: typeof import('artplayer-plugin-auto-thumbnail') = { default: replacement } const legacyName: Result['name'] = legacy({})(art).name void [assignBack, legacyReplacement, moduleReplacement, legacyName] export type { ExactFactory, ExactLegacy, ExactOption, ExactResult }