import { type CognitoJwtExtractor, CognitoJwtVerifier } from "@nestjs-cognito/core"; import { CanActivate, ExecutionContext } from "@nestjs/common"; import { Reflector } from "@nestjs/core"; import { User } from "./user/user.model"; /** * Abstract guard class that implements authentication logic for routes. * Handles both public and protected routes with JWT verification. * * @abstract * @class AbstractGuard * @implements {CanActivate} */ export declare abstract class AbstractGuard implements CanActivate { #private; constructor(jwtVerifier: CognitoJwtVerifier, reflector: Reflector, jwtExtractor: CognitoJwtExtractor); /** * Determines if a request can activate a route. * Handles authentication for both public and protected routes. * * @param {ExecutionContext} context - The execution context * @returns {Promise} True if the request can activate the route, false otherwise */ canActivate(context: ExecutionContext): Promise; /** * Abstract method to validate the authenticated user. * Implementations should define specific validation logic. * * @abstract * @protected * @param {User} user - The authenticated user to validate * @returns {boolean} True if the user is valid, false otherwise */ protected abstract onValidate(user: User): boolean; /** * Abstract method to extract the request object from the execution context. * Implementations should handle different types of requests (HTTP, WebSocket, etc.). * * @abstract * @protected * @param {ExecutionContext} context - The execution context * @returns {any} The request object */ protected abstract getRequest(context: ExecutionContext): any; } //# sourceMappingURL=abstract.guard.d.ts.map