import { i as WithoutWebsocket, n as HonoServerOptionsBase, r as WithWebsocket, t as createGetLoadContext } from "../helpers-CvvzWAWX.js"; import { ServerType } from "@hono/node-server"; import { ServeStaticOptions } from "@hono/node-server/serve-static"; import { Env, Hono } from "hono"; import { BlankEnv } from "hono/types"; import { ServerOptions, createServer } from "node:http"; import { SecureServerOptions, ServerOptions as ServerOptions$1, createSecureServer, createServer as createServer$1 } from "node:http2"; import { AddressInfo } from "node:net"; import { ServerOptions as ServerOptions$2, createServer as createServer$2 } from "node:https"; //#region src/types/node.https.d.ts type createHttpOptions = { serverOptions?: ServerOptions; createServer?: typeof createServer; }; type createHttpsOptions = { serverOptions?: ServerOptions$2; createServer?: typeof createServer$2; }; type createHttp2Options = { serverOptions?: ServerOptions$1; createServer?: typeof createServer$1; }; type createSecureHttp2Options = { serverOptions?: SecureServerOptions; createServer?: typeof createSecureServer; }; type CreateNodeServerOptions = createHttpOptions | createHttpsOptions | createHttp2Options | createSecureHttp2Options; //#endregion //#region src/adapters/node.d.ts interface HonoNodeServerOptions extends HonoServerOptionsBase { /** * Listening listener (production mode only) * * It is called when the server is listening * * Defaults log the port */ listeningListener?: (info: AddressInfo) => void; /** * Customize the node server (ex: using http2) * * {@link https://hono.dev/docs/getting-started/nodejs#http2} */ customNodeServer?: CreateNodeServerOptions; /** * Callback executed just after `serve` from `@hono/node-server` */ onServe?: (server: ServerType) => void; /** * The Node.js Adapter rewrites the global Request/Response and uses a lightweight Request/Response to improve performance. * * If you this behavior, set it to `true` * * 🚨 Setting this to `true` can break `request.clone()` if you later check `instanceof Request`. * * {@link https://github.com/honojs/node-server?tab=readme-ov-file#overrideglobalobjects} * * @default false */ overrideGlobalObjects?: boolean; /** * Customize the hostname of the node server */ hostname?: string; /** * Customize the serve static options */ serveStaticOptions?: { /** * Customize the public assets (what's in your `public` directory) serve static options. * */ publicAssets?: Omit, "root">; /** * Customize the client assets (what's in your `build/client/assets` directory - React Router) serve static options. * */ clientAssets?: Omit, "root">; }; } type HonoServerOptionsWithWebSocket = HonoNodeServerOptions & WithWebsocket; type HonoServerOptionsWithoutWebSocket = HonoNodeServerOptions & WithoutWebsocket; type HonoServerOptions = HonoServerOptionsWithWebSocket | HonoServerOptionsWithoutWebSocket; /** * Create a Hono server * * @param config {@link HonoServerOptions} - The configuration options for the server */ declare function createHonoServer(options?: HonoServerOptionsWithoutWebSocket): Promise>; declare function createHonoServer(options?: HonoServerOptionsWithWebSocket): Promise>; //#endregion export { HonoServerOptions, createGetLoadContext, createHonoServer };