This commit is contained in:
Tutur33
2023-11-24 22:35:41 +01:00
parent 3c0b507a93
commit 7644b2a0f7
45165 changed files with 4803356 additions and 3 deletions
+78
View File
@@ -0,0 +1,78 @@
/**
* @adonisjs/session
*
* (c) Harminder Virk <virk@adonisjs.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/// <reference types="@adonisjs/application/build/adonis-typings" />
import { ApplicationContract } from '@ioc:Adonis/Core/Application';
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext';
import { SessionConfig, ExtendCallback, SessionManagerContract, SessionClientContract } from '@ioc:Adonis/Addons/Session';
import { Session } from '../Session';
/**
* Session manager exposes the API to create session instance for a given
* request and also add new drivers.
*/
export declare class SessionManager implements SessionManagerContract {
application: ApplicationContract;
/**
* A private map of drivers added from outside in.
*/
private extendedDrivers;
/**
* Reference to session config
*/
private config;
constructor(application: ApplicationContract, config: SessionConfig);
/**
* Validates the config
*/
private validateConfig;
/**
* Processes the config and decides the `expires` option for the cookie
*/
private processConfig;
/**
* Returns an instance of cookie driver
*/
private createCookieDriver;
/**
* Returns an instance of the memory driver
*/
private createMemoryDriver;
/**
* Returns an instance of file driver
*/
private createFileDriver;
/**
* Returns an instance of redis driver
*/
private createRedisDriver;
/**
* Creates an instance of extended driver
*/
private createExtendedDriver;
/**
* Creates an instance of driver by looking at the config value `driver`.
* An hard exception is raised in case of invalid driver name
*/
private createDriver;
/**
* Find if the sessions are enabled
*/
isEnabled(): boolean;
/**
* Creates an instance of the session client
*/
client(): SessionClientContract;
/**
* Creates a new session instance for a given HTTP request
*/
create(ctx: HttpContextContract): Session;
/**
* Extend the drivers list by adding a new one.
*/
extend(driver: string, callback: ExtendCallback): void;
}