import { Serve } from 'bun'; import { Env } from 'hono'; import { ServeStaticOptions } from 'hono/serve-static'; 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 'hono/ws'; import 'react-router'; type CustomBunServer = Serve.Options; interface HonoBunServerOptions extends HonoServerOptionsBase { /** * Customize the bun server * * {@link https://bun.sh/docs/api/http#start-a-server-bun-serve} */ customBunServer?: Partial; /** * Callback executed after server has closed and all inflight requests completed, * before process exit. Only applicable in production mode. * * @example * ```ts * export default createHonoServer({ * onGracefulShutdown: async () => { * await db.close(); * }, * }); * ``` */ onGracefulShutdown?: () => Promise | void; /** * 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 = HonoBunServerOptions & WithWebsocket; type HonoServerOptionsWithoutWebSocket = HonoBunServerOptions & WithoutWebsocket; type HonoServerOptions = HonoServerOptionsWithWebSocket | HonoServerOptionsWithoutWebSocket; /** * Create a Hono server * * @param HonoServerOptions options {@link HonoServerOptions} - The configuration options for the server */ declare function createHonoServer(options?: HonoServerOptionsWithoutWebSocket): Promise; declare function createHonoServer(options?: HonoServerOptionsWithWebSocket): Promise; export { type HonoServerOptions, createHonoServer };