import { AddressInfo } from 'node:net'; 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 { H as HonoServerOptionsBase, a as WithWebsocket, W as WithoutWebsocket } from '../helpers-BXdVojwF.js'; export { c as createGetLoadContext } from '../helpers-BXdVojwF.js'; import { ServerOptions, createServer } from 'node:http'; import { ServerOptions as ServerOptions$2, createServer as createServer$2, SecureServerOptions, createSecureServer } from 'node:http2'; import { ServerOptions as ServerOptions$1, createServer as createServer$1 } from 'node:https'; import 'hono/ws'; import 'react-router'; type createHttpOptions = { serverOptions?: ServerOptions; createServer?: typeof createServer; }; type createHttpsOptions = { serverOptions?: ServerOptions$1; createServer?: typeof createServer$1; }; type createHttp2Options = { serverOptions?: ServerOptions$2; createServer?: typeof createServer$2; }; type createSecureHttp2Options = { serverOptions?: SecureServerOptions; createServer?: typeof createSecureServer; }; type CreateNodeServerOptions = | createHttpOptions | createHttpsOptions | createHttp2Options | createSecureHttp2Options; 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>; export { type HonoServerOptions, createHonoServer };