/**
 * Authentication Middleware
 *
 * Handles API key and JWT authentication for incoming requests.
 */
import type { Request, Response, NextFunction } from 'express';
import { hasScope as _hasScope } from '../auth/api-keys.js';
import type { ApiScope, AuthenticatedRequest, ServerConfig } from '../types.js';
export declare const hasScope: typeof _hasScope;
declare global {
    namespace Express {
        interface Request {
            auth?: AuthenticatedRequest['auth'];
        }
    }
}
/**
 * Create authentication middleware
 */
export declare function createAuthMiddleware(config: ServerConfig): (req: Request, res: Response, next: NextFunction) => Promise<void | Response<any, Record<string, any>>>;
/**
 * Create scope checking middleware
 */
export declare function requireScope(...scopes: ApiScope[]): (req: Request, res: Response, next: NextFunction) => void | Response<any, Record<string, any>>;
/**
 * Optional authentication middleware (sets auth if present, but doesn't require it)
 */
export declare function optionalAuth(config: ServerConfig): (req: Request, res: Response, next: NextFunction) => Promise<void>;
