feat: 更新类型定义,简化导入路径

This commit is contained in:
Harvey Zack committed 2025-08-17 10:55:33 +08:00
1 parent 8b32f050a0
commit 012dde8da4
2 files changed
+13 -9

No files matched your search

@@ -1,19 +1,23 @@
import type Artplayer from 'artplayer' import type Artplayer from 'artplayer'
type Mode = 0 | 1 | 2 export type Mode = 0 | 1 | 2
type Danmuku = Danmu[] | string | (() => Promise<Danmu[]>) | Promise<Danmu[]> export type Danmuku
= | Danmu[]
| string // URL
| (() => Promise<Danmu[]>)
| Promise<Danmu[]>
interface Slider { export interface Slider {
min?: number min?: number
max?: number max?: number
steps?: { steps?: {
name?: string name?: string
value?: any value?: number | string
show?: boolean show?: boolean
}[] }[]
} }
interface Danmu { export interface Danmu {
/** /**
* 弹幕文本 * 弹幕文本
*/ */
@@ -45,7 +49,7 @@ interface Danmu {
style?: Partial<CSSStyleDeclaration> style?: Partial<CSSStyleDeclaration>
} }
interface Option { export interface Option {
/** /**
* 弹幕数据: 函数,数组,Promise,URL * 弹幕数据: 函数,数组,Promise,URL
*/ */
@@ -127,7 +131,7 @@ interface Option {
/** /**
* 热力图数据 * 热力图数据
*/ */
points?: any[] points?: { time: number, value: number }[]
/** /**
* 弹幕载入前的过滤器,只支持返回布尔值 * 弹幕载入前的过滤器,只支持返回布尔值
@@ -195,7 +199,7 @@ interface Option {
COLOR?: string[] COLOR?: string[]
} }
interface Result { export interface Result {
name: 'artplayerPluginDanmuku' name: 'artplayerPluginDanmuku'
/** /**
+1 -1
View File
@@ -1,5 +1,5 @@
import Artplayer from '../packages/artplayer' import Artplayer from '../packages/artplayer'
import artplayerPluginDanmuku from '../packages/artplayer-plugin-danmuku/types/artplayer-plugin-danmuku' import artplayerPluginDanmuku from '../packages/artplayer-plugin-danmuku'
const art = new Artplayer({ const art = new Artplayer({
container: '.artplayer-app', container: '.artplayer-app',