import type { LaunchBrowserResult, LaunchOptions as PlaywrightLaunchOptions, LaunchPersistentContextResult } from "../../generated/dependencies.js"; import type { Dependencies } from "./dependencies.js"; type BaseBrowserLaunchOptions = Omit; export type IncognitoBrowserLaunchOptions = BaseBrowserLaunchOptions & { browserContext?: "incognito"; kind?: "browser"; }; export type PersistentBrowserLaunchOptions = BaseBrowserLaunchOptions & { browserContext: "persistent"; kind?: "browser"; userDataDir?: string; }; /** * Starts Electron automation from the "Electron" web target by launching a * desktop app executable. */ export type ElectronLaunchOptions = { /** * Absolute or flow-relative path to the Electron app executable to launch. */ executablePath: string; kind?: "electron"; }; /** * Configures Electron startup from `flow(..., { target: "Electron", launch })`. * * The flow target already identifies Electron, so flow launch options omit the * standalone `launch()` discriminator. */ export type ElectronFlowLaunchOptions = { /** * Absolute or flow-relative path to the Electron app executable to launch. */ executablePath: string; kind?: never; }; /** * Configures how a web flow launches a browser session. * * Omit `browserContext` to use an incognito-style context. Set it to * `"persistent"` to reuse profile data through `userDataDir`. */ export type BrowserLaunchOptions = IncognitoBrowserLaunchOptions | PersistentBrowserLaunchOptions; /** * Configures how a web flow starts browser or Electron automation. * * When omitted, `launch()` starts a browser session using the flow target's * browser with an incognito-style context. */ export type LaunchOptions = BrowserLaunchOptions | ElectronLaunchOptions; /** * The active automation objects returned by `launch()` for web flows. * * Browser launches return Playwright browser, context, and page objects. * Electron launches return the Electron application plus its first window page. */ export type LaunchResult = AnonymousLaunchResult | PersistentLaunchResult | Awaited>; export type AnonymousLaunchResult = LaunchBrowserResult; export type PersistentLaunchResult = LaunchPersistentContextResult; export type ElectronLaunchResult = Awaited>; export declare const getDependencies: () => import("../../generated/dependencies.js").WebDependencies, runWithDependencies: ({ callback, dependencies, }: { callback: () => Promise; dependencies: import("../../generated/dependencies.js").WebDependencies; }) => Promise; /** * Checks whether the currently configured execution target is Electron. * * Returns true when the flow is running against an Electron target. */ export declare function isElectronTarget(): boolean; export declare function isElectronLaunchOptions(options: LaunchOptions | undefined): options is ElectronLaunchOptions; export declare function isAnonymous(result: LaunchResult): result is AnonymousLaunchResult; export declare function isPersistent(result: LaunchResult): result is PersistentLaunchResult; export declare function isElectron(result: LaunchResult): result is ElectronLaunchResult; export {}; //# sourceMappingURL=runtime.d.ts.map