Add typing

This commit is contained in:
2026-02-10 22:05:49 +00:00
parent a458cc5e76
commit 4cc6140d86

View File

@@ -1,5 +1,14 @@
import type { PageLoad } from './$types'; import type { PageLoad } from './$types';
export interface RouteMapIndex {
routeId: string | number;
routeStart: string;
routeEnd: string;
created: string;
checked: string;
contents: string[];
}
export const load: PageLoad = async ({ fetch }) => { export const load: PageLoad = async ({ fetch }) => {
const response = await fetch('map-index.json'); const response = await fetch('map-index.json');
@@ -12,6 +21,6 @@ export const load: PageLoad = async ({ fetch }) => {
return { return {
maps: maps.sort((a: any, b: any) => { maps: maps.sort((a: any, b: any) => {
return Number(a.routeId) - Number(b.routeId); return Number(a.routeId) - Number(b.routeId);
}) }) as RouteMapIndex[]
}; };
}; };