FluentReader/src/schema-types.ts

52 lines
1.1 KiB
TypeScript
Raw Normal View History

2020-06-29 19:17:33 +08:00
export class SourceGroup {
isMultiple: boolean
sids: number[]
name?: string
expanded?: boolean
index?: number // available only from groups tab container
constructor(sids: number[], name: string = null) {
name = (name && name.trim()) || "订阅源组"
if (sids.length == 1) {
this.isMultiple = false
} else {
this.isMultiple = true
this.name = name
this.expanded = true
}
this.sids = sids
}
}
2020-07-17 13:01:29 +08:00
export const enum ViewType {
Cards, List, Magazine, Compact, Customized
2020-06-29 19:17:33 +08:00
}
2020-07-17 13:01:29 +08:00
export const enum ThemeSettings {
2020-06-29 19:17:33 +08:00
Default = "system",
Light = "light",
Dark = "dark"
}
2020-07-21 12:12:12 +08:00
export const enum SearchEngines {
Google, Bing, Baidu, DuckDuckGo
}
2020-07-25 21:42:24 +08:00
export const enum ImageCallbackTypes {
2020-07-26 19:42:44 +08:00
OpenExternal, OpenExternalBg, SaveAs, Copy, CopyLink
2020-07-25 21:42:24 +08:00
}
2020-06-29 19:17:33 +08:00
export type SchemaTypes = {
version: string
theme: ThemeSettings
pac: string
pacOn: boolean
view: ViewType
locale: string
sourceGroups: SourceGroup[]
fontSize: number
menuOn: boolean
2020-07-10 12:56:58 +08:00
fetchInterval: number
2020-07-21 12:12:12 +08:00
searchEngine: SearchEngines
2020-06-29 19:17:33 +08:00
}