import { BrowserWindow, WebContentsView } from "electron";
import { ViewInfo } from "./types";
/**
 * ViewGuard
 *
 * Utility class for validating view state before operations.
 * Provides defensive checks to prevent crashes from destroyed views.
 */
export declare class ViewGuard {
    /**
     * Check if a WebContentsView exists and is valid
     */
    static isValid(view?: WebContentsView): view is WebContentsView;
    /**
     * Check if a WebContentsView's webContents is still alive (not destroyed)
     */
    static isAlive(view?: WebContentsView): boolean;
    /**
     * Check if a BrowserWindow exists and is not destroyed
     */
    static isWindowAlive(window?: BrowserWindow | null): window is BrowserWindow;
    /**
     * Get a view from the map with validation
     * Throws an error if view is not found or destroyed
     */
    static requireView(viewId: number, views: Map<number, ViewInfo>): ViewInfo;
    /**
     * Get a view by app ID from the map, returning the first matching view
     * Throws an error if view is not found or destroyed
     */
    static requireViewByAppId(appId: string, views: Map<number, ViewInfo>): {
        viewId: number;
        viewInfo: ViewInfo;
    };
}
/**
 * Options for creating a WebContentsView
 */
export interface ViewCreationOptions {
    preloadScript: string;
    transparent?: boolean;
    backgroundThrottling?: boolean;
    additionalArguments?: string[];
}
/**
 * ViewLifecycle
 *
 * Handles creation and destruction of WebContentsViews.
 * Provides safe lifecycle management with proper cleanup.
 */
export declare class ViewLifecycle {
    /**
     * Create a new WebContentsView with standard options
     */
    static createView(options: ViewCreationOptions): WebContentsView;
    /**
     * Safely destroy a view and remove it from the main window
     */
    static destroyView(viewInfo: ViewInfo, mainWindow: BrowserWindow | null): void;
    /**
     * Remove all destroyed views from a view map
     * Returns the number of views cleaned up
     */
    static cleanupDestroyedViews(views: Map<number, ViewInfo>): number;
}
//# sourceMappingURL=ViewLifecycle.d.ts.map