import { EventEmitter } from "node:events"; import type { AppChannelPort, ApplicationLifecycleEvent, ApplicationLifecyclePort, Bounds, EdenPlatform, PlatformListener, PlatformMessagePort, PlatformProtocolRequest, PlatformUtilityProcess, PlatformView, PlatformViewOptions, PlatformWebContents, PlatformWindow, PlatformWindowOptions, RendererIpcEvent, RendererIpcPort, ResourceProtocolPort, ShortcutPort, ThemeStatePort, UtilityProcessPort, WindowingPort } from "../platform/ports"; type RecordedEffect = { type: "window-created"; options: PlatformWindowOptions; } | { type: "view-created"; options: PlatformViewOptions; } | { type: "file-loaded"; webContentsId: number; filePath: string; } | { type: "url-loaded"; webContentsId: number; url: string; } | { type: "message-sent"; webContentsId: number; channel: string; args: unknown[]; } | { type: "utility-process-started"; pid: number; modulePath: string; } | { type: "utility-process-stopped"; pid: number; } | { type: "quit"; }; export interface InMemoryPlatformOptions { failWindowCreation?: Error; } declare class InMemoryView implements PlatformView { readonly webContents: PlatformWebContents; private bounds; constructor(webContents: PlatformWebContents); setBounds(bounds: Bounds): void; getBounds(): Bounds; } declare class InMemoryWindow extends EventEmitter implements PlatformWindow { readonly webContents: PlatformWebContents; private bounds; private destroyed; private visible; private readonly children; readonly contentView: { addChildView: (view: PlatformView) => Set; removeChildView: (view: PlatformView) => boolean; }; constructor(webContents: PlatformWebContents, options: PlatformWindowOptions); on(event: string, listener: TListener): this; once(event: string, listener: TListener): this; removeListener(event: string, listener: TListener): this; loadFile(filePath: string): Promise; isDestroyed(): boolean; destroy(): void; close(): void; show(): void; showInactive(): void; hide(): void; focus(): void; isVisible(): boolean; getBounds(): Bounds; getContentBounds(): Bounds; setBounds(bounds: Bounds): void; setMovable(): void; setAlwaysOnTop(): void; setVisibleOnAllWorkspaces(): void; } declare class InMemoryWindowing implements WindowingPort { private readonly effects; private readonly options; private nextId; private readonly contents; readonly windows: InMemoryWindow[]; readonly views: InMemoryView[]; constructor(effects: RecordedEffect[], options: InMemoryPlatformOptions); createWindow(options: PlatformWindowOptions): PlatformWindow; createView(options: PlatformViewOptions): PlatformView; attachWebContentsLogger(): void; getWebContentsById(id: number): PlatformWebContents | undefined; get activeWebContentsCount(): number; private createWebContents; } declare class InMemoryRendererIpc implements RendererIpcPort { private readonly handlers; private readonly listeners; handle(channel: string, handler: (event: RendererIpcEvent, ...args: TArgs) => TResult | Promise): void; on(channel: string, listener: (event: RendererIpcEvent, ...args: TArgs) => void): void; removeHandler(channel: string): void; removeAllListeners(channel: string): void; invoke(channel: string, senderId: number, ...args: unknown[]): Promise; get registrationCount(): number; } declare class InMemoryUtilityProcesses implements UtilityProcessPort { private readonly effects; private nextPid; private readonly processes; constructor(effects: RecordedEffect[]); fork(modulePath: string): PlatformUtilityProcess; createMessageChannel(): { port1: PlatformMessagePort; port2: PlatformMessagePort; }; get activeCount(): number; } declare class InMemoryApplication implements ApplicationLifecyclePort { private readonly effects; private readonly userData; private readonly appPath; private readonly listeners; constructor(effects: RecordedEffect[], userData: string, appPath: string); appendCommandLineSwitch(): void; getPath(): string; getAppPath(): string; whenReady(): Promise; quit(): void; on(event: ApplicationLifecycleEvent, listener: () => void): () => void; completeQuit(): void; get listenerCount(): number; private add; } declare class InMemoryShortcuts implements ShortcutPort { private readonly callbacks; register(accelerator: string, callback: () => void): boolean; unregister(accelerator: string): void; unregisterAll(): void; get count(): number; } declare class InMemoryTheme implements ThemeStatePort { colorScheme: "light" | "dark" | "system"; private readonly listeners; onChanged(listener: () => void): () => void; get listenerCount(): number; } declare class InMemoryResourceProtocols implements ResourceProtocolPort { private handlers; registerSchemes(): void; handle(scheme: string, authorize: Parameters[1], handler: Parameters[2]): void; unhandle(scheme: string): void; get count(): number; request(scheme: string, request: PlatformProtocolRequest): Promise; } export declare class InMemoryPlatform implements EdenPlatform { readonly effects: RecordedEffect[]; readonly application: InMemoryApplication; readonly windows: InMemoryWindowing; readonly rendererIpc: InMemoryRendererIpc; readonly utilityProcesses: InMemoryUtilityProcesses; readonly appChannels: AppChannelPort; readonly display: { getCursorScreenPoint: () => { x: number; y: number; }; getDisplayMatching: () => { workArea: { x: number; y: number; width: number; height: number; }; }; }; readonly processMetrics: { getAppMetrics: () => never[]; }; readonly shortcuts: InMemoryShortcuts; readonly theme: InMemoryTheme; readonly resources: InMemoryResourceProtocols; constructor(root: string, options?: InMemoryPlatformOptions); requestResource(scheme: string, request: PlatformProtocolRequest): Promise; get activeResourceCount(): number; } export {}; //# sourceMappingURL=InMemoryPlatform.d.ts.map