/** * CSRF Token Service * Handles token generation and validation using the Double-Submit Cookie pattern. */ interface CsrfServiceOptions { tokenLength: number; } declare class CsrfService { private tokenLength; constructor(options: CsrfServiceOptions); /** Generate a cryptographically random hex token. */ generateToken(): string; /** Timing-safe comparison of cookie token vs header token. */ validateToken(cookieValue: string | undefined, headerValue: string | undefined): boolean; /** Build the Set-Cookie header value for a CSRF token. */ buildCookieHeader(token: string, cookieName: string, options: { sameSite: string; secure: boolean; path: string; }): string; } export { CsrfService, type CsrfServiceOptions };