import { ErrorRequestHandler, Request, RequestHandler } from 'express';
/**
 * Express error handling middleware that serializes an {@link AppError} to a
 * JSON response and logs it.
 *
 * @param _console - Console object for logging (for testing purposes)
 */
export declare const createErrorHandler: ({ _console, }?: {
    _console?: typeof console;
}) => ErrorRequestHandler;
/**
 * Extended Express request type with additional properties added by the
 * middleware.
 *
 * @property rawBody - Raw request body buffer used for HMAC signature
 *   verification
 * @property amoRequestId - Value of the incoming `X-AMO-Request-ID` header, or
 *   a generated UUID when the header is absent. Exposed for convenience (e.g.
 *   logging) in addition to being stored in the request context.
 */
export type RequestWithExtraProps = Request & {
    rawBody?: Buffer;
    amoRequestId?: string;
};
/**
 * Configuration options for creating an Express application.
 *
 * @property _console - Console object for logging (for testing purposes)
 * @property _process - Process object for environment variables (for testing
 *   purposes)
 * @property apiKeyEnvVarName - Environment variable name for the API key
 * @property maxRequestBodySize - Controls the maximum request body size. If
 *   this is a number, then the value specifies the number of bytes; if it is a
 *   string, the value is passed to the bytes library for parsing.
 */
export type FunctionConfig = {
    _console?: typeof console;
    _process?: typeof process;
    apiKeyEnvVarName?: string;
    maxRequestBodySize?: string | number;
};
/**
 * Easily create a new scanner application with built-in authentication
 * middleware. The middleware validates that the content-type is
 * `application/json`, authenticates the request, and ensures the method is
 * POST. Appropriate HTTP error codes are returned for various failure
 * scenarios:
 * - 400 (bad request)
 * - 401 (unauthorized)
 * - 404 (not found)
 * - 405 (method not allowed)
 * - 415 (unsupported media type)
 * - 500 (internal server error)
 *
 * @remarks
 * **Environment Variables:**
 * - `LAMBDA_API_KEY` - Required. API key for authentication (configurable
 *   via `apiKeyEnvVarName`)
 *
 * **Authentication:**
 * - HMAC-SHA256: `Authorization: HMAC-SHA256 <digest>` (digest of request
 *   body)
 */
export declare const createExpressApp: ({ _console, _process, apiKeyEnvVarName, maxRequestBodySize, }?: FunctionConfig) => (handler: RequestHandler) => import("express-serve-static-core").Express;
export * from './api';
export * from './auth';
export * from './download';
export * from './error';
export * from './request-context';
