From c4537ca1b01c63f8bf9556bb06dc669b768c1eea Mon Sep 17 00:00:00 2001 From: sora-ext Date: Mon, 24 Feb 2025 15:14:19 +0100 Subject: [PATCH] Add src/types/format.ts --- src/types/format.ts | 54 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 src/types/format.ts diff --git a/src/types/format.ts b/src/types/format.ts new file mode 100644 index 0000000..ab7b6b1 --- /dev/null +++ b/src/types/format.ts @@ -0,0 +1,54 @@ +declare global { + interface map { + zoom: number + center: { + lat: number + lng: number + } + } + + interface geoloc { + latlon: [number, number] + notes: string + } + + interface leg { + title: string + step_title: string[] + date_range: [Date, Date] | null + map: map + travel: unknown[] + hotel: geoloc | null + places: { + restaurants: geoloc[] + places: geoloc[] + } + notes: string + } + + interface journey { + title: string + name: string | null + main: leg[] + } +} + +const journey_template: journey = { + title: "New Journey", + name: null, + main: [], +} + +const leg_template: leg = { + title: "New Leg", + step_title: [], + map: { zoom: 2, center: { lng: 0, lat: 0 } }, + travel: [], + hotel: null, + places: { restaurants: [], places: [] }, + notes: "", + date_range: null +} + +export { map, geoloc, leg, journey } +export { journey_template, leg_template } \ No newline at end of file