Skip to content

Commit

Permalink
update .d.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
pilcrowonpaper committed Oct 7, 2024
1 parent 7a9b509 commit bc0b4e1
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pages/sessions/cookies/sveltekit.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bc0b4e1

Please sign in to comment.