-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
186 lines (163 loc) · 5.06 KB
/
types.ts
File metadata and controls
186 lines (163 loc) · 5.06 KB
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
export type StopType = 'audio' | 'text' | 'image-text' | '3d-object' | 'video' | 'headline' | 'rating' | 'email' | 'quote' | 'image-gallery' | 'image-comparison' | 'hotspot-image' | 'embed';
export type OfflineMode = 'online-only' | 'optional' | 'offline-only';
/**
* Tour metadata - shared properties across all language versions
* These can be overridden in individual language files
*/
export interface TourMetadata {
id: string;
defaultLanguage?: string;
offlineMode?: OfflineMode;
transitionAudio?: string;
themeId?: string;
transcriptAvailable?: boolean;
collectFeedback?: boolean;
image?: string;
showLanguageLabel?: boolean; // Show language name next to flag in selector (default: true)
showStopImage?: boolean | 'thumbnail'; // Show stop image: true=full card, false=list, 'thumbnail'=compact with thumbnail (default: true)
showStopDuration?: boolean; // Show duration on cards (default: true)
showStopNumber?: boolean; // Show number indicator (default: true)
fullscreenPlayer?: boolean; // Show fullscreen player on stop click (default: false)
showProgressBar?: boolean; // Show progress bar in tour header (default: true)
backgroundColor?: string; // Solid color for the iOS status bar area and TourStart background when no image (e.g. '#1a2634')
}
export interface BaseStop {
id: string;
type: StopType;
}
export interface AudioStop extends BaseStop {
type: 'audio';
title: string;
duration: string;
isCompleted: boolean;
isPlaying?: boolean;
image: string;
imageAlt?: string;
imageCaption?: string;
imageCredit?: string;
audioFile?: string;
transcription?: string;
content?: string;
}
export interface TextStop extends BaseStop {
type: 'text';
title?: string;
content?: string;
}
export interface ImageTextStop extends BaseStop {
type: 'image-text';
title?: string;
image: string;
imageAlt?: string;
imageCaption?: string;
imageCredit?: string;
content?: string;
}
export interface ThreeDObjectStop extends BaseStop {
type: '3d-object';
modelUrl: string;
caption?: string;
}
export interface VideoStop extends BaseStop {
type: 'video';
videoUrl: string;
caption?: string;
}
export interface HeadlineStop extends BaseStop {
type: 'headline';
text: string;
}
export interface RatingStop extends BaseStop {
type: 'rating';
question?: string;
description?: string;
}
export interface EmailStop extends BaseStop {
type: 'email';
title?: string;
description?: string;
placeholder?: string;
buttonText?: string;
}
export interface QuoteStop extends BaseStop {
type: 'quote';
quote: string;
author: string;
year?: string;
}
export interface GalleryImage {
url: string;
alt?: string;
caption?: string;
credit?: string;
}
export interface ImageGalleryStop extends BaseStop {
type: 'image-gallery';
images: GalleryImage[];
caption?: string;
}
export interface ImageComparisonStop extends BaseStop {
type: 'image-comparison';
before: string;
after: string;
beforeLabel?: string;
afterLabel?: string;
caption?: string;
}
export interface Hotspot {
x: number;
y: number;
title: string;
description?: string;
}
export interface HotspotImageStop extends BaseStop {
type: 'hotspot-image';
image: string;
imageAlt?: string;
hotspots: Hotspot[];
caption?: string;
}
export interface EmbedStop extends BaseStop {
type: 'embed';
embedUrl: string;
embedType?: 'youtube' | 'spotify' | 'video' | 'generic';
aspectRatio?: string;
caption?: string;
}
export type Stop = AudioStop | TextStop | ImageTextStop | ThreeDObjectStop | VideoStop | HeadlineStop | RatingStop | EmailStop | QuoteStop | ImageGalleryStop | ImageComparisonStop | HotspotImageStop | EmbedStop;
export interface TourData {
id: string;
language: string;
title: string;
description: string;
totalDuration: string;
totalStops: number;
stops: Stop[];
image?: string;
offlineMode?: OfflineMode;
transitionAudio?: string;
themeId?: string; // Optional theme ID for custom branding
transcriptAvailable?: boolean;
collectFeedback?: boolean; // Show rating button on main screen (default: true)
showLanguageLabel?: boolean; // Show language name next to flag in selector (default: true)
showStopImage?: boolean | 'thumbnail'; // Show stop image: true=full card, false=list, 'thumbnail'=compact with thumbnail (default: true)
showStopDuration?: boolean; // Show duration on cards (default: true)
showStopNumber?: boolean; // Show number indicator (default: true)
fullscreenPlayer?: boolean; // Show fullscreen player on stop click (default: false)
showProgressBar?: boolean; // Show progress bar in tour header (default: true)
backgroundColor?: string; // Solid color for the iOS status bar area and TourStart background when no image (e.g. '#1a2634')
}
export interface Language {
code: string;
name: string;
flag: string;
countryCode: string;
}
export interface TourRating {
tourId: string;
rating: number;
feedback: string;
email: string;
submittedAt: string;
}
export type SheetType = 'NONE' | 'LANGUAGE' | 'RATING' | 'PLAYER_MINIMIZED' | 'TOUR_COMPLETE';