import { NextFetchEvent, NextRequest, NextResponse } from "next/server";

//#region src/proxy/multipleProxies.d.ts

/**
 * Utility to combine multiple Next.js proxies into one.
 *
 * It executes proxies in order, merges headers, and correctly handles
 * redirects and rewrites.
 *
 * @example
 * import { multipleProxies, intlayerProxy } from "next-intlayer/proxy";
 * import { NextResponse } from "next/server";
 *
 * const authMiddleware = (req: NextRequest) => {
 *   if (!req.cookies.get("token")) {
 *     return NextResponse.redirect(new URL("/login", req.url));
 *   }
 *   return NextResponse.next();
 * };
 *
 * export default multipleProxies([
 *   intlayerProxy,
 *   authMiddleware,
 * ]);
 *
 * @param proxies - An array of proxy functions to execute in order.
 * @returns A single proxy function that runs all provided proxies.
 */
declare const multipleProxies: (proxies: ((req: NextRequest, event?: NextFetchEvent, response?: NextResponse) => NextResponse | Promise<NextResponse>)[]) => (req: NextRequest, event?: NextFetchEvent, response?: NextResponse) => Promise<NextResponse<unknown>>;
//#endregion
export { multipleProxies };
//# sourceMappingURL=multipleProxies.d.ts.map