-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathcustom-json.d.ts
65 lines (54 loc) · 1.33 KB
/
custom-json.d.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
/**
* This file is used to define the types for the results.json and questions.json files
* Mainly to prevent code editor from loading typing from json files which is can be very heavy
*/
type Question = {
label: string;
choices: string[];
multiple: boolean | null;
required: boolean | null;
};
type QuestionMap = {
[key: string]: Question;
};
type Results = {
results: {
[key: string]: number | number[] | string | string[] | null | undefined;
}[];
};
// 2020
declare module "@/results/2020/data/results.json" {
const value: Results;
export default value;
}
declare module "@/results/2020/data/questions.json" {
const value: QuestionMap;
export default value;
}
// 2021
declare module "@/results/2021/data/results.json" {
const value: Results;
export default value;
}
declare module "@/results/2021/data/questions.json" {
const value: QuestionMap;
export default value;
}
// 2022
declare module "@/results/2022/data/results.json" {
const value: Results;
export default value;
}
declare module "@/results/2022/data/questions.json" {
const value: QuestionMap;
export default value;
}
// 2023
declare module "@/results/2023/data/results.json" {
const value: Results;
export default value;
}
declare module "@/results/2023/data/questions.json" {
const value: QuestionMap;
export default value;
}