/**
 * Electron app orchestrator.
 *
 * Launches a modern (contextIsolation + preload) Electron app in dev mode:
 *  1. Resolve the `main` entry, the renderer root, and the preload script.
 *  2. Start a ViteDevServer for the renderer with the preload/contextBridge
 *     bootstrap injected into `<head>` (see electron-preload.ts).
 *  3. Expose the renderer URL via the env vars dev-mode apps read
 *     (VITE_DEV_SERVER_URL / ELECTRON_RENDERER_URL) and a private var the
 *     electron shim uses to rewrite `loadURL('http://localhost:*')`.
 *  4. Run the main entry through the runtime; `app`/`BrowserWindow`/`ipcMain`
 *     take over from there (windows render via the registered host).
 */
import type { Runtime } from '../runtime';
import type { VirtualFS } from '../virtual-fs';
export interface ElectronLaunchContext {
    vfs: VirtualFS;
    runtime: Runtime;
    onLog?: (line: string) => void;
}
export interface ElectronAppInstance {
    rendererPort: number;
    rendererUrl: string;
    mainPath: string;
    /** Resolves with the exit code when the app quits itself (app.quit/exit). */
    whenQuit: Promise<number>;
    close: () => void;
}
/**
 * Resolve the main-process entry to a file that exists on disk. Prefers
 * `pkg.main`; when that points at an unbuilt output (electron-vite →
 * `out/main/index.js`, vite-plugin-electron → `dist-electron/main/index.js`),
 * falls back to the conventional source entry so the app runs without a
 * separate main-process build. Returns null if nothing runnable is found.
 */
export declare function resolveMainEntry(vfs: VirtualFS, appDir: string, pkg: Record<string, unknown>): string | null;
/**
 * Whether a preload script imports a bare npm specifier other than `electron` —
 * i.e. something a single-file transform would leave as an unresolvable
 * `require` (e.g. `@electron-toolkit/preload`). Relative/absolute imports and
 * `electron`/`electron/*` don't count. Used to decide whether to bundle.
 */
export declare function preloadImportsBareModule(source: string): boolean;
/**
 * Launch an Electron app from source. `appDir` is the project root (contains
 * package.json). Returns once the main entry has been evaluated; windows open
 * asynchronously as the app reacts to `app` becoming ready.
 */
export declare function launchElectronApp(appDir: string, ctx: ElectronLaunchContext): Promise<ElectronAppInstance>;
//# sourceMappingURL=electron-app.d.ts.map