- Type load functions with SvelteKit's generated types: `export const load: PageServerLoad = async ({ params, locals }) => { ... }` — import from `./$types`.
- Use `+page.server.ts` and `+layout.server.ts` (`.ts` not `.js`) for typed server-side data fetching and form actions.
- Type form actions with `Actions` from `./$types`: `export const actions: Actions = { default: async ({ request }) => { ... } }`.
- Use `error()`, `redirect()`, and `fail()` helpers from `@sveltejs/kit` with typed status codes — `throw error(404, { message: 'Not found' })` returns typed error pages.
- Use `PageData`, `LayoutData`, and `ActionData` types from `./$types` — SvelteKit auto-generates them based on your load function return types.
- Type `hooks.server.ts` with `Handle` type: `export const handle: Handle = async ({ event, resolve }) => { ... }` for typed request pipeline.
- Augment `App.Locals` in `src/app.d.ts` to type `event.locals`: `interface Locals { user: User | null; session: Session }`.
- Type API endpoints with `RequestHandler`: `export const GET: RequestHandler = async ({ params, url }) => { return json(data) }`.
- Use `error()`, `redirect()`, and `json()` helpers from `@sveltejs/kit` with typed status codes for type-safe server responses.