import { LayoutDefinition, PanelGroupId, PanelGroupDefinition } from '@perses-dev/core'; import { StateCreator } from 'zustand'; import { WritableDraft } from 'immer'; import { Middleware } from './common'; /** * Slice with the state of Panel Groups, as well as any actions that modify only Panel Group state. */ export interface PanelGroupSlice { /** * Panel groups indexed by their ID. */ panelGroups: Record; /** * An array of panel group IDs, representing their order in the dashboard. */ panelGroupOrder: PanelGroupId[]; /** * Rearrange the order of panel groups by swapping the positions */ swapPanelGroups: (xIndex: number, yIndex: number) => void; /** * Update the item layouts for a panel group when, for example, a panel is moved or resized. */ updatePanelGroupLayouts: (panelGroupId: PanelGroupId, itemLayouts: PanelGroupDefinition['itemLayouts']) => void; } /** * Curried function for creating a PanelGroupSlice. */ export declare function createPanelGroupSlice(layouts: LayoutDefinition[]): StateCreator; export declare function convertLayoutsToPanelGroups(layouts: LayoutDefinition[]): Pick; /** * Private helper function for creating an empty panel group. */ export declare function createEmptyPanelGroup(): PanelGroupDefinition; /** * Private helper function that modifies panel group state to add a new panel */ export declare function addPanelGroup(draft: WritableDraft, newGroup: PanelGroupDefinition): void; //# sourceMappingURL=panel-group-slice.d.ts.map