import { IOConnectBrowser } from "@interopio/browser";

interface Bounds {
    left: number;
    width: number;
    top: number;
    height: number;
}

export interface WorkspacesManager {
    getFrameId: () => string;
    init: (io: IOConnectBrowser.API, componentFactory?: any) => void;
    notifyMoveAreaChanged: () => void;
    getComponentBounds: () => Bounds;
    registerPopup: (element: HTMLElement) => string;
    removePopup: (element: HTMLElement) => void;
    removePopupById: (id: string) => void;
    unmount: () => void;
    subscribeForWindowFocused: (callback: () => void) => void;
    notifyWorkspacePopupChanged: (element: HTMLElement) => void;
    requestFocus: () => void;
    closeWorkspace: (workspaceId: string) => void;
    showSaveWorkspacePopup: (workspaceId: string, bounds: Bounds) => void;
    closeWindow: (id: string) => void;
    maximizeGroup: (id: string) => void;
    restoreGroup: (id: string) => void;
    ejectActiveWindow: (groupId: string) => void;
    showChannelsSelector: (placementId: string, bounds: Bounds) => void;
    showAddApplicationPopup: (workspaceId: string, groupId: string, bounds: Bounds) => void;
}

declare const WorkspacesManagerAPI: WorkspacesManager;
export default WorkspacesManagerAPI;