import type LegacyArtplayer from './artplayer' import type { Emitter } from './emitter' import type { OptionInput as LegacyOptionInput } from './option' import type { PluginFactory as LegacyPluginFactory, Plugins as LegacyPlugins } from './plugin' import type { ComponentInput, Component as ComponentView, ControlInput, Controls as ControlsView } from './runtime/component' import type { ContextmenuHost, ControlHost, CustomTypeHost, LayerHost, PluginHost, ProxyHost } from './runtime/construction' import type { Events } from './runtime/events' import type { MediaSurface } from './runtime/media' import type { OptionInput as OptionInputView, Option as OptionView } from './runtime/option' import type { Player } from './runtime/player' import type { PluginFactory as FactoryView, PluginRegistration, Plugins as PluginsView } from './runtime/plugin' import type { Config, EventRegistry, Hotkey, I18n, Scheme, Storage, ValidatorPath } from './runtime/services' import type { Setting as SettingView } from './runtime/setting' import type { Notice as NoticeView, Subtitle as SubtitleView } from './runtime/subtitle' import type { Icons, Template } from './runtime/template' import type { Utils } from './runtime/utils' export type { Emitter } from './emitter' export type { ComponentInput, ComponentOption, ControlInput, ControlOption, SelectorItem } from './runtime/component' export type { ContextmenuHost, ControlHost, CustomTypeHost, LayerHost, PluginHost, ProxyHost } from './runtime/construction' export type { Events } from './runtime/events' export type { CanvasMedia, MediaSurface, NativeMedia } from './runtime/media' export type { Player, QualityItem } from './runtime/player' export type { PluginRegistration } from './runtime/plugin' export type { Config, Dictionary, EventRegistry, Hotkey, I18n, Languages, Storage } from './runtime/services' export type { SettingItem } from './runtime/setting' export type { SubtitleCue, SubtitleOption } from './runtime/subtitle' export type { Icons, Template } from './runtime/template' export type { Utils } from './runtime/utils' export type PluginFactory = FactoryView export interface OptionInput extends Omit, 'plugins' | 'proxy' | 'customType' | 'layers' | 'controls' | 'contextmenu'> { plugins?: PluginFactory[] proxy?: (this: ProxyHost, art: ProxyHost) => MediaSurface customType?: Record unknown) | undefined> layers?: ComponentInput[] controls?: ControlInput[] contextmenu?: ComponentInput[] } export interface Option extends OptionView {} export interface Component extends ComponentView {} export interface Controls extends ControlsView {} export interface Setting extends SettingView {} export interface Subtitle extends SubtitleView, Omit {} export interface Notice extends NoticeView { art: Artplayer } /** Augment with installed results. Factories are not wrapped or converted. */ export interface PluginAdd { (plugin: FactoryView): PluginRegistration (plugin: LegacyPluginFactory): PluginRegistration } type LegacyPluginResults = { [Name in keyof LegacyPlugins as string extends Name ? never : number extends Name ? never : Name extends keyof PluginsView ? never : Name]: LegacyPlugins[Name] } export interface Plugins extends Omit, 'add'>, LegacyPluginResults { add: PluginAdd [name: string]: unknown } /** Public view of the existing constructor; this interface emits no runtime fields. */ interface Artplayer extends Player, Emitter { constructor: ArtplayerConstructor id: number option: Option isLock: boolean isReady: boolean isFocus: boolean isInput: boolean isRotate: boolean isDestroy: boolean flv?: unknown m3u8?: unknown hls?: unknown ts?: unknown mpd?: unknown torrent?: unknown template: Template events: EventRegistry storage: Storage icons: Icons i18n: I18n notice: Notice /** The descriptor installer has no public instance members. */ player: object layers: Component controls: Controls contextmenu: Component & { init: () => void } subtitle: Subtitle info: Component & { init: () => void } loading: Component hotkey: Hotkey mask: Component setting: Setting plugins: Plugins readonly query: Template['query'] readonly proxy: EventRegistry['proxy'] readonly video: MediaSurface reset: () => void destroy: (removeHtml?: boolean) => void } type StaticOptions = Pick>> export interface ArtplayerConstructor extends StaticOptions { new (option: OptionInput, readyCallback?: (this: Artplayer, art: Artplayer) => unknown): Artplayer new (option: LegacyOptionInput, readyCallback?: (this: Artplayer, art: Artplayer) => unknown): Artplayer readonly prototype: Artplayer readonly instances: Artplayer[] readonly version: string readonly config: Config readonly utils: Utils readonly scheme: Record readonly Emitter: new >(...args: unknown[]) => Emitter readonly validator: (option: T, scheme: Scheme, paths?: ValidatorPath) => T readonly kindOf: (value: unknown) => string readonly html: string readonly option: Option } // eslint-disable-next-line ts/no-redeclare -- One existing constructor value and its instance view. declare const Artplayer: ArtplayerConstructor export default Artplayer