Newer
Older
export interface Unit {
pages: UnitPage[];
}
export interface UnitPage {
sections: UnitPageSection[];
width: number;
backgroundColor: string;
}
export interface UnitPageSection {
elements: UnitUIElement[];
width: number;
height: number;
backgroundColor: string;
}
export interface UnitUIElement {
[index: string]: string | number | boolean | string[],
type: string; // TODO maybe use enum or manual enumeration, because possible values are known
id: string;
xPosition: number;
yPosition: number;
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
76
77
78
79
80
width: number;
height: number;
backgroundColor: string;
fontColor: string;
font: string;
fontSize: number;
bold: boolean;
italic: boolean;
underline: boolean;
}
export interface CompoundElementCorrection extends UnitUIElement {
text: string;
sentences : string[];
}
export interface LabelElement extends UnitUIElement {
label: string;
}
export interface ButtonElement extends UnitUIElement {
label: string;
}
export interface TextFieldElement extends UnitUIElement {
placeholder: string;
multiline: boolean;
}
export interface CheckboxElement extends UnitUIElement {
label: string;
}
export interface DropdownElement extends UnitUIElement {
label: string;
options: string[];
}
export interface RadioButtonGroupElement extends UnitUIElement {
text: string;
options: string[];
alignment: 'row' | 'column';
}
export interface ImageElement extends UnitUIElement {
src: string;
}
export interface AudioElement extends UnitUIElement {
src: string;
}
export interface VideoElement extends UnitUIElement {
src: string;
}