import type { AppManifest, EdenConfig, TileLayoutDirection, TileLayoutState, ViewBounds, WindowSize } from "@edenapp/types"; import { CommandRegistry, EdenEmitter, IPCBridge } from "../ipc"; import { type Bounds, type DisplayPort, type PlatformView, type PlatformWindow, type WindowingPort } from "../platform/ports"; import { SettingsManager } from "../settings/SettingsManager"; import { type ViewInfo, type ViewMode } from "./types"; /** * Events emitted by the ViewManager */ export interface ViewManagerEvents { "view-removed": { viewId: number; appId: string; webContentsId: number; }; "bounds-updated": ViewBounds; "interface-scale-changed": { scale: number; }; "view-loaded": { viewId: number; appId: string; overlay: boolean; }; "view-load-failed": { viewId: number; appId: string; errorCode: number; errorDescription: string; }; "mode-changed": { mode: "floating" | "tiled"; bounds: ViewBounds; }; "global-bounds-changed": { workspaceBounds: ViewBounds; windowSize: WindowSize; }; } /** * ViewManager * * Central orchestrator for view management in Eden. */ export declare class ViewManager extends EdenEmitter { private windows; private views; private mainWindow; private readonly tilingController; private readonly floatingWindows; private readonly presentationController; private readonly viewCreator; private readonly devToolsController; private readonly scaleController; private windowSize; private viewHandler; constructor(commandRegistry: CommandRegistry, ipcBridge: IPCBridge, config: EdenConfig, distPath: string, settingsManager: SettingsManager, windows: WindowingPort, display: DisplayPort); private markViewFocused; private handleInterfaceScaleChanged; private attachFocusTracking; /** * Set the main window that will host the views */ setMainWindow(window: PlatformWindow): void; updateGlobalBounds(bounds: ViewBounds, windowSize: WindowSize): void; /** * Set workspace bounds (the area where views can be placed) */ setWorkspaceBounds(bounds: Bounds): void; /** * Apply tiling visibility rules in one pass, then recalculate tile bounds. * Returns true when any view visibility changed. */ private syncTiledLayout; setWindowSize(windowSize: WindowSize): void; getWindowSize(): WindowSize; /** * Create a view for an app or overlay */ createView(appId: string, manifest: AppManifest, installPath: string, bounds: Bounds | undefined, launchArgs?: string[]): number; /** * Remove a view */ removeView(viewId: number): void; /** * Update view bounds */ setViewBounds(viewId: number, bounds: Bounds, options?: { notify?: boolean; }): void; private applyViewBounds; /** * Get view by ID */ getView(viewId: number): PlatformView | undefined; /** * Get view info */ getViewInfo(viewId: number): ViewInfo | undefined; /** * Find views by app ID */ getViewsByAppId(appId: string): number[]; /** * Get app ID from a webContents ID */ getAppIdByWebContentsId(webContentsId: number): string | undefined; /** * Get view ID from a webContents ID */ getViewIdByWebContentsId(webContentsId: number): number | undefined; /** * Get all views (as entries for iteration) */ getAllViews(): [number, ViewInfo][]; getTileLayoutState(viewId: number): TileLayoutState; swapTiledView(viewId: number, direction: TileLayoutDirection): TileLayoutState; expandTiledView(viewId: number, direction: TileLayoutDirection): TileLayoutState; /** * Show a view (bring to front) */ showView(viewId: number): void; /** * Focus a view's webContents (does not change bounds). */ focusView(viewId: number): void; /** * Hide a view by setting its bounds to zero */ hideView(viewId: number): void; /** * Reorder all views to maintain proper layering */ private reorderViewLayers; /** * Send message to view's webContents */ sendToView(viewId: number, channel: string, ...args: unknown[]): boolean; /** * Send message to the main window (foundation layer) */ sendToMainWindow(channel: string, ...args: unknown[]): boolean; /** * Get all active view IDs */ getActiveViews(): number[]; /** * Toggle or set view mode between tiled and floating */ setViewMode(viewId: number, targetMode?: ViewMode): void; /** * Get the current interface scale factor */ getCurrentScale(): number; /** * Set the interface scale for all views * @param scale - Zoom factor (e.g., 1.0 = 100%, 1.5 = 150%) */ setInterfaceScale(scale: number): void; setKeyboardPresentationLift(lift: number): void; getKeyboardPresentationLift(): number; private applyPresentedBounds; private reapplyPresentedBounds; dispose(): void; } //# sourceMappingURL=ViewManager.d.ts.map