-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtype.ts
75 lines (69 loc) · 1.86 KB
/
type.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
declare module "leet-core" {
// topic
export interface Topic {
name: string;
translatedName: string;
}
// question
export interface Question {
title: string;
titleSlug: string;
translatedTitle: string;
questionId: string;
questionFrontendId: string;
topicTags: Topic[];
difficulty: "Easy" | "Medium" | "Hard";
isPaidOnly: boolean; // 是否付费
}
// all question response body
export interface Questions {
data: {
allQuestions: Question[];
};
}
// code snippet
export interface CodeSnippet {
lang: "Java" | "Python3" | "JavaScript";
langSlug: "java" | "python3" | "javascript";
code: string;
}
// question data response dady
export interface QuestionData {
data: {
question: {
questionId: string; // 题目编号
questionFrontendId: string; // 前台使用题目编号
title: string;
titleSlug: string;
content: string;
translatedTitle: string;
isPaidOnly: boolean;
difficulty: "Easy" | "Medium" | "Hard";
likes: number;
dislikes: number;
codeSnippets: CodeSnippet[];
};
};
}
// 题面
export interface Problem {
title: string; // 题目
content: string; // 题干
example: string | string[]; // 题示
note: string | string[]; // 题注
followup: string; // 题参
thinking: string; // 题评
topics: string | string[]; // 题型
submissions: Submission[]; // 题解
}
// 题解
export interface Submission {
name: string; // 标题(所用方法)
info: string; // 答题(说明、思路、总结)
time: string; // 提交时间
status: "Accepted"; // 提交测试情况
runtime: string; // 测试运行时(时间复杂度)
memory: string; // 测试内存占用(空间复杂度)
code: string; // 代码
}
}