import type { TileLayoutDirection, TileLayoutState, TilingConfig, WindowConfig } from "@edenapp/types"; import type { Bounds } from "../platform/ports"; import type { ViewInfo, ViewMode } from "./types"; /** * TilingController * * Handles tiling calculations and view positioning for tiled window mode. * Extracted from ViewManager for better separation of concerns. */ export declare class TilingController { private readonly getInterfaceScale; private config; private workspaceBounds; private readonly expandedTiles; constructor(config?: TilingConfig, workspaceBounds?: Bounds, getInterfaceScale?: () => number); private scaleForView; /** * Update the workspace bounds used for tile calculations */ setWorkspaceBounds(bounds: Bounds): void; /** * Get current workspace bounds */ getWorkspaceBounds(): Bounds; /** * Update tiling configuration */ setConfig(config: TilingConfig): void; /** * Get current tiling configuration */ getConfig(): TilingConfig; /** * Check if tiling is enabled */ isEnabled(): boolean; private normalizeCount; private getEffectiveSmartConstraints; private getEffectiveConfig; private getSortedVisibleTiledViews; private calculateVisibleSetBounds; private getVisibleTiledViews; private getBaseLayout; private getNeighbor; private canCoverNeighbor; private combineBounds; private isExpansionParticipant; private findDirectionToView; getTileLayoutState(viewId: number, views: Map): TileLayoutState; swapTile(viewId: number, direction: TileLayoutDirection, views: Map): boolean; expandTile(viewId: number, direction: TileLayoutDirection, views: Map): boolean; restoreExpansionForView(viewId: number): boolean; private canFitVisibleSet; private constrainTiledBounds; /** * Get the maximum number of visible tiled views allowed by configuration. * Returns undefined when capacity is unlimited for the current mode. */ getTiledCapacity(): number | undefined; /** * Resolve which tiled app views should change visibility to match the * current capacity without needlessly swapping already visible views. */ resolveTiledVisibilityChanges(views: Map, options?: { preferredViewId?: number; excludedViewId?: number; }): { toHide: number[]; toShow: number[]; }; /** * Calculate bounds for a tile based on tiling configuration * @param tileIndex - Index of the tile to calculate * @param visibleCount - Total number of visible tiled views */ calculateTileBounds(tileIndex: number, visibleCount: number, views?: Iterable): Bounds; /** * Get the next available tile index from a collection of views * @param views - Iterable of view information */ getNextTileIndex(views: Iterable): number; /** * Get count of visible tiled views * @param views - Iterable of view information */ getVisibleTiledCount(views: Iterable): number; /** * Recalculate bounds for all tiled views * Returns updated views with new bounds applied * @param views - Map of viewId to ViewInfo */ recalculateTiledViews(views: Map): void; /** * Determine view mode based on manifest window config and tiling state */ determineViewMode(windowConfig?: WindowConfig): ViewMode; } //# sourceMappingURL=TilingController.d.ts.map