export interface SecurityHeadersConfig { enabled: boolean; headers: { contentSecurityPolicy?: string | false; frameOptions?: 'DENY' | 'SAMEORIGIN' | string | false; contentTypeOptions?: boolean; xssProtection?: boolean | '1' | '0' | '1; mode=block'; referrerPolicy?: 'no-referrer' | 'no-referrer-when-downgrade' | 'origin' | 'origin-when-cross-origin' | 'same-origin' | 'strict-origin' | 'strict-origin-when-cross-origin' | 'unsafe-url' | false; strictTransportSecurity?: string | false; permissionsPolicy?: string | false; crossOriginEmbedderPolicy?: 'require-corp' | 'credentialless' | false; crossOriginOpenerPolicy?: 'same-origin' | 'same-origin-allow-popups' | 'unsafe-none' | false; crossOriginResourcePolicy?: 'same-site' | 'same-origin' | 'cross-origin' | false; }; customHeaders?: Record; } export interface CSRFConfig { enabled: boolean; secret: string; cookieName?: string; cookieOptions?: { httpOnly?: boolean; secure?: boolean; sameSite?: 'strict' | 'lax' | 'none'; maxAge?: number; }; tokenLength?: number; ignoreMethods?: string[]; ignorePaths?: string[]; headerName?: string; bodyName?: string; queryName?: string; } export interface InputSanitizationConfig { enabled: boolean; options: { stripHtml?: boolean; allowedTags?: string[]; allowedAttributes?: Record; escapeSql?: boolean; escapeHtml?: boolean; preventPathTraversal?: boolean; validateFileUploads?: boolean; maxFileSize?: number; allowedMimeTypes?: string[]; validateJson?: boolean; maxJsonSize?: number; }; customSanitizers?: Record any>; } export interface SecurityConfig { enabled: boolean; headers?: SecurityHeadersConfig; csrf?: CSRFConfig; sanitization?: InputSanitizationConfig; rateLimit?: { enabled: boolean; windowMs: number; max: number; skipSuccessfulRequests?: boolean; }; cors?: { enabled: boolean; origin: string | string[] | boolean; credentials?: boolean; methods?: string[]; allowedHeaders?: string[]; }; } export interface SecurityContext { csrfToken?: string; isSecure: boolean; userAgent?: string; ip?: string; referer?: string; origin?: string; } export interface SecurityViolation { type: 'csrf' | 'xss' | 'sql_injection' | 'path_traversal' | 'file_upload' | 'rate_limit'; message: string; severity: 'low' | 'medium' | 'high' | 'critical'; timestamp: number; ip?: string; userAgent?: string; path?: string; method?: string; } export declare const defaultSecurityHeadersConfig: SecurityHeadersConfig; export declare const defaultCSRFConfig: CSRFConfig; export declare const defaultInputSanitizationConfig: InputSanitizationConfig; export declare const defaultSecurityConfig: SecurityConfig; export declare function generateCSRFToken(length?: number): string; export declare function hashToken(token: string, secret: string): string; export declare function verifyCSRFToken(token: string, secret: string, hashedToken: string): boolean; export declare function sanitizeHtml(input: string, allowedTags?: string[]): string; export declare function escapeHtml(input: string): string; export declare function escapeSql(input: string): string; export declare function preventPathTraversal(input: string): string; export declare function validateMimeType(mimeType: string, allowedTypes: string[]): boolean; export declare function validateFileSize(size: number, maxSize: number): boolean;