feat: 🏷️ add new SessionHandlers type helper

This commit is contained in:
Julien Oculi 2024-06-17 12:46:46 +02:00
parent 021d9e689b
commit c74687ca64

View file

@ -1,4 +1,4 @@
import type { PageProps } from '$fresh/server.ts'
import type { Handlers, PageProps } from '$fresh/server.ts'
import { getCookies } from '@std/http/cookie'
type SessionEntry<T = unknown> = {
@ -14,6 +14,9 @@ export interface SessionState {
export type SessionPageProps<T = unknown, S = Record<string, unknown>> =
PageProps<T, S & SessionState>
export type SessionHandlers<T = unknown, S = Record<string, unknown>> =
Handlers<T, S & SessionState>
export class SessionStore {
static #store = new Map<string, Session>()