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<T extends JwtExtras = JwtExtras> {
    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<T extends JwtExtras = JwtExtras> {
    readonly isValid = true;
    id?: string;
    issuer: string;
    audience?: string | string[];
    subject: string;
    issuedAtMs: number;
    expiresAtMs: number;
    payload: T;
    rawPayload: Record<string, unknown>;
    get issuedAt(): Date;
    get expiresAt(): Date;
}
export interface InvalidJwtValidationResult {
    isValid: false;
    isDecodable: boolean;
    isSignatureValid?: boolean;
    isPayloadValid?: boolean;
    isNotExpired?: boolean;
}
export type JwtValidationResult<T extends JwtExtras = JwtExtras> = ParsedJwt<T> | InvalidJwtValidationResult;
export declare class JWT {
    static generate<T extends JwtExtras = JwtExtras>(options: JwtGenerationOptions<T>): Promise<string>;
    static generateCookie<T extends JwtExtras = JwtExtras>(options: JwtGenerationOptions<T>, response: HttpResponse, cookieOptions?: JwtCookieOptions): Promise<void>;
    static clearCookie(response: HttpResponse, cookieOptions?: JwtCookieOptions): Promise<void>;
    static createVerifier<T extends JwtExtras = JwtExtras>(options: JwtVerifierOptions): (token: string) => Promise<JwtValidationResult<T>>;
    static verify<T extends JwtExtras = JwtExtras>(token: string, key?: string | Buffer, options?: {
        issuer?: string;
        audience?: string | string[];
        algorithm?: Algorithm | string;
    }): Promise<JwtValidationResult<T>>;
    static decode<T extends JwtExtras = JwtExtras>(token: string): Promise<JwtValidationResult<T>>;
    static process<T extends JwtExtras = JwtExtras>(token: string): Promise<JwtValidationResult<T>>;
    static processWithRequest<T extends JwtExtras = JwtExtras>(request: HttpRequest): Promise<JwtValidationResult<T> | null>;
}
export {};
//# sourceMappingURL=jwt.d.ts.map