client-sessions/ 000755 001751 001751 0000000000 15076575141 015713 5 ustar 00runner 000000 000000 15076575141 15076575141 client-sessions/LICENSE 000644 001751 001751 0000002165 15076575141 016724 0 ustar 00runner 000000 000000 15076575141 15076575141 MIT License
Copyright (c) Microsoft Corporation.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE
client-sessions/README.md 000644 001751 001751 0000005400 15076575141 017200 0 ustar 00runner 000000 000000 15076575436 15076575141 # Installation
> `npm install --save @types/client-sessions`
# Summary
This package contains type definitions for client-sessions (https://github.com/mozilla/node-client-sessions).
# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/client-sessions.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/client-sessions/index.d.ts)
````ts
///
import cookies = require("cookies");
interface CookieOptions extends cookies.IOptions {
/**
* a boolean indicating whether the cookie will expire when browser closes or not
* (false by default).
*/
ephemeral?: boolean | undefined;
}
declare namespace client_sessions {
type NextFunction = (err?: Error) => void;
type RequestHandler = (req: any, res: any, next: NextFunction) => any;
interface SessionOptions {
/**
* encryption secret for the session.
* required
*/
secret: string;
/**
* session cookie name.
* Default: 'session_state'
*/
cookieName?: string | undefined;
/**
* how long the session will stay valid in ms.
* Default: 24 hours
*/
duration?: number | undefined;
/**
* if expiresIn < activeDuration, the session will be extended by activeDuration milliseconds.
* Default: 5 minutes
*/
activeDuration?: number | undefined;
/**
* session accessor on the request object.
* Default: 'session'
*/
requestKey?: string | undefined;
cookie?: CookieOptions | undefined;
}
interface DecodeResult {
content: any;
createdAt: number;
duration: number;
}
interface ComputeHmacOptions {
signatureAlgorithm: string;
signatureKey: Buffer;
}
interface Util {
computeHmac(options: any, iv: string, ciphertext: string, duration: number, createdAt: number): Buffer;
encode(options: SessionOptions, content: any, duration?: number, createdAt?: number): string;
decode(options: SessionOptions, encoded: string): DecodeResult;
}
interface Sessions {
(options: SessionOptions): RequestHandler;
util: Util;
}
}
declare var client_sessions: client_sessions.Sessions;
export = client_sessions;
export as namespace client_sessions;
````
### Additional Details
* Last updated: Fri, 24 Oct 2025 04:02:41 GMT
* Dependencies: [@types/cookies](https://npmjs.com/package/@types/cookies), [@types/node](https://npmjs.com/package/@types/node)
# Credits
These definitions were written by [Aditya](https://github.com/netroy), and [Ankit Malik](https://github.com/DiabolusGX).
client-sessions/index.d.ts 000644 001751 001751 0000003762 15076575141 017624 0 ustar 00runner 000000 000000 15076575141 15076575141 ///
import cookies = require("cookies");
interface CookieOptions extends cookies.IOptions {
/**
* a boolean indicating whether the cookie will expire when browser closes or not
* (false by default).
*/
ephemeral?: boolean | undefined;
}
declare namespace client_sessions {
type NextFunction = (err?: Error) => void;
type RequestHandler = (req: any, res: any, next: NextFunction) => any;
interface SessionOptions {
/**
* encryption secret for the session.
* required
*/
secret: string;
/**
* session cookie name.
* Default: 'session_state'
*/
cookieName?: string | undefined;
/**
* how long the session will stay valid in ms.
* Default: 24 hours
*/
duration?: number | undefined;
/**
* if expiresIn < activeDuration, the session will be extended by activeDuration milliseconds.
* Default: 5 minutes
*/
activeDuration?: number | undefined;
/**
* session accessor on the request object.
* Default: 'session'
*/
requestKey?: string | undefined;
cookie?: CookieOptions | undefined;
}
interface DecodeResult {
content: any;
createdAt: number;
duration: number;
}
interface ComputeHmacOptions {
signatureAlgorithm: string;
signatureKey: Buffer;
}
interface Util {
computeHmac(options: any, iv: string, ciphertext: string, duration: number, createdAt: number): Buffer;
encode(options: SessionOptions, content: any, duration?: number, createdAt?: number): string;
decode(options: SessionOptions, encoded: string): DecodeResult;
}
interface Sessions {
(options: SessionOptions): RequestHandler;
util: Util;
}
}
declare var client_sessions: client_sessions.Sessions;
export = client_sessions;
export as namespace client_sessions;
client-sessions/package.json 000644 001751 001751 0000002032 15076575141 020205 0 ustar 00runner 000000 000000 15076575436 15076575141 {
"name": "@types/client-sessions",
"version": "0.8.7",
"description": "TypeScript definitions for client-sessions",
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/client-sessions",
"license": "MIT",
"contributors": [
{
"name": "Aditya",
"githubUsername": "netroy",
"url": "https://github.com/netroy"
},
{
"name": "Ankit Malik",
"githubUsername": "DiabolusGX",
"url": "https://github.com/DiabolusGX"
}
],
"main": "",
"types": "index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
"directory": "types/client-sessions"
},
"scripts": {},
"dependencies": {
"@types/cookies": "*",
"@types/node": "*"
},
"peerDependencies": {},
"typesPublisherContentHash": "3656c8641bba137c436ec41b188e3d2ef1ad5c5d1d036da552f1a50bd6c46abe",
"typeScriptVersion": "5.2"
}