import type { Domicile } from "./desktop/desktop"; import type { ClientWindow } from "./desktop/windows"; import type { DomicileBrowserWindow, DomicileHost, DomicileHostEventMap, DomicileWindow } from "./domicile-host"; /** The attributes of the desktop a test sets. */ export type DomicileState = { -readonly [K in keyof DomicileHost as DomicileHost[K] extends (...args: never[]) => unknown ? never : K]: DomicileHost[K]; }; /** {@link describedWindow} as `Domicile.windows.list` reads it. */ export declare const listedWindow: (appId: string, fields?: Partial) => ClientWindow; /** A window as the engine lists it before its client has sent anything. */ export declare const describedWindow: (appId: string, fields?: Partial) => DomicileWindow; export declare class FakeDomicileHost { #private; /** Every call the shell made, in order: the method's name, then its arguments. */ readonly calls: (readonly [method: string, ...args: unknown[]])[]; /** The raw host the engine draws the desktop from. */ readonly host: DomicileHost; /** What the shell is handed as its desktop: {@link desktop} of `host`. */ get domicile(): Domicile; constructor(); /** Set attributes, then dispatch each change event they owe, once. */ set(changes: Partial): void; /** A window appeared: the end of `windows`. */ appear(appId: string, fields?: Partial): void; /** What the compositor says of a window that is open. */ change(appId: string, fields: Partial): void; /** A window closed. */ close(appId: string): void; /** * The engine opened a browser window at `url`, as for `domicile open`, * `target="_blank"`, with `popupWindow` an extension's popup window, or with * `isApp` `domicile open --app`. `openBrowserWindow` calls this too, and * `openPrivateBrowserWindow` with `isPrivate`, and `openApp` with `isApp` * and `appId`. Ids count up from `"1"`; the asked-for size is 0 unless * `width` and `height` give one. With a `parent`, it is an Electron app's * view in that window, at `x` and `y`. It is in `profile`, or as the * engine picks: none for an app window (an app module's or Electron * app's; `openApp` names one), else the default private profile * when `isPrivate` and the default one otherwise, from `browserProfiles` * or the config's own `default` and `private`. */ openBrowser(url: string, { appId, isApp, isHidden, isPrivate, parent, partition, popupWindow, profile, width, height, x, y, }?: Partial>): void; /** * `openAppWindow`, as the engine carries it out: reuses the oldest app * window with `appId` unless `reuse` is "new", loading `url` in it for * "navigate", and otherwise opens one. */ openApp(url: string, appId: string, reuse: string, profile?: string): void; /** * A capture of browser window `id`'s page alone started, or with `captured` * false ended, as the engine lists it. */ captureBrowser(id: string, captured?: boolean): void; /** * Browser window `id`'s Electron app set its menu bar: `menu` as the engine * lists it (JSON entries), or null for none. */ setMenuBar(id: string, menu: string | null, { autoHide, visible }?: { autoHide?: boolean | undefined; visible?: boolean | undefined; }): void; /** * Browser window `id` shows its Electron app's popup menu `menu`, as the * engine lists it (JSON), or null for none. */ /** * Browser window `id`'s Electron app asks to be maximized, minimized or * fullscreen, as the engine lists it. */ setWantedState(id: string, wants: Partial>): void; /** * Browser window `id`'s Electron app asks for the user's attention, lets * the pointer through or shapes it, as the engine lists it. */ setLooks(id: string, looks: Partial>): void; /** * Browser window `id` shows its Electron app's popup menu `menu`, as the * engine lists it (JSON), or null for none. */ setPopupMenu(id: string, menu: string | null): void; /** * Browser window `id` shows its Electron app's message box `box`, as the * engine lists it (JSON), or null for none. */ setMessageBox(id: string, box: string | null): void; /** * The engine moved browser window `id`'s page to browser profile `profile`, * as for a link to another profile's site. `reopenBrowserWindow` calls this * too. */ moveBrowser(id: string, profile: string): void; /** * The site of `browserProfiles`' sites that routes `url`, as the engine's * `browserSiteFor` matches it: the most specific, a path over a host and a * host over `*.host`. Empty for none. */ siteFor(url: string): string; /** * Pins `site` to profile `id`, as the engine's `pinBrowserSite` does: out of * every profile's `pinnedSites`, then into `id`'s unless it is the default. * Rejects as the engine does for one of the config's sites. */ pin(site: string, id: string): Promise; /** * Switches extension `id` in profile `profile`, as the engine's * `setBrowserProfileExtensionEnabled` does. Rejects as the engine does for * one the profile does not have, or one in its `lockedExtensions`. */ switchExtension(profile: string, id: string, enabled: boolean): Promise; /** The engine closed browser window `id`. `closeBrowserWindow` calls this too. */ closeBrowser(id: string): void; /** Dispatch a moment, such as `shortcut` or `focusrequested`, with its fields. */ dispatch(type: T, fields?: Partial>): void; }