import type Artplayer from 'artplayer' import type { Danmu, Option, Result } from 'artplayer-plugin-danmuku' import danmuku from 'artplayer-plugin-danmuku' type Equal = (() => T extends A ? 1 : 2) extends (() => T extends B ? 1 : 2) ? true : false type Assert = T type Factory = (option: Option) => (art: Artplayer) => Result type SameArguments = Assert, [option: Option]>> type SameResult = Assert>, Result>> type SameEmit = Assert, Result>> type SameLoad = Assert, Promise>> type SamePoints = Assert> type SameDanmuKeys = Assert> declare const art: Artplayer declare const result: Result const replacement: Factory = (_option: Option) => (_art: Artplayer) => result const toOld: Factory = danmuku const fromOld: typeof danmuku = replacement const option: Option = { danmuku: [], points: [{ time: 1, value: 2 }], margin: [0, '25%'], beforeEmit: async () => true } const plugin: Result = danmuku(option)(art) const synchronousOldEmit: Result = plugin.emit({ text: 'old declaration', mode: 1 }) const loaded: Promise = plugin.load(Promise.resolve([{ text: 'reload' }])) const configured: Result = plugin.config(option) const mounted: void = plugin.mount('#external') void [toOld, fromOld, synchronousOldEmit, loaded, configured, mounted] export type { SameArguments, SameDanmuKeys, SameEmit, SameLoad, SamePoints, SameResult }