feat:重构代码

This commit is contained in:
zyronon
2025-07-16 21:19:40 +08:00
parent 0da1f98308
commit d59bab48fc
272 changed files with 506 additions and 703 deletions

View File

@@ -50,7 +50,7 @@ export type TranslateLanguageType = 'en' | 'zh-CN' | 'ja' | 'de' | 'common' | ''
export type LanguageType = 'en' | 'ja' | 'de' | 'code'
interface Word2 {
export interface Word2 {
word: string,
phonetic0: string,
phonetic1: string,
@@ -74,8 +74,11 @@ interface Word2 {
relWords: {
root: string,
rels: {
word: string,
cn: string,
pos: string,
words: {
c: string,
cn: string,
}[],
}[]
},
etymology: {
@@ -84,6 +87,23 @@ interface Word2 {
}[],
}
export function getDefaultWord2(val?: any): Word2 {
return {
"word": "",
"phonetic0": "",
"phonetic1": "",
"trans": [],
"sentences": [],
"phrases": [],
"synos": [],
"relWords": {
"root": "",
"rels": []
},
"etymology": []
}
}
export type DictResource = {
id: string
name: string