feat: 🏷️ add new SessionHandlers
type helper
This commit is contained in:
parent
021d9e689b
commit
c74687ca64
|
@ -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'
|
import { getCookies } from '@std/http/cookie'
|
||||||
|
|
||||||
type SessionEntry<T = unknown> = {
|
type SessionEntry<T = unknown> = {
|
||||||
|
@ -14,6 +14,9 @@ export interface SessionState {
|
||||||
export type SessionPageProps<T = unknown, S = Record<string, unknown>> =
|
export type SessionPageProps<T = unknown, S = Record<string, unknown>> =
|
||||||
PageProps<T, S & SessionState>
|
PageProps<T, S & SessionState>
|
||||||
|
|
||||||
|
export type SessionHandlers<T = unknown, S = Record<string, unknown>> =
|
||||||
|
Handlers<T, S & SessionState>
|
||||||
|
|
||||||
export class SessionStore {
|
export class SessionStore {
|
||||||
static #store = new Map<string, Session>()
|
static #store = new Map<string, Session>()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue