SvelteKit's PageData type generation only picks up +page.ts return values when both files exist, so the runtime-merged server data was invisible to TypeScript and svelte-check flagged every q/from/to/etc access in +page.svelte. Spreading data into the +page.ts return restores the merge at the type level. No runtime behaviour change. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
11 lines
426 B
TypeScript
11 lines
426 B
TypeScript
import { browser } from '$app/environment';
|
|
import { fetchDensity } from '$lib/document/timeline';
|
|
import type { PageLoad } from './$types';
|
|
|
|
export const load: PageLoad = async ({ url, fetch, data }) => {
|
|
const view = url.searchParams.get('view');
|
|
const isDesktop = browser && window.matchMedia('(min-width: 640px)').matches;
|
|
const density = await fetchDensity(fetch, view, isDesktop);
|
|
return { ...data, ...density };
|
|
};
|