refactor(vast): [PKG-VAST-04] retain published types and add accurate runtime declarations

This commit is contained in:
Harvey Zhao committed 2026-09-14 23:07:52 +08:00
1 parent c162d2b3b3
commit e5c73fa620
34 files changed
+7819 -1495

No files matched your search

+3 -27
View File
@@ -1,30 +1,6 @@
import type { google, ImaSdk } from '@alugha/ima'
import type { Player, PlayerOptions } from '@glomex/vast-ima-player'
import type Artplayer from 'artplayer'
import type { WorkspaceContext } from '../types/runtime-api.js'
export type Utilities = Pick<typeof Artplayer.utils, 'createElement' | 'setStyles'>
export type RequestConfig = Record<string, unknown>
export interface CompatibilityOptions {
compatibility?: 'workspace-1.2'
}
export interface Context {
art: Artplayer
playUrl: (url: string, config?: RequestConfig) => void
playRes: (response: string, config?: RequestConfig) => void
init: () => Player | null
ima: ImaSdk
adsRenderingSettings: google.ima.AdsRenderingSettings
playerOptions: PlayerOptions
readonly imaPlayer: Player | null
readonly id: string | null
readonly $container: HTMLDivElement | null
readonly container: HTMLDivElement | null
}
export type Callback = (context: Context) => unknown
export interface Result {
name: 'artplayerPluginVast'
destroy: () => void
}
export type { CompatibilityOptions, WorkspaceContext as Context, RequestConfig, RuntimeResult as Result } from '../types/runtime-api.js'
export type Callback = (context: WorkspaceContext) => unknown