-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.d.ts
65 lines (57 loc) · 1.29 KB
/
types.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
type ModuleInfo = {
module_id: number;
abbreviation: string;
name: string;
description: string;
corpora: string[];
language: string;
versification_schema: string;
versification_schema_id: number;
license: string;
url: string;
};
type ModuleJson = {
abbreviation: string;
name: string;
description: string;
corpora: string[];
language: string;
versification_schema: string;
license: string;
url: string;
};
type ModuleJsonError = boolean;
type ValidatedModuleJson = [
ModuleJson | null,
ModuleJsonError,
];
type ValidModules = ModuleJson & {
pathToData: string;
wordFeatures: string[];
};
type Alignments = {
[versificationSchema: string]: {
[rid: number]: number;
};
};
type WordFeatures = string[];
type ModuleDataError = boolean;
// TODO: Verify typing. I'm not sure if this "|" is the right way to do this. It makes the errors go away, but I'm unconvinced it correctly defines the type.
type WordFeaturesObject = {
module_id: number;
parallel_id: number;
} | {
[feature: string]: string;
};
type ValidatedModuleData = [
WordFeatures | null,
ModuleDataError,
];
type VerseText = {
parallel_id: number;
versification_schema_id: number;
module_id: number;
rid: number;
text: string;
};
type VersificationSchema = "kjv" | "bhs" | "lxx" | "gnt";