diff --git a/src/routes/[slug]/[[timestamp]]/download/+server.js b/src/routes/[slug]/[[timestamp]]/download/+server.ts
similarity index 89%
rename from src/routes/[slug]/[[timestamp]]/download/+server.js
rename to src/routes/[slug]/[[timestamp]]/download/+server.ts
index 2547d86..b79febc 100644
--- a/src/routes/[slug]/[[timestamp]]/download/+server.js
+++ b/src/routes/[slug]/[[timestamp]]/download/+server.ts
@@ -2,9 +2,9 @@ import { getMetadata } from '$lib/util/album';
import { getZipName } from '$lib/util/links';
import { error } from '@sveltejs/kit';
import fs from 'node:fs/promises';
+import type { RequestHandler } from './$types';
-/** @type {import('./$types').RequestHandler} */
-export async function GET({ params, url }) {
+export const GET: RequestHandler = async ({ params, url }) => {
try {
const zipName = getZipName(params);
const album = await getMetadata(zipName);
diff --git a/src/routes/[slug]/[[timestamp]]/i/[...item]/+page.server.js b/src/routes/[slug]/[[timestamp]]/i/[...item]/+page.server.ts
similarity index 74%
rename from src/routes/[slug]/[[timestamp]]/i/[...item]/+page.server.js
rename to src/routes/[slug]/[[timestamp]]/i/[...item]/+page.server.ts
index bc30add..a1a3020 100644
--- a/src/routes/[slug]/[[timestamp]]/i/[...item]/+page.server.js
+++ b/src/routes/[slug]/[[timestamp]]/i/[...item]/+page.server.ts
@@ -1,8 +1,8 @@
import { getMetadata } from '$lib/util/album';
-import { getFileName, getFilePath, getZipName } from '$lib/util/links.js';
+import { getFileName, getFilePath, getZipName } from '$lib/util/links';
+import type { PageServerLoad } from './$types';
-/** @type {import('./$types').PageLoad} */
-export async function load({ params }) {
+export const load: PageServerLoad = async ({ params }) => {
const album = await getMetadata(getZipName(params));
const filePath = getFilePath(params.item);
const item = album.items.find(item => item.item === filePath);
diff --git a/src/routes/[slug]/[[timestamp]]/i/[...item]/+page.svelte b/src/routes/[slug]/[[timestamp]]/i/[...item]/+page.svelte
index 13fcbc6..a1382f0 100644
--- a/src/routes/[slug]/[[timestamp]]/i/[...item]/+page.svelte
+++ b/src/routes/[slug]/[[timestamp]]/i/[...item]/+page.svelte
@@ -1,8 +1,8 @@
-
diff --git a/src/routes/[slug]/[[timestamp]]/i/[...item]/download/+server.js b/src/routes/[slug]/[[timestamp]]/i/[...item]/download/+server.ts
similarity index 90%
rename from src/routes/[slug]/[[timestamp]]/i/[...item]/download/+server.js
rename to src/routes/[slug]/[[timestamp]]/i/[...item]/download/+server.ts
index d5c2dc9..65538bd 100644
--- a/src/routes/[slug]/[[timestamp]]/i/[...item]/download/+server.js
+++ b/src/routes/[slug]/[[timestamp]]/i/[...item]/download/+server.ts
@@ -1,9 +1,9 @@
import { getMetadataAndFile } from '$lib/util/album';
import { getZipName, getFileName, getFilePath } from '$lib/util/links';
import { error } from '@sveltejs/kit';
+import type { RequestHandler } from './$types';
-/** @type {import('./$types').RequestHandler} */
-export async function GET({ params }) {
+export const GET: RequestHandler = async ({ params }) => {
try {
const {album, content} = await getMetadataAndFile(getZipName(params), getFilePath(params.item));
const allowDownload = album.allowDownload === false ? false : true;
diff --git a/src/routes/[slug]/[[timestamp]]/i/[...item]/t/[[width]]/+server.js b/src/routes/[slug]/[[timestamp]]/i/[...item]/t/[[width]]/+server.ts
similarity index 88%
rename from src/routes/[slug]/[[timestamp]]/i/[...item]/t/[[width]]/+server.js
rename to src/routes/[slug]/[[timestamp]]/i/[...item]/t/[[width]]/+server.ts
index 9ac6fb4..9b271bd 100644
--- a/src/routes/[slug]/[[timestamp]]/i/[...item]/t/[[width]]/+server.js
+++ b/src/routes/[slug]/[[timestamp]]/i/[...item]/t/[[width]]/+server.ts
@@ -2,9 +2,10 @@ import { getFile } from '$lib/util/album';
import { getFileName, getFilePath, getZipName } from '$lib/util/links';
import { error } from '@sveltejs/kit';
import sharp from 'sharp';
+import type { RequestHandler } from './$types';
-/** @type {import('./$types').RequestHandler} */
-export async function GET({ params }) {
+/** @type {RequestHandler} */
+export const GET: RequestHandler = async ({ params }) => {
let thumbnail = null;
console.log(`Getting thumbnail for ${params}`);
let width = 400;
@@ -24,7 +25,7 @@ export async function GET({ params }) {
}
}
thumbnail = thumbnail || await sharp(content).resize(width).webp({ quality: 90 }).toBuffer();
- } catch (err) {
+ } catch (err: any) {
console.error(`${/** @type {Error} */(err).stack}`.replaceAll('/home/sveltekit', '.'));
throw error(500, 'Error getting thumbnail');
}
diff --git a/src/routes/[slug]/[[timestamp]]/random/+server.js b/src/routes/[slug]/[[timestamp]]/random/+server.ts
similarity index 83%
rename from src/routes/[slug]/[[timestamp]]/random/+server.js
rename to src/routes/[slug]/[[timestamp]]/random/+server.ts
index 35b23fe..5856dfc 100644
--- a/src/routes/[slug]/[[timestamp]]/random/+server.js
+++ b/src/routes/[slug]/[[timestamp]]/random/+server.ts
@@ -1,8 +1,9 @@
import StreamZip from 'node-stream-zip';
import sharp from 'sharp';
+import type { RequestHandler } from './$types';
-/** @type {import('./$types').RequestHandler} */
-export async function GET({ params }) {
+/** @type {RequestHandler} */
+export const GET: RequestHandler = async ({ params }) => {
let entryData = null;
try {
diff --git a/static/vime.svelte b/static/vime.svelte
index 7bc0647..89ad5a8 100644
--- a/static/vime.svelte
+++ b/static/vime.svelte
@@ -1,4 +1,4 @@
-
diff --git a/jsconfig.json b/tsconfig.json
similarity index 100%
rename from jsconfig.json
rename to tsconfig.json