Add TimeToLeave feature checklist and plan (50)
Add TimeToLeave feature checklist and plan
This commit is contained in:
@@ -56,6 +56,23 @@ export class ApiClient {
|
||||
return res.json();
|
||||
}
|
||||
|
||||
async getWalkRoute(
|
||||
fromLat: number,
|
||||
fromLng: number,
|
||||
toLat: number,
|
||||
toLng: number,
|
||||
): Promise<BikeRoute> {
|
||||
const url = buildUrl(this.baseUrl, "/api/walk-route", {
|
||||
fromLat: String(fromLat),
|
||||
fromLng: String(fromLng),
|
||||
toLat: String(toLat),
|
||||
toLng: String(toLng),
|
||||
});
|
||||
const res = await fetch(url);
|
||||
if (!res.ok) throw new Error(`Walk route failed: ${res.status}`);
|
||||
return res.json();
|
||||
}
|
||||
|
||||
async fetchCalendar(url: string, days?: number): Promise<CalendarEvent[]> {
|
||||
const params: Record<string, string> = { url };
|
||||
if (days) params.days = String(days);
|
||||
|
||||
@@ -49,6 +49,19 @@ export interface BikeRoute {
|
||||
steps: BikeStep[];
|
||||
}
|
||||
|
||||
export interface WalkRoute {
|
||||
distance: number;
|
||||
duration: number;
|
||||
steps: WalkStep[];
|
||||
}
|
||||
|
||||
export interface WalkStep {
|
||||
name: string;
|
||||
distance: number;
|
||||
duration: number;
|
||||
instruction: string;
|
||||
}
|
||||
|
||||
export interface CountdownInfo {
|
||||
label: string;
|
||||
color: string;
|
||||
@@ -63,6 +76,9 @@ export type CalStatus = null | "loading" | "ok" | "error";
|
||||
export interface ReminderSettings {
|
||||
bufferMinutes: number;
|
||||
enabled: boolean;
|
||||
arrivalBufferMinutes: number; // arrive X minutes before event (default 5)
|
||||
showWalkingOption: boolean; // show walk-from-station option (default true)
|
||||
showBikeOption: boolean; // show bike route section (default true)
|
||||
}
|
||||
|
||||
export type ServerStatus = boolean | null;
|
||||
|
||||
Reference in New Issue
Block a user