mirror of
https://github.com/the1812/Bilibili-Evolved.git
synced 2025-11-04 21:22:45 +08:00
28 lines
578 B
TypeScript
28 lines
578 B
TypeScript
import { DanmakuType } from './danmaku-type'
|
|
|
|
export interface BasicDanmakuData {
|
|
content: string
|
|
time: string
|
|
type: string
|
|
fontSize: string
|
|
color: string
|
|
}
|
|
export class Danmaku {
|
|
content: string
|
|
time: string
|
|
startTime: number
|
|
type: DanmakuType
|
|
fontSize: number
|
|
color: number
|
|
constructor({
|
|
content, time, type, fontSize, color,
|
|
}: BasicDanmakuData) {
|
|
this.content = content
|
|
this.time = time
|
|
this.startTime = parseFloat(time)
|
|
this.type = parseInt(type)
|
|
this.fontSize = parseFloat(fontSize)
|
|
this.color = parseInt(color)
|
|
}
|
|
}
|