save
This commit is contained in:
64
src/types.ts
64
src/types.ts
@@ -3,11 +3,73 @@ export type Config = {
|
||||
skipWords: Word[],
|
||||
skipWordNames: string[],
|
||||
dict: string,
|
||||
currentDict: {
|
||||
wordList: Word[],
|
||||
chapterList: Word[][],
|
||||
name: string,
|
||||
desc: string
|
||||
}
|
||||
chapterIndex: number,
|
||||
wordIndex: number,
|
||||
}
|
||||
export type Word = { "name": string, "usphone": string, "ukphone": string, "trans": string[] }
|
||||
export type Word = {"name": string, "usphone": string, "ukphone": string, "trans": string[]}
|
||||
|
||||
export const SaveKey = 'bb-word-config'
|
||||
|
||||
export const PronunciationApi = 'https://dict.youdao.com/dictvoice?audio='
|
||||
|
||||
export type PronunciationType = 'us' | 'uk' | 'romaji' | 'zh' | 'ja' | 'de'
|
||||
export type PhoneticType = 'us' | 'uk' | 'romaji' | 'zh' | 'ja' | 'de'
|
||||
export type LanguageType = 'en' | 'romaji' | 'zh' | 'ja' | 'code' | 'de'
|
||||
export type LanguageCategoryType = 'en' | 'ja' | 'de' | 'code'
|
||||
|
||||
|
||||
export type DictionaryResource = {
|
||||
id: string
|
||||
name: string
|
||||
description: string
|
||||
category: string
|
||||
tags: string[]
|
||||
url: string
|
||||
length: number
|
||||
language: LanguageType
|
||||
languageCategory: LanguageCategoryType
|
||||
//override default pronunciation when not undefined
|
||||
defaultPronIndex?: number
|
||||
}
|
||||
|
||||
export type Dictionary = {
|
||||
id: string
|
||||
name: string
|
||||
description: string
|
||||
category: string
|
||||
tags: string[]
|
||||
url: string
|
||||
length: number
|
||||
language: LanguageType
|
||||
languageCategory: LanguageCategoryType
|
||||
// calculated in the store
|
||||
chapterCount: number
|
||||
//override default pronunciation when not undefined
|
||||
defaultPronIndex?: number
|
||||
}
|
||||
|
||||
export type PronunciationConfig = {
|
||||
name: string
|
||||
pron: PronunciationType
|
||||
}
|
||||
|
||||
export type LanguagePronunciationMapConfig = {
|
||||
defaultPronIndex: number
|
||||
pronunciation: PronunciationConfig[]
|
||||
}
|
||||
|
||||
export type LanguagePronunciationMap = {
|
||||
[key in LanguageType]: LanguagePronunciationMapConfig
|
||||
}
|
||||
|
||||
export type SoundResource = {
|
||||
key: string
|
||||
name: string
|
||||
filename: string
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user