/**
 * Common Middleware Components
 * Utility middleware for common server operations
 */
import type { MiddlewareDefinition, ServerContext } from "../types.js";
/**
 * Create request timing middleware
 * Adds timing information to responses
 *
 * @example
 * ```typescript
 * server.registerMiddleware(createTimingMiddleware());
 * ```
 */
export declare function createTimingMiddleware(): MiddlewareDefinition;
/**
 * Create request ID middleware
 * Ensures every request has a unique ID
 *
 * @example
 * ```typescript
 * server.registerMiddleware(createRequestIdMiddleware());
 * ```
 */
export declare function createRequestIdMiddleware(options?: {
    /** Header name to check for existing ID */
    headerName?: string;
    /** Prefix for generated IDs */
    prefix?: string;
    /** Custom ID generator */
    generator?: () => string;
}): MiddlewareDefinition;
/**
 * Create error handling middleware
 * Catches errors and formats them consistently
 *
 * @example
 * ```typescript
 * server.registerMiddleware(createErrorHandlingMiddleware({
 *   includeStack: process.env.NODE_ENV === 'development',
 * }));
 * ```
 */
export declare function createErrorHandlingMiddleware(options?: {
    /** Include stack trace in error response */
    includeStack?: boolean;
    /** Custom error handler */
    onError?: (error: Error, ctx: ServerContext) => unknown;
    /** Log errors */
    logErrors?: boolean;
}): MiddlewareDefinition;
/**
 * Create security headers middleware
 * Adds common security headers to responses
 *
 * @example
 * ```typescript
 * server.registerMiddleware(createSecurityHeadersMiddleware());
 * ```
 */
export declare function createSecurityHeadersMiddleware(options?: {
    /** Content Security Policy */
    contentSecurityPolicy?: string;
    /** X-Frame-Options (default: DENY) */
    frameOptions?: "DENY" | "SAMEORIGIN" | false;
    /** X-Content-Type-Options (default: nosniff) */
    contentTypeOptions?: "nosniff" | false;
    /** Strict-Transport-Security max age in seconds (default: 31536000) */
    hstsMaxAge?: number | false;
    /** Referrer-Policy (default: strict-origin-when-cross-origin) */
    referrerPolicy?: string | false;
    /** Additional custom headers */
    customHeaders?: Record<string, string>;
}): MiddlewareDefinition;
/**
 * Create request logging middleware
 * Logs request and response information
 *
 * @example
 * ```typescript
 * server.registerMiddleware(createLoggingMiddleware({
 *   logBody: process.env.NODE_ENV === 'development',
 * }));
 * ```
 */
export declare function createLoggingMiddleware(options?: {
    /** Log request body */
    logBody?: boolean;
    /** Log response body */
    logResponse?: boolean;
    /** Custom logger */
    logger?: {
        info: (message: string, data?: unknown) => void;
        error: (message: string, data?: unknown) => void;
    };
    /** Skip logging for certain paths */
    skipPaths?: string[];
}): MiddlewareDefinition;
/**
 * Create compression preference middleware
 * Signals compression preference to adapters
 */
export declare function createCompressionMiddleware(options?: {
    /** Minimum response size to compress (bytes) */
    threshold?: number;
    /** Content types to compress */
    contentTypes?: string[];
}): MiddlewareDefinition;
