@types/koa-session
Advanced tools
Comparing version 6.4.0 to 6.4.1
@@ -76,6 +76,6 @@ // Type definitions for koa-session 6.4 | ||
interface ContextSession { | ||
ctx: Koa.Context; | ||
interface ContextSession<StateT = Koa.DefaultState, ContextT = Koa.DefaultContext, ResponseBodyT = any> { | ||
ctx: Koa.ParameterizedContext<StateT, ContextT, ResponseBodyT>; | ||
app: Koa.Context["app"]; | ||
app: Koa.ParameterizedContext<StateT, ContextT, ResponseBodyT>["app"]; | ||
@@ -126,3 +126,3 @@ opts: opts; | ||
interface opts extends Omit<Cookies.SetOption, 'maxAge'> { | ||
interface opts<StateT = Koa.DefaultState, ContextT = Koa.DefaultContext, ResponseBodyT = any> extends Omit<Cookies.SetOption, 'maxAge'> { | ||
/** | ||
@@ -174,3 +174,3 @@ * cookie key (default is koa:sess) | ||
*/ | ||
externalKey?: ExternalKeys | undefined; | ||
externalKey?: ExternalKeys<StateT, ContextT, ResponseBodyT> | undefined; | ||
@@ -182,3 +182,3 @@ /** | ||
*/ | ||
ContextStore?: { new(ctx: Koa.Context): stores } | undefined; | ||
ContextStore?: { new(ctx: Koa.ParameterizedContext<StateT, ContextT, ResponseBodyT>): stores } | undefined; | ||
@@ -193,3 +193,3 @@ /** | ||
*/ | ||
valid?(ctx: Koa.Context, session: Partial<Session>): void; | ||
valid?(ctx: Koa.ParameterizedContext<StateT, ContextT, ResponseBodyT>, session: Partial<Session>): void; | ||
@@ -199,3 +199,3 @@ /** | ||
*/ | ||
beforeSave?(ctx: Koa.Context, session: Session): void; | ||
beforeSave?(ctx: Koa.ParameterizedContext<StateT, ContextT, ResponseBodyT>, session: Session): void; | ||
@@ -225,7 +225,7 @@ /** | ||
interface ExternalKeys { | ||
interface ExternalKeys<StateT = Koa.DefaultState, ContextT = Koa.DefaultContext, ResponseBodyT = any> { | ||
/** | ||
* get session object by key | ||
*/ | ||
get(ctx: Koa.Context): string | undefined; | ||
get(ctx: Koa.ParameterizedContext<StateT, ContextT, ResponseBodyT>): string | undefined; | ||
@@ -235,9 +235,11 @@ /** | ||
*/ | ||
set(ctx: Koa.Context, value: any): void; | ||
set(ctx: Koa.ParameterizedContext<StateT, ContextT, ResponseBodyT>, value: any): void; | ||
} | ||
} | ||
declare function session(CONFIG: Partial<session.opts>, app: Koa): Koa.Middleware; | ||
declare function session<StateT = Koa.DefaultState, ContextT = Koa.DefaultContext, ResponseBodyT = any>( | ||
CONFIG: Partial<session.opts<StateT, ContextT, ResponseBodyT>>, app: Koa<StateT, ContextT> | ||
): Koa.Middleware<StateT, ContextT, ResponseBodyT>; | ||
declare function session(app: Koa): Koa.Middleware; | ||
declare function session<StateT = Koa.DefaultState, ContextT = Koa.DefaultContext>(app: Koa<StateT, ContextT>): Koa.Middleware<StateT, ContextT>; | ||
@@ -244,0 +246,0 @@ declare module "koa" { |
{ | ||
"name": "@types/koa-session", | ||
"version": "6.4.0", | ||
"version": "6.4.1", | ||
"description": "TypeScript definitions for koa-session", | ||
@@ -36,4 +36,4 @@ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/koa-session", | ||
}, | ||
"typesPublisherContentHash": "787a2548c84370900348ee3e053123550d3648326efc0e06247be423399ebd74", | ||
"typeScriptVersion": "4.2" | ||
"typesPublisherContentHash": "99dcc6d2030b0a5d0ebcca10d3d68b44b51915b2d8dde5036b895f6998a5b57f", | ||
"typeScriptVersion": "4.3" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
### Additional Details | ||
* Last updated: Wed, 15 Mar 2023 09:32:43 GMT | ||
* Last updated: Tue, 25 Apr 2023 10:32:40 GMT | ||
* Dependencies: [@types/cookies](https://npmjs.com/package/@types/cookies), [@types/koa](https://npmjs.com/package/@types/koa) | ||
@@ -14,0 +14,0 @@ * Global values: none |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10675
209