From bc0b4e1a99240c13abaaae1184dd2dcf6639e6e0 Mon Sep 17 00:00:00 2001 From: pilcrowOnPaper Date: Tue, 8 Oct 2024 02:10:16 +0900 Subject: [PATCH] update .d.ts --- pages/sessions/cookies/sveltekit.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pages/sessions/cookies/sveltekit.md b/pages/sessions/cookies/sveltekit.md index 2c5f94b..0c32233 100644 --- a/pages/sessions/cookies/sveltekit.md +++ b/pages/sessions/cookies/sveltekit.md @@ -87,17 +87,20 @@ We recommend handling session validation in the handle hook and passing the curr ```ts // src/app.d.ts +import type { User } from "$lib/server/user"; +import type { Session } from "$lib/server/session"; + declare global { namespace App { - // Note: 'import {} from ""' syntax does not work in .d.ts files. interface Locals { - session: import("./lib/server/session").Session | null; - user: import("./lib/server/session").User | null; + user: User | null; + session: Session | null; } } } export {}; + ``` ```ts