import type { ResizeHandle, PanelSizes, Panels, DismissOptions } from './shared-panel-types.js'; export type BasicPanelPayload = { /** A unique identifier for this panel. */ name: string; }; export type AddPanelPayload = BasicPanelPayload & { /** Prop-based preferred width. */ preferredWidth?: string | number; /** * The order of the panels. * Needed for sorting the panels to ensure correct resizing behaviour. * If e.g. the page is not unmounted when navigating between routes, the 'main' * panel might be added before the 'sidebar' panel. * With the 'order' prop, we can still sort them correctly. */ order: number; /** Minimum width the panel should maintain. */ minWidth?: number; /** If the panel should be resizable. */ resizable: boolean; /** If the panel should be dismissible. */ dismissible: DismissOptions; /** * Callback triggered after resizing is finished with the new panel sizes of * all existing panels and the newly applied panel width (in px). */ onResize?: (sizes: PanelSizes, width: number) => void; }; export type UpdatePanelPayload = BasicPanelPayload & Partial; export type AddResizeHandlePayload = BasicPanelPayload & ResizeHandle; export declare const enum PanelsActions { ADDPANEL = "add", UPDATEPANEL = "update", REMOVEPANEL = "remove", ADDRESIZEHANDLE = "add-handle", REMOVERESIZEHANDLE = "remove-handle" } export type PanelsReducerActions = { type: PanelsActions.ADDPANEL; payload: AddPanelPayload; } | { type: PanelsActions.UPDATEPANEL; payload: UpdatePanelPayload; } | { type: PanelsActions.REMOVEPANEL; payload: BasicPanelPayload; } | { type: PanelsActions.ADDRESIZEHANDLE; payload: AddResizeHandlePayload; } | { type: PanelsActions.REMOVERESIZEHANDLE; payload: BasicPanelPayload; }; export type PanelsState = { panels: Panels; resizeHandles: Record; };