2022-11-03 16:27:02 +00:00
|
|
|
import { route } from 'docuri';
|
|
|
|
|
|
|
|
const routes = {
|
|
|
|
dbdef: route('dbdef'),
|
|
|
|
settings: route('settings'),
|
|
|
|
gpx: route('gpx/:gpx'),
|
2022-11-07 21:12:50 +00:00
|
|
|
wpt: route('gpx/:gpx/0wpt/:wpt'),
|
|
|
|
rte: route('gpx/:gpx/1rte/:rte'),
|
|
|
|
rtept: route('gpx/:gpx/1rte/:rte/:rtept'),
|
|
|
|
trk: route('gpx/:gpx/2trk/:trk'),
|
|
|
|
trkseg: route('gpx/:gpx/2trk/:trk/:trkseg'),
|
|
|
|
trkpt: route('gpx/:gpx/2trk/:trk/:trkseg/:trkpt'),
|
2022-11-03 16:27:02 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
type RouteKey = keyof typeof routes;
|
|
|
|
|
|
|
|
const uri = (type: RouteKey, param: any) => {
|
|
|
|
return routes[type](param);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default uri;
|