From ce392ac56c0145f3c57c1d1275cde70b93c49d8f Mon Sep 17 00:00:00 2001 From: zyronon Date: Tue, 29 Aug 2023 00:58:32 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E6=96=B0=E8=AE=BE=E8=AE=A1=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/types.ts | 33 ++++++++++++--------------------- 1 file changed, 12 insertions(+), 21 deletions(-) diff --git a/src/types.ts b/src/types.ts index 90a2f709..06dae742 100644 --- a/src/types.ts +++ b/src/types.ts @@ -79,9 +79,7 @@ export type SoundResource = { filename: string } - export interface DictJson { - name: string, description: string, category: string, tags: string[], @@ -100,32 +98,26 @@ export enum DictType { custom = 'custom', } -export interface Dict extends DictJson { +export interface Dict { + name: string, sort: Sort, type: DictType, - wordList: Word[], + originWords: Word[],//原始单词 chapterList: Word[][], chapterIndex: number, + words: Word[], wordIndex: number, - chapterWordNumber: number, - dictStatistics: DictStatistics[], - statistics?: Statistics -} - - -export interface DictStatistics { - startDate: number,//开始日期 - endDate: number//结束日期 - chapterWordNumber: number//章节单词数量 - statistics: Array + chapterWordNumber: number,//章节单词数量 + statistics: Statistics[] } export interface Statistics { startDate: number,//开始日期 endDate: number//结束日期 - chapterWordNumber: number//章节单词数量 + spend: number,//花费时间 + wordNumber: number//单词数量 correctRate: number//正确率 - wrongNumber: number//错误数 + wrongWordNumber: number//错误数 } export enum Sort { @@ -137,15 +129,14 @@ export enum Sort { export interface State { newWordDict: Dict, skipWordDict: Dict, - allWrongDict: Dict, - currentWrongDict: Dict, + wrongWordDict: Dict, dict: Dict, oldDicts: Dict[], current: { - dictType:DictType, + dictType: DictType, words: Word[], wrongWords: Word[], - repeatNumber:number, + repeatNumber: number, statistics: Statistics }, sideIsOpen: boolean,