import { CsrfOptions } from './options'; import { CsrfForbiddenError } from './errors'; /** * Core CSRF Token generator and validator. * Framework-agnostic implementation handling secure cryptographic operations. * * @example * ```typescript * const core = new CsrfCore({ tokenLength: 32 }); * const token = core.generateToken(); * const isValid = core.verifyToken(token, 'user-provided-token'); * ``` */ export declare class CsrfCore { private options; /** * Initializes the CSRF Core engine. * * @param options - Optional configuration overriding default properties. */ constructor(options?: Partial); /** * Retrieves the current configuration options. * * @returns Current CSRF options. */ getOptions(): CsrfOptions; /** * Generates a new secure random token. * * @returns A secure hexadecimal string token. */ generateToken(): string; /** * Validates if the token stored in the cookie matches the token sent in the request. * Uses timing-safe equality to prevent timing attacks. * * @param cookieToken - The token retrieved from the trusted HTTP cookie. * @param bodyOrHeaderToken - The token sent by the client via body or headers. * @returns `true` if both tokens match and exist, `false` otherwise. */ verifyToken(cookieToken?: string, bodyOrHeaderToken?: string): boolean; /** * Creates an instance of the configured CSRF validation error. * * @returns A CsrfForbiddenError indicating a forbidden action. */ createError(): CsrfForbiddenError; } //# sourceMappingURL=csrf.d.ts.map