Add src/types/format.ts
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
sora-ext 2025-02-24 15:14:19 +01:00
parent d295c15504
commit c4537ca1b0

54
src/types/format.ts Normal file
View File

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