summaryrefslogtreecommitdiff
path: root/web/frontend/types.d.ts
blob: 07c82047c5eada448be1e2cb4870e13f6bdc424c (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
export type ProfileBand = "downhill" | "0-3" | "3-6" | "6-9" | "9-plus";
export type BoundaryTarget = "start" | "end";
export type BoundarySource = "profile" | "map";

export interface ProfilePoint {
  distanceKm: number;
  elevationM: number;
}

export interface RideProfilePoint extends ProfilePoint {
  latitude: number;
  longitude: number;
}

export interface RideProfileClimb {
  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;
}

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;
}

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 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 SyncProgress {
  total: number;
  completed: number;
  imported: number;
  skipped: number;
}

export interface SyncErrorEvent {
  message: string;
  progress?: SyncProgress;
}