import { Action, PanelEditorValues, PanelGroupId, PanelGroupItemId } from '@perses-dev/core'; import { StateCreator } from 'zustand'; import { Middleware } from './common'; import { PanelGroupSlice } from './panel-group-slice'; import { PanelSlice } from './panel-slice'; /** * Slice that handles the visual editor state and actions for adding or editing Panels. */ export interface PanelEditorSlice { /** * Initial values for add panel if default panel kind is defined */ initialValues?: Pick; /** * State for the panel editor when its open, otherwise undefined when it's closed. */ panelEditor?: PanelEditorState; /** * Opens the editor for editing an existing panel by providing its layout coordinates. */ openEditPanel: (panelGroupItemId: PanelGroupItemId) => void; /** * Opens the editor for adding a new Panel to a panel group. */ openAddPanel: (panelGroupId?: PanelGroupId) => void; } export interface PanelEditorState { /** * Whether we're adding a new panel, or editing an existing panel. */ mode: Action; panelGroupItemId?: PanelGroupItemId; /** * Initial values for the things that can be edited about a panel. */ initialValues: PanelEditorValues; /** * Applies changes, but doesn't close the editor. */ applyChanges: (next: PanelEditorValues) => void; /** * Close the editor. */ close: () => void; } /** * Curried function for creating the PanelEditorSlice. */ export declare function createPanelEditorSlice(): StateCreator; //# sourceMappingURL=panel-editor-slice.d.ts.map