import type { ViteDevServer } from 'vite'; import { type RuntimeControlMessage, type RuntimeReport } from '../../../../runtime/mini/dev/hmr-protocol.ts'; import type { MiniContract } from '../mini-contract.ts'; import type { MiniStylePlugin } from '../styles/plugins.ts'; import type { MiniHmrMode } from './hmr-mode.ts'; declare module 'vite' { interface CustomEventMap { 'vpt:mini-hmr:control': RuntimeControlMessage; 'vpt:mini-hmr:report': RuntimeReport; } } export type MiniDevHost = Readonly<{ close: () => Promise; }>; /** * Creates the Mini Program dev host: the adapter that owns the physical Rolldown DevEngine and selected update mode effects. * It replaces Vite's browser-oriented `bundledDev.listen()` because a Mini Program cannot execute Vite's browser module graph; * its engine must write a native project and either replace complete output or deliver environment-valid patches. * * The shared style plugin carries the resolver's immutable App/Page cascade policy while Rolldown remains authoritative for * every live import edge. Keeping those responsibilities in the same serialized host transaction prevents JavaScript factories, * physical native styles, and Rolldown's published frontier from describing different source generations. */ export declare function createMiniDevHost({ server, contract, styles, hmrMode }: { server: ViteDevServer; contract: Pick; styles: MiniStylePlugin; hmrMode: MiniHmrMode; }): Promise;