blob: a97d07d43f3117d3411cd1b03d56ff813265a2c7 (
plain) (
blame)
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
187
188
189
190
191
192
193
|
export type ProfileBand = "downhill" | "0-3" | "3-6" | "6-9" | "9-plus";
export type BoundaryTarget = "start" | "end";
export type BoundarySource = "profile" | "map";
// ProfileSectionPayload is one step of a climb profile as the server cuts it.
export interface ProfileSectionPayload {
startKm: number;
endKm: number;
startElevationM: number;
endElevationM: number;
slopePercent: number;
}
// OfficialProfileSection is that step tagged with the colour band its slope falls in.
export interface OfficialProfileSection {
startDistanceKm: number;
endDistanceKm: number;
startElevation: number;
endElevation: number;
slopePercent: number;
band: ProfileBand;
}
export interface ProfilePoint {
distanceKm: number;
elevationM: number;
}
export interface RideProfilePoint extends ProfilePoint {
index: number;
latitude: number;
longitude: number;
}
export interface RideProfileClimb {
index: number;
startKm: number;
endKm: number;
topKm: number;
topElevationM: number;
name: string;
category: string;
distanceKm: number;
slopePercent: number;
cotacol: number;
officialClimbId?: number;
officialName?: string;
startIndex: number;
endIndex: number;
sections?: ProfileSectionPayload[];
}
export interface RideProfileCrossing {
distanceKm: number;
passElevationM: number;
rideElevationM: number;
distanceToM: number;
elevationDiffM: number;
name: string;
}
export interface RideProfile {
points: RideProfilePoint[];
climbs: RideProfileClimb[];
crossings: RideProfileCrossing[];
}
export interface RideRoute {
type: "FeatureCollection";
features: RideRouteFeature[];
}
export interface RideRouteFeature {
type: "Feature";
geometry: {
type: "LineString";
coordinates: [number, number][];
};
properties?: Record<string, unknown>;
}
export interface RideMapPass {
name: string;
elevationM: number;
latitude: number;
longitude: number;
category: string;
}
export interface ClimbBounds {
startIndex: number;
endIndex: number;
}
export interface ClimbMetrics {
start: ProfilePoint;
end: ProfilePoint;
distanceKm: number;
elevationGain: number;
slope: number;
cotacol: number;
category: string;
}
export interface ClimbSample {
distanceM: number;
elevationGainM: number;
}
export interface OfficialProfileColors {
downhill: string;
"0-3": string;
"3-6": string;
"6-9": string;
"9-plus": string;
plotSurface: string;
grid: string;
xGrid: string;
yGrid: string;
subtle: string;
accent: string;
}
export interface RideProfileColors {
subtle: string;
plotSurface: string;
grid: string;
forest: string;
plotSurfaceOverlay: string;
accentFill: string;
profileFill: string;
profileLine: string;
climbLabel: string;
crossing: string;
crossingLabel: string;
hoverLine: string;
climbFocusFill: string;
}
export interface RideMapColors {
accent: string;
forest: string;
climbRoute: string;
}
export interface AnalyticsPoint {
id: number;
name: string;
url: string;
speedKmh: number;
cotacolPer100Km: number;
movingHours: number;
rideType: string;
bikeType: string;
year: number;
}
export interface ClimbAttemptPoint {
durationS: number;
averagePowerW: number;
date: string;
rideName: string;
url: string;
}
export interface RateLimit {
limit15: number;
usage15: number;
limitDaily: number;
usageDaily: number;
}
export interface RateLimitSnapshot {
read: RateLimit;
overall: RateLimit;
}
export interface SyncProgress {
total: number;
completed: number;
imported: number;
skipped: number;
updated: number;
rateLimit?: RateLimitSnapshot;
}
export interface SyncErrorEvent {
message: string;
progress?: SyncProgress;
retryAfter?: string;
isRateLimited?: boolean;
rateLimit?: RateLimitSnapshot;
}
|