/**
 * Security Headers Fastify Middleware
 *
 * Comprehensive middleware for applying security headers to HTTP responses.
 * Includes CSP, HSTS, CORS, Permissions Policy, and other security headers.
 *
 * @packageDocumentation
 * @module security/headers/middleware
 */
import type { FastifyRequest, FastifyPluginCallback } from 'fastify';
import type { SecurityHeadersConfig, CSPViolationReport } from './types.js';
/**
 * Security headers middleware options
 */
export interface SecurityHeadersMiddlewareOptions {
    /** Full configuration (overrides presets) */
    config?: Partial<SecurityHeadersConfig>;
    /** Use preset configuration */
    preset?: 'strict' | 'moderate' | 'relaxed' | 'api';
    /** Generate nonce per request for CSP */
    enableNonce?: boolean;
    /** Validate configuration on startup */
    validateOnStartup?: boolean;
    /** CSP violation report endpoint */
    cspReportEndpoint?: string;
    /** Callback for CSP violations */
    onCSPViolation?: (report: CSPViolationReport, request: FastifyRequest) => void;
    /** CORS origin validator function */
    corsOriginValidator?: (origin: string, request: FastifyRequest) => boolean;
    /** Paths to exclude from security headers */
    excludePaths?: string[];
}
/**
 * Request-specific context for security headers
 */
export interface SecurityHeadersContext {
    /** Generated CSP nonce for this request */
    nonce?: string;
}
declare module 'fastify' {
    interface FastifyRequest {
        securityHeaders?: SecurityHeadersContext;
    }
}
/**
 * Security headers Fastify plugin
 */
export declare const securityHeadersPlugin: FastifyPluginCallback<SecurityHeadersMiddlewareOptions>;
declare module 'fastify' {
    interface FastifyInstance {
        securityHeadersConfig?: SecurityHeadersConfig;
    }
}
/**
 * Create security headers middleware with strict defaults
 */
export declare function createStrictSecurityHeaders(): SecurityHeadersMiddlewareOptions;
/**
 * Create security headers middleware for API services
 */
export declare function createAPISecurityHeaders(): SecurityHeadersMiddlewareOptions;
/**
 * Create security headers middleware for development
 */
export declare function createDevelopmentSecurityHeaders(): SecurityHeadersMiddlewareOptions;
/**
 * Create security headers middleware with custom configuration
 */
export declare function createSecurityHeaders(config: Partial<SecurityHeadersConfig>, options?: Omit<SecurityHeadersMiddlewareOptions, 'config' | 'preset'>): SecurityHeadersMiddlewareOptions;
//# sourceMappingURL=middleware.d.ts.map