feat:重构代码
This commit is contained in:
26
src/types.ts
26
src/types.ts
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user