diff --git a/src/mod.ts b/src/mod.ts index 0151af0..001fa58 100644 --- a/src/mod.ts +++ b/src/mod.ts @@ -3,3 +3,6 @@ export * from "./stores/redis.ts"; export * from "./stores/kv.ts"; export * from "./stores/interface.ts"; export * from "./session.ts"; +export * from "./plugins/cookie_session_plugin.ts"; +export * from "./plugins/redis_session_plugin.ts"; +export * from "./plugins/kv_session_plugin.ts"; diff --git a/src/plugins/cookie_session_plugin.ts b/src/plugins/cookie_session_plugin.ts index 5aef28e..9ea7a81 100644 --- a/src/plugins/cookie_session_plugin.ts +++ b/src/plugins/cookie_session_plugin.ts @@ -5,8 +5,7 @@ import type { } from "../deps.ts"; import { cookieSession } from "../stores/cookie.ts"; import { CookieOptions } from "../stores/cookie_option.ts"; - -export type sessionModule =(req: Request, ctx: MiddlewareHandlerContext) => Promise +import { sessionModule } from "../stores/interface.ts"; export function getCookieSessionHandler(session: sessionModule, excludePath: string[]): MiddlewareHandler { return function (req: Request, ctx: MiddlewareHandlerContext) { diff --git a/src/plugins/kv_session_plugin.ts b/src/plugins/kv_session_plugin.ts index a210581..8a6b9d7 100644 --- a/src/plugins/kv_session_plugin.ts +++ b/src/plugins/kv_session_plugin.ts @@ -5,8 +5,7 @@ import type { } from "../deps.ts"; import { kvSession } from "../stores/kv.ts"; import { CookieOptions } from "../stores/cookie_option.ts"; - -export type sessionModule =(req: Request, ctx: MiddlewareHandlerContext) => Promise +import { sessionModule } from "../stores/interface.ts"; export function getKvSessionHandler(session: sessionModule, excludePath: string[]): MiddlewareHandler { return function (req: Request, ctx: MiddlewareHandlerContext) { diff --git a/src/plugins/redis_session_plugin.ts b/src/plugins/redis_session_plugin.ts index 0a67bd1..12bdde5 100644 --- a/src/plugins/redis_session_plugin.ts +++ b/src/plugins/redis_session_plugin.ts @@ -5,8 +5,7 @@ import type { } from "../deps.ts"; import { Store, redisSession } from "../stores/redis.ts"; import { CookieOptions } from "../stores/cookie_option.ts"; - -export type sessionModule =(req: Request, ctx: MiddlewareHandlerContext) => Promise +import { sessionModule } from "../stores/interface.ts"; export function getRedisSessionHandler(session: sessionModule, excludePath: string[]): MiddlewareHandler { return function (req: Request, ctx: MiddlewareHandlerContext) { diff --git a/src/stores/interface.ts b/src/stores/interface.ts index bffafb9..290c083 100644 --- a/src/stores/interface.ts +++ b/src/stores/interface.ts @@ -1,4 +1,7 @@ +import { MiddlewareHandlerContext } from "../deps.ts"; import { Session } from "../session.ts"; export type WithSession = { session: Session; }; + +export type sessionModule =(req: Request, ctx: MiddlewareHandlerContext) => Promise