import type { Server } from 'bun'; import type { RuntimeHost, RuntimeHostStartOptions } from '../shared/runtime/runtime-host.js'; type BunRuntimeProvider = { serve(options: Bun.Serve.Options): Server; }; /** * Bun runtime host that adapts the shared runtime lifecycle contract onto * `Bun.serve()`. * * @remarks * The injected runtime provider exists so tests and non-Bun call sites can * construct the host without assuming `globalThis.Bun` is present. The provider * returns `null` instead of `undefined` to keep that absence explicit at the * host boundary. */ export declare class BunRuntimeHost implements RuntimeHost, Bun.Serve.Options> { private readonly runtimeProvider; /** * Creates a Bun runtime host with an injectable runtime lookup. * * @remarks * Production code uses the default `getBunRuntime()` lookup. Tests may inject a * fake provider that either supplies a `serve()` implementation or returns * `null` to verify the runtime-required failure path. */ constructor(runtimeProvider?: () => BunRuntimeProvider | null); /** * Starts the Bun server using the already-composed serve options from the * shared application bootstrap. */ start(options: RuntimeHostStartOptions>): Promise>; /** * Stops the active Bun server immediately. * * @remarks * The shared runtime-host contract accepts optional stop options, but Bun's * server API already models the shutdown behavior directly. This host always * uses Bun's forceful stop path so preview and embedded runtime shutdowns do * not linger on open connections. */ stop(server: Server): Promise; /** * Resolves the externally reported runtime origin from the active server. * * @remarks * Bun may finalize the hostname or port differently from the requested serve * options. This method prefers the live server binding and only falls back to * the requested options when Bun leaves a field unset. */ getOrigin(server: Server, fallbackServeOptions: Bun.Serve.Options): string; } export {};