refactor(jassub): [PKG-JASSUB-04] migrate owned TypeScript and preserve public types

This commit is contained in:
Harvey Zhao committed 2026-09-14 01:41:31 +08:00
1 parent 38e7b37878
commit 5e445b1af6
33 files changed
+3636 -61

No files matched your search

@@ -1,5 +0,0 @@
import { registerJassub } from './registration.js'
export default function artplayerPluginJassub(option) {
return art => registerJassub(art, option)
}
@@ -0,0 +1,7 @@
import type { RuntimeOption } from '../types/runtime-api.js'
import type { JassubHost } from './registration.js'
import { registerJassub } from './registration.js'
export default function artplayerPluginJassub(option?: RuntimeOption) {
return (art: JassubHost) => registerJassub(art, option)
}
+12
View File
@@ -0,0 +1,12 @@
import type { RuntimeInstance, RuntimeOption } from '../types/runtime-api.js'
interface VendorInstance extends RuntimeInstance {
_destroyed?: boolean
// Minimal write contract: the DOM setter coerces the historical numeric 20.
_canvasParent?: { style: { zIndex: string | number } }
}
declare const JASSUB: {
new (option: RuntimeOption): VendorInstance
}
export default JASSUB
@@ -1,6 +1,13 @@
import type { RuntimeOption, RuntimeResult } from '../types/runtime-api.js'
import JASSUB from './jassub.es.js'
export function registerJassub(art, option) {
export interface JassubHost {
video: HTMLVideoElement
on: (name: 'destroy', callback: () => void) => unknown
off: (name: 'destroy', callback: () => void) => unknown
}
export function registerJassub(art: JassubHost, option?: RuntimeOption): RuntimeResult {
const instance = new JASSUB({ video: art.video, ...option })
let disposed = false
const dispose = () => {