import { ApiError } from "../../../../fd-toolbox/server/framework";
import { DynamicParams, QueryParams } from "./dynamic-params";
/** To do: add docs */
export type RequestHandler = (req: Request, params: DynamicParams) => Promise<Response>;
/**
 * Configuration options for the {@link httpApiWrapper}.
 * Allows customizing API route behavior, such as forbidding on production or allowing anonymous access.
 */
export interface HttpApiWrapperConfig {
    /** Whether the route is forbidden in production environments */
    forbidOnProd?: boolean;
    /** Whether to disables authentication/authorization for the route */
    anonymous?: boolean;
}
/**
 * Creates an HTTP API wrapper with injected database schema.
 * @param schema - The database schema to use for initialization
 */
export declare function createHttpApiWrapper(): (handler: RequestHandler, config?: HttpApiWrapperConfig) => (request: Request, { params }: {
    params: Promise<Partial<QueryParams>>;
}) => Promise<Response>;
/**
 * Converts an {@link ApiError} into a standardized HTTP JSON response.
 * In production, hides sensitive error details. In development, includes stack and cause.
 *
 * @param error - The {@link ApiError} to handle.
 */
export declare function handleApiError(error: ApiError): Response;
/**
 * Converts a generic Error into a standardized HTTP JSON response.
 * In production, hides sensitive error details and uses a user-friendly message if available.
 *
 * @param error - The Error to handle.
 */
export declare function handleGeneralError(error: Error): Response;
