/// <reference types="@adonisjs/events/build/adonis-typings" />
import { EmitterContract } from '@ioc:Adonis/Core/Event';
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext';
import { UserProviderContract, SessionGuardConfig, SessionGuardContract } from '@ioc:Adonis/Addons/Auth';
import { BaseGuard } from '../Base';
/**
 * Session guard enables user login using sessions. Also it allows for
 * setting remember me tokens for life long login
 */
export declare class SessionGuard extends BaseGuard<any> implements SessionGuardContract<any, any> {
    private emitter;
    private ctx;
    constructor(name: string, config: SessionGuardConfig<any>, emitter: EmitterContract, provider: UserProviderContract<any>, ctx: HttpContextContract);
    /**
     * Number of years for the remember me token expiry
     */
    private rememberMeTokenExpiry;
    /**
     * The name of the session key name
     */
    get sessionKeyName(): string;
    /**
     * The name of the session key name
     */
    get rememberMeKeyName(): string;
    /**
     * Returns the session object from the context.
     */
    private getSession;
    /**
     * Set the user id inside the session. Also forces the session module
     * to re-generate the session id
     */
    private setSession;
    /**
     * Generate remember me token
     */
    private generateRememberMeToken;
    /**
     * Sets the remember me cookie with the remember me token
     */
    private setRememberMeCookie;
    /**
     * Clears the remember me cookie
     */
    private clearRememberMeCookie;
    /**
     * Clears user session and remember me cookie
     */
    private clearUserFromStorage;
    /**
     * Returns data packet for the login event. Arguments are
     *
     * - The mapping identifier
     * - Logged in user
     * - HTTP context
     * - Remember me token (optional)
     */
    private getLoginEventData;
    /**
     * Returns data packet for the authenticate event. Arguments are
     *
     * - The mapping identifier
     * - Logged in user
     * - HTTP context
     * - A boolean to tell if logged in viaRemember or not
     */
    private getAuthenticateEventData;
    /**
     * Returns the user id for the current HTTP request
     */
    private getRequestSessionId;
    /**
     * Verifies the remember me token
     */
    private verifyRememberMeToken;
    /**
     * Returns user from the user session id
     */
    private getUserForSessionId;
    /**
     * Returns user for the remember me token
     */
    private getUserForRememberMeToken;
    /**
     * Returns the remember me token of the user that is persisted
     * inside the db. If not persisted, we create one and persist
     * it
     */
    private getPersistedRememberMeToken;
    /**
     * Verify user credentials and perform login
     */
    attempt(uid: string, password: string, remember?: boolean): Promise<any>;
    /**
     * Login user using their id
     */
    loginViaId(id: string | number, remember?: boolean): Promise<void>;
    /**
     * Login a user
     */
    login(user: any, remember?: boolean): Promise<void>;
    /**
     * Authenticates the current HTTP request by checking for the user
     * session.
     */
    authenticate(): Promise<any>;
    /**
     * Same as [[authenticate]] but returns a boolean over raising exceptions
     */
    check(): Promise<boolean>;
    /**
     * Logout by clearing session and cookies
     */
    logout(recycleRememberToken?: boolean): Promise<void>;
    /**
     * Serialize toJSON for JSON.stringify
     */
    toJSON(): {
        isLoggedIn: boolean;
        isGuest: boolean;
        viaRemember: boolean;
        authenticationAttempted: boolean;
        isAuthenticated: boolean;
        user: any;
    };
}
