import type { Algorithm } from 'fast-jwt'; import type { HttpRequest } from '../http/request'; import type { HttpResponse } from '../http/response'; type JwtExtras = object; export interface JwtCookieOptions { secure?: boolean; sameSite?: 'Strict' | 'Lax' | 'None'; domain?: string; } export interface JwtGenerationOptions { id?: string; issuer?: string; audience?: string | string[]; subject: string; expiresAt?: Date | number; expiryMins?: number; payload?: T; } export interface JwtVerifierOptions { issuer?: string; audience?: string | string[]; key: string | Buffer; algorithm?: Algorithm | string; } export declare class ParsedJwt { readonly isValid = true; id?: string; issuer: string; audience?: string | string[]; subject: string; issuedAtMs: number; expiresAtMs: number; payload: T; rawPayload: Record; get issuedAt(): Date; get expiresAt(): Date; } export interface InvalidJwtValidationResult { isValid: false; isDecodable: boolean; isSignatureValid?: boolean; isPayloadValid?: boolean; isNotExpired?: boolean; } export type JwtValidationResult = ParsedJwt | InvalidJwtValidationResult; export declare class JWT { static generate(options: JwtGenerationOptions): Promise; static generateCookie(options: JwtGenerationOptions, response: HttpResponse, cookieOptions?: JwtCookieOptions): Promise; static clearCookie(response: HttpResponse, cookieOptions?: JwtCookieOptions): Promise; static createVerifier(options: JwtVerifierOptions): (token: string) => Promise>; static verify(token: string, key?: string | Buffer, options?: { issuer?: string; audience?: string | string[]; algorithm?: Algorithm | string; }): Promise>; static decode(token: string): Promise>; static process(token: string): Promise>; static processWithRequest(request: HttpRequest): Promise | null>; } export {}; //# sourceMappingURL=jwt.d.ts.map