import { Response } from "express"; import * as jwt from "jsonwebtoken"; import { GarmrOptions } from "../garmr.options"; import { Authenticatable } from "../interfaces/authenticatable.interface"; import { TokenService } from "./token.service"; export declare class SessionService { private readonly options; private readonly tokenService; private readonly cookieOptions; constructor(options: GarmrOptions, tokenService: TokenService); /** * Creates a session for the given entity. * * Issues a session JWT and sets it as an httpOnly cookie on the response. * * @param res - Express response object * @param entity - The authenticated entity * @returns The issued token and decoded payload */ create(res: Response, entity: Authenticatable): { token: string; payload: jwt.JwtPayload; }; /** * Clears the session cookie. * * @param res - Express response object */ clear(res: Response): void; private appendCookie; }