diff --git a/src/lib/components/Gallery.svelte b/src/lib/components/Gallery.svelte index 3b6b2d7..9962120 100644 --- a/src/lib/components/Gallery.svelte +++ b/src/lib/components/Gallery.svelte @@ -1,12 +1,13 @@ - diff --git a/src/lib/components/Header.svelte b/src/lib/components/Header.svelte index e7d5062..add0a37 100644 --- a/src/lib/components/Header.svelte +++ b/src/lib/components/Header.svelte @@ -1,10 +1,9 @@ -
diff --git a/src/lib/components/Icon.svelte b/src/lib/components/Icon.svelte index b3d0847..7660f62 100644 --- a/src/lib/components/Icon.svelte +++ b/src/lib/components/Icon.svelte @@ -1,30 +1,28 @@ - diff --git a/src/lib/components/Photo.svelte b/src/lib/components/Photo.svelte index 73beebf..86abc6f 100644 --- a/src/lib/components/Photo.svelte +++ b/src/lib/components/Photo.svelte @@ -1,43 +1,28 @@ - diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 460904f..7957360 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -1,4 +1,4 @@ - diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 1fc8ebe..6779e89 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -1,4 +1,4 @@ - diff --git a/src/routes/[slug]/[[timestamp]]/+page.server.js b/src/routes/[slug]/[[timestamp]]/+page.server.ts similarity index 68% rename from src/routes/[slug]/[[timestamp]]/+page.server.js rename to src/routes/[slug]/[[timestamp]]/+page.server.ts index 6852e83..7f2ced1 100644 --- a/src/routes/[slug]/[[timestamp]]/+page.server.js +++ b/src/routes/[slug]/[[timestamp]]/+page.server.ts @@ -1,8 +1,8 @@ import { getMetadata } from '$lib/util/album'; import { getAlbumUri, 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 base = getAlbumUri(params); diff --git a/src/routes/[slug]/[[timestamp]]/+page.svelte b/src/routes/[slug]/[[timestamp]]/+page.svelte index f949c58..a38d9ea 100644 --- a/src/routes/[slug]/[[timestamp]]/+page.svelte +++ b/src/routes/[slug]/[[timestamp]]/+page.svelte @@ -1,13 +1,11 @@ -
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