You've already forked bilibili-subtitle
init
This commit is contained in:
106
src/typings.d.ts
vendored
Normal file
106
src/typings.d.ts
vendored
Normal file
@@ -0,0 +1,106 @@
|
||||
interface EnvData {
|
||||
autoExpand?: boolean
|
||||
flagDot?: boolean
|
||||
apiKey?: string
|
||||
serverUrl?: string
|
||||
translateEnable?: boolean
|
||||
language?: string
|
||||
hideOnDisableAutoTranslate?: boolean
|
||||
transDisplay?: 'target' | 'originPrimary' | 'targetPrimary'
|
||||
fetchAmount?: number
|
||||
summarizeEnable?: boolean
|
||||
summarizeLanguage?: string
|
||||
words?: number
|
||||
summarizeFloat?: boolean
|
||||
theme?: 'system' | 'light' | 'dark'
|
||||
fontSize?: 'normal' | 'large'
|
||||
}
|
||||
|
||||
interface TaskDef {
|
||||
type: 'chatComplete'
|
||||
serverUrl?: string
|
||||
data: any
|
||||
extra?: any
|
||||
}
|
||||
|
||||
interface Task {
|
||||
id: string
|
||||
startTime: number
|
||||
endTime?: number
|
||||
def: TaskDef
|
||||
|
||||
status: 'pending' | 'running' | 'done'
|
||||
error?: string
|
||||
resp?: any
|
||||
}
|
||||
|
||||
interface TransResult {
|
||||
// idx: number
|
||||
code?: '200' | '500'
|
||||
data?: string
|
||||
}
|
||||
|
||||
type ShowElement = string | JSX.Element | undefined
|
||||
|
||||
interface Transcript {
|
||||
body: TranscriptItem[]
|
||||
}
|
||||
|
||||
interface TranscriptItem {
|
||||
from: number
|
||||
to: number
|
||||
content: string
|
||||
|
||||
idx: number
|
||||
}
|
||||
|
||||
interface Segment {
|
||||
items: TranscriptItem[]
|
||||
startIdx: number // 从1开始
|
||||
endIdx: number
|
||||
text: string
|
||||
fold?: boolean
|
||||
summaries: {
|
||||
[type: string]: Summary
|
||||
}
|
||||
}
|
||||
|
||||
interface OverviewItem {
|
||||
time: string
|
||||
emoji: string
|
||||
key: string
|
||||
}
|
||||
|
||||
interface Summary {
|
||||
type: SummaryType
|
||||
|
||||
status: SummaryStatus
|
||||
error?: string
|
||||
content?: any
|
||||
}
|
||||
|
||||
/**
|
||||
* 概览
|
||||
*/
|
||||
interface OverviewSummary extends Summary {
|
||||
content?: OverviewItem[]
|
||||
}
|
||||
|
||||
/**
|
||||
* 要点
|
||||
*/
|
||||
interface KeypointSummary extends Summary {
|
||||
content?: string[]
|
||||
}
|
||||
|
||||
/**
|
||||
* 总结
|
||||
*/
|
||||
interface BriefSummary extends Summary {
|
||||
content?: {
|
||||
summary: string
|
||||
}
|
||||
}
|
||||
|
||||
type SummaryStatus = 'init' | 'pending' | 'done'
|
||||
type SummaryType = 'overview' | 'keypoint' | 'brief'
|
Reference in New Issue
Block a user