import { NextConfig } from 'next'; import { NextRequest, NextResponse } from 'next/server.js'; declare function getPopmeltProjectId(projectRoot?: string): string | null; /** * Popmelt middleware handler for Next.js. * Call at the top of your middleware function to expose the project-scoped * /popmelt/status bootstrap used by the embedded toolbar. * * Returns a Response if the request was handled, or null if it should continue * to your normal middleware logic. * * @example * ```ts * import { popmeltMiddleware } from '@popmelt.com/core/next'; * * export async function middleware(request: NextRequest) { * const popmeltResponse = popmeltMiddleware(request); * if (popmeltResponse) return popmeltResponse; * * // ... your normal middleware logic * } * ``` */ declare function popmeltMiddleware(request: NextRequest, options?: { port?: number; basePath?: string; projectRoot?: string; projectId?: string; }): NextResponse | Promise | null; declare function withPopmelt(config: NextConfig, options?: { port?: number; projectRoot?: string; projectId?: string; }): NextConfig; export { getPopmeltProjectId, popmeltMiddleware, withPopmelt };