import { h as FetchHandler } from "./types-B5u76zpA.mjs"; //#region src/nextjs/types.d.ts type NextConfigShape = Record & { adapterPath?: string; allowedDevOrigins?: string[]; images?: Record; output?: string; }; interface NextAdapterContext { phase: string; nextVersion: string; } interface NextBuildCompleteContext { routing: Record; outputs: Record; projectDir: string; repoRoot: string; distDir: string; config: NextConfigShape; nextVersion: string; buildId: string; } interface NextAdapterShape { name: string; modifyConfig?: (config: NextConfigShape, ctx: NextAdapterContext) => Promise | NextConfigShape; onBuildComplete?: (ctx: NextBuildCompleteContext) => Promise | void; } interface NextjsFetchHandlerOptions { /** @defaultValue "127.0.0.1" */ hostname?: string; /** @defaultValue 30_000 */ startupTimeoutMs?: number; /** @defaultValue [] */ argv?: string[]; /** @defaultValue directory of the serverPath argument */ cwd?: string | URL; unstable_testing?: { ensureServer?: () => Promise; fetchImplementation?: typeof fetch; }; } interface NextjsBuildManifest { distRoot: string; takoEntrypoint: string; standaloneDir: string; standaloneServer: string; staticDir: string; publicDir: string; standaloneStaticDir: string; standalonePublicDir: string; } //#endregion //#region src/nextjs/adapter.d.ts declare function createNextjsAdapter(): NextAdapterShape; //#endregion //#region src/nextjs/fetch-handler.d.ts declare function createNextjsFetchHandler(serverEntrypoint: string | URL, options?: NextjsFetchHandlerOptions): FetchHandler; declare function shutdownManagedNextjsServers(): Promise; //#endregion //#region src/nextjs/index.d.ts /** * Wrap a Next.js config so it plays well with Tako. * * Forces `output: "standalone"` (required for Tako's deploy/runtime), sets * `adapterPath` to this module so Next uses the Tako adapter, and appends * `*.test` / `*.tako.test` to `allowedDevOrigins` so the dev proxy can hit * the Next dev server. It also configures `next/image` to use Tako's public * image optimizer globally. * * @typeParam T - The user's Next config type; preserved in the return type. * @param config - The Next.js config to augment. * @returns The augmented config with Tako-required fields applied. * * @example * ```typescript * // next.config.ts * import { withTako } from "tako.sh/nextjs"; * * export default withTako({ * reactStrictMode: true, * }); * ``` */ declare function withTako(config: T): T & NextConfigShape; declare const _default: NextAdapterShape; //#endregion export { type NextAdapterContext, type NextAdapterShape, type NextBuildCompleteContext, type NextConfigShape, type NextjsBuildManifest, type NextjsFetchHandlerOptions, createNextjsAdapter, createNextjsFetchHandler, _default as default, shutdownManagedNextjsServers, withTako }; //# sourceMappingURL=nextjs.d.mts.map