import { ExecutionContext, CanActivate } from "@nestjs/common"; import { FieldParser } from "./field"; import { JwtPayloadUpdated, JwtSignOptions } from "cymaple-utils"; import { Request } from "express"; declare type JwtOptions = { secretKey: string; signOptions: JwtSignOptions; }; export interface JwtGuardPayloadHandler { (payload: JwtPayloadUpdated, request: Request): void | Promise; } export interface JwtGuardTokenHandler { (token: string): string | Promise; } export interface GenerateTokenStrategy { (): string; } export declare class JwtGuard implements CanActivate { private readonly fieldParser; private readonly jwtOptions; private payloadHandlerList; private tokenHandlerList; private request; private payload; private token; private allowAnonymousState; private anonymousToken; constructor(fieldParser: FieldParser, jwtOptions: JwtOptions); canActivate(ctx: ExecutionContext): Promise; private parseToken; private authToken; private useTokenHandlers; private usePayloadHandlers; allowAnonymous(strategy: GenerateTokenStrategy): void; addPayloadHandler(handler: JwtGuardPayloadHandler): this; addTokenHandler(handler: JwtGuardTokenHandler): this; } export {};