mirror of
https://github.com/the1812/Bilibili-Evolved.git
synced 2025-11-04 21:22:45 +08:00
26 lines
571 B
TypeScript
26 lines
571 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)
|
|
}
|
|
}
|