-
Notifications
You must be signed in to change notification settings - Fork 60
/
Copy pathtypings.d.ts
119 lines (100 loc) · 1.85 KB
/
typings.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
interface EnvData {
autoExpand?: boolean
flagDot?: boolean
apiKey?: string
serverUrl?: string
model?: 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'
// search
searchEnabled?: boolean
cnSearchEnabled?: boolean
prompts?: {
[key: string]: string
}
}
interface TempData {
curSummaryType: SummaryType
}
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'