fix(session): types for SessionOptions cookie methods (#1301)

pull/1303/head
Jonathan Haines 2025-07-11 19:14:09 +10:00 committed by GitHub
parent 2498ccab03
commit 037fd94b7b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 26 additions and 3 deletions

View File

@ -0,0 +1,5 @@
---
'@hono/session': patch
---
Fix types for `SessionOptions` cookie methods

View File

@ -0,0 +1,18 @@
{
"name": "@hono/session",
"version": "0.1.0",
"license": "MIT",
"exports": {
".": "./src/index.ts",
"./cookies": "./src/cookies.ts",
"./testing": "./src/helper/testing/index.ts"
},
"imports": {
"hono": "jsr:@hono/hono@^4.8.3",
"jose": "jsr:@panva/jose@^6.0.11"
},
"publish": {
"include": ["deno.json", "README.md", "src/**/*.ts"],
"exclude": ["src/**/*.test.ts"]
}
}

View File

@ -37,9 +37,9 @@ export interface SessionOptions<Data> extends SessionEvents<Data> {
*/
secret?: string | EncryptionKey
deleteCookie?: typeof cookie.deleteCookie
getCookie?: typeof cookie.getCookie
setCookie?: typeof cookie.setCookie
deleteCookie?: (c: Context, name: string, opt?: CookieOptions) => void
getCookie?: (c: Context, name: string) => string | undefined
setCookie?: (c: Context, name: string, value: string, opt?: CookieOptions) => void
}
export type SessionEnv<Data = SessionData> = Env & {