import { EventSystem } from "../util/event_system"; import { InputForm } from "./form"; import { Toolbar } from './toolbars'; import { Vue } from "../lib/libs"; interface PanelPositionData { slot: PanelSlot; float_position: [number, number]; float_size: [number, number]; height: number; folded: boolean; attached_to?: string; attached_index?: number; open_tab?: string; fixed_height: boolean; sidebar_index: number; } type PanelSlot = 'left_bar' | 'right_bar' | 'top' | 'bottom' | 'float' | 'hidden'; interface PanelOptions { id?: string; name?: string; icon: string; optional?: boolean; plugin?: string; min_height?: number; menu?: any; /** * If true, the panel can automatically become smaller or larger than its initial size in the sidebar */ growable?: boolean; /** * When true, the height of the panel can be adjusted in the sidebar */ resizable?: true; selection_only?: boolean; condition?: ConditionResolvable; display_condition?: ConditionResolvable; /** * Adds a button to the panel that allows users to pop-out and expand the panel on click */ expand_button?: boolean; toolbars?: { [id: string]: Toolbar; } | Toolbar[]; default_position?: Partial; mode_positions?: Record>; component?: Vue.Component; form?: InputForm; default_side?: 'right' | 'left'; /** * Identifier of another panel to insert this one above */ insert_before?: string; /** * Identifier of another panel to insert this one below */ insert_after?: string; onResize?(): void; onFold?(): void; } type PanelEvent = 'drag' | 'fold' | 'change_zindex' | 'move_to' | 'moved_to' | 'update'; export declare class Panel extends EventSystem { type: 'panel'; id: string; name: string; icon: string; menu: Menu; condition: ConditionResolvable; display_condition: ConditionResolvable; resizable?: boolean; growable: boolean; min_height?: number; optional: boolean; plugin?: string; onResize: () => void; onFold: () => void; previous_slot: PanelSlot; width: number; height: number; node: HTMLElement; container: HTMLElement; handle: HTMLElement; tab_bar: HTMLElement; form?: InputForm; vue?: Vue; inside_vue?: Vue; toolbars: Toolbar[]; sidebar_resize_handle: HTMLElement; resize_handles?: HTMLElement; /** * Stores panel position data during the current session */ mode_position_data: Record; /** * The default configuration of the panel as it was when constructed without user customization */ default_configuration: { default_position?: Partial; mode_positions?: Record>; }; constructor(id: string | PanelOptions, data: PanelOptions); isVisible(): boolean; isInSidebar(): boolean; get position_data(): PanelPositionData; get slot(): PanelSlot; get folded(): boolean; set folded(state: boolean); get fixed_height(): boolean; set fixed_height(state: boolean); get attached_to(): string; set attached_to(id: string); get attached_index(): number; set attached_index(id: number); get open_attached_panel(): Panel; set open_attached_panel(panel: Panel | undefined); dispatchEvent(event_name: PanelEvent, data: any): void; getAttachedPanels(): Panel[]; /** * Get the host panel if this panel is attached to another panel */ getHostPanel(): Panel | undefined; /** * Get the panel that acts as the container for this panel. If the panel is not attached to another panel, returns itself */ getContainerPanel(): Panel; attachPanel(panel: Panel, index?: number): void; selectTab(panel?: Panel): this; customizePosition(data?: Partial): void; resetCustomLayout(): this; addToolbar(toolbar: Toolbar, position?: number): void; fold(state?: boolean): this; resize(e1: MouseEvent | TouchEvent): void; setupFloatHandles(): this; moveToFront(): this; moveTo(slot: PanelSlot, ref_panel?: Panel, before?: boolean): this; updateSlot(): this; update(dragging?: boolean): this; delete(): void; static selected: Panel | undefined; static floating_panel_z_order: string[]; } export interface Panel { snap_menu: Menu; } export declare const Panels: Record; export declare function setupPanels(): void; export declare function makeSidebarFilled(target: Panel[] | 'left_bar' | 'right_bar', exclude_panel?: Panel): void; export declare function updateInterfacePanels(): void; export declare function updateSidebarOrder(): void; export declare function updatePanelSelector(): void; export declare function setActivePanel(panel_id: string): void; export declare function setupMobilePanelSelector(): void; declare const global: { Panel: typeof import("./panels").Panel; Panels: Record; setupPanels: typeof import("./panels").setupPanels; updateInterfacePanels: typeof import("./panels").updateInterfacePanels; updateSidebarOrder: typeof import("./panels").updateSidebarOrder; updatePanelSelector: typeof import("./panels").updatePanelSelector; setActivePanel: typeof import("./panels").setActivePanel; setupMobilePanelSelector: typeof import("./panels").setupMobilePanelSelector; }; declare global { const Panel: typeof global.Panel; type Panel = import('./panels').Panel; const Panels: typeof global.Panels; const setupPanels: typeof global.setupPanels; const updateInterfacePanels: typeof global.updateInterfacePanels; const updateSidebarOrder: typeof global.updateSidebarOrder; const updatePanelSelector: typeof global.updatePanelSelector; const setActivePanel: typeof global.setActivePanel; const setupMobilePanelSelector: typeof global.setupMobilePanelSelector; } export {};