export interface ElectronFloatFlags { cdpPort: number; servePort: number; targetUrl: string; } export interface ElectronServerSpawnConfig { command: string; args: string[]; } export interface ElectronAppLaunchSpec { command: string; args: string[]; displayName: string; resolvedAppPath: string; processMatchPatterns: string[]; } export interface ElectronInspectableTarget { /** CDP target id as reported by the `/json` endpoint. */ id?: string; type: string; title?: string; url: string; webSocketDebuggerUrl?: string; } export declare const DEFAULT_ELECTRON_SERVE_PORT = 5710; export declare const DEFAULT_ELECTRON_SERVE_HOST = "localhost"; export declare const DEFAULT_ELECTRON_CDP_PORT = 9223; export declare const DEFAULT_ELECTRON_TARGET_URL = "about:blank"; export declare const PORT_HASH_RANGE = 40; /** * Simple string hash function that returns a value between 0 and max-1. * Exported for testing. */ export declare function hashString(str: string, max: number): number; /** * Get a port for an Electron app based on its path. * Uses hash-based offset from base port, with fallback to next available port * starting from the preferred port (to stay in the app's "slot" range). */ export declare function getElectronAppPort(appPath: string, basePort: number): Promise; /** * Get both CDP and serve ports for an Electron app. */ export declare function getElectronAppPorts(appPath: string): Promise<{ cdpPort: number; servePort: number; }>; export declare function getElectronAppDisplayName(appPath: string): string; export declare function resolveElectronAppExecutablePath(appPath: string, platform?: NodeJS.Platform): string; export declare function buildElectronAppProcessMatchPatterns(appPath: string, platform?: NodeJS.Platform): string[]; export declare function buildElectronAppLaunchSpec(appPath: string, options: { cdpPort: number; platform?: NodeJS.Platform; }): ElectronAppLaunchSpec; export declare function parseElectronFloatFlags(argv: string[], env?: Record): ElectronFloatFlags; export declare function buildElectronServerSpawnConfig(projectRoot: string, options: { cdpPort: number; nodePath?: string; }): ElectronServerSpawnConfig; export declare function getElectronServeOrigin(servePort: number): string; export declare function getElectronOverlayEntryDistPath(projectRoot: string): string; export declare function buildElectronOverlayInjectionCall(options: { appUrl: string; open?: boolean; activeTab?: string; /** Empty-viewport message for the status-only overlay (apps that block the * embedded panel, e.g. Signal). Only meaningful when `appUrl` is empty. */ statusMessage?: string; }): string; export declare function buildElectronOverlayBootstrapScript(options: { bundleSource: string; appUrl: string; open?: boolean; activeTab?: string; statusMessage?: string; }): string; export declare function shouldInjectElectronOverlayTarget(target: ElectronInspectableTarget): boolean; /** * From a list of injectable targets, select the best target per origin. * Multi-window apps (like Teams) expose several page targets for the same origin; * we only want to inject the overlay into the primary content window. */ export declare function selectBestOverlayTargets(targets: ElectronInspectableTarget[]): ElectronInspectableTarget[];