import { type BuildOptions } from "@opennextjs/aws/build/helper.js"; import type { ProjectOptions } from "../project-options.js"; /** * Imports left external in the server bundle. * * - The middleware is bundled separately. * - `cloudflare:*` modules are provided by workerd and resolved by wrangler, i.e. the static * `import { connect } from "cloudflare:sockets"` of the `workerd` build of `postgres` 4. */ export declare const serverExternals: string[]; /** * Returns the aliases replacing the Next.js modules that are not used or not supported on Workers. * * They are shared by the server and the Node.js middleware bundles. * * @param shimsDir The directory of the shims. * @param useOg Whether the bundle uses `@vercel/og`. * @returns The esbuild aliases. */ export declare function getShimAliases(shimsDir: string, useOg: boolean): Record; /** * Bundle the Open Next server. * * @param buildOpts Build options. * @param projectOpts Cloudflare project options. * @returns Resolves when the server bundle and Worker entry point have been written. * @throws When preparing or bundling the server fails. */ export declare function bundleServer(buildOpts: BuildOptions, projectOpts: ProjectOptions): Promise; /** * Restores esbuild's `__require` helper to a bare `require`. * * esbuild rewrites `require(...)` calls to its own `__require(...)` helper, which throws * "Dynamic require of ... is not supported" at runtime. Workers provide a real `require` * via `nodejs_compat`, so the helper is renamed back. * * Only identifiers are renamed. `@rollup/plugin-commonjs` publishes `exports.__require` * lazy-init wrappers, so a name preceded by `.`, `#`, `$` or a word character belongs to * bundled code and is left alone. */ export declare function patchRequireHelper(code: string): string; /** * This function apply updates to the bundled code. */ export declare function updateWorkerBundledCode(workerOutputFile: string): Promise; /** * Gets the path of the worker.js file generated by the build process * * @param buildOpts the open-next build options * @returns the path of the worker.js file that the build process generates */ export declare function getOutputWorkerPath(buildOpts: BuildOptions): string;