import type { AuthUserSessionInfo } from '%authContextImports';
import type { RequestServiceContext } from '%requestServiceContextImports';
import type { UserSessionPayload, UserSessionService } from '%userSessionTypesImports';
import type { FastifyReply, FastifyRequest } from 'fastify';
export declare class CookieUserSessionService implements UserSessionService {
    /**
     * Creates a user session cookie and sets it in the response.
     *
     * @param userId The ID of the user for whom the session is being created.
     * @param context The request service context
     * @param currentDate The current date and time. Defaults to the current date and time.
     * @returns The session payload
     */
    createSession(userId: string, context: RequestServiceContext, currentDate?: Date): Promise<UserSessionPayload>;
    /**
     * Ends the user session by clearing the session cookie and deleting the session from the database.
     *
     * @param sessionInfo The session info
     * @param context The request service context
     */
    clearSession(sessionInfo: AuthUserSessionInfo, context: RequestServiceContext): Promise<void>;
    /**
     * Retrieves the user session information from the request.
     *
     * @param req - The Fastify request object containing the cookies.
     * @param reply - The Fastify reply object used to set or clear cookies.
     * @param currentDate - The current date used for session validation. Defaults to the current date and time.
     * @returns A promise that resolves to the authenticated user session information or null if the session is invalid.
     * @throws {InvalidSessionError} If the session is invalid or expired.
     */
    getSessionInfoFromRequest(req: FastifyRequest, reply?: FastifyReply): Promise<AuthUserSessionInfo | undefined>;
    /**
     * Retrieves the user session information from the authentication token
     *
     * Note: Since we use cookies, we ignore the authToken parameter
     *
     * @param req The request object
     * @returns The session info or undefined if no session is found
     */
    getSessionInfoFromToken(req: FastifyRequest): Promise<AuthUserSessionInfo | undefined>;
}
export declare const userSessionService: CookieUserSessionService;
//# sourceMappingURL=user-session.service.d.ts.map