import { ComputedRef, InjectionKey } from 'vue'; import { DashboardLayoutItem, DashboardWidgetConfig } from './CuiDashboard.vue'; /** * Reactive context provided by CuiDashboard and consumed by CuiDashboardWidget * children declared in its default slot. A widget with an `id` registers its * definition here, reads its grid position from `layoutById`, and inherits the * dashboard's edit/loading state. */ export interface CuiDashboardContext { /** Whether the dashboard is in edit mode. */ editMode: ComputedRef; /** Dashboard-level loading state (OR-ed with each widget's own flag). */ loading: ComputedRef; /** Current layout item per widget id — only ids present in the layout. */ layoutById: ComputedRef>; /** Register a slot-declared widget definition (replaces any previous one with the same id). */ register: (config: DashboardWidgetConfig) => void; /** Remove a previously registered definition. */ unregister: (id: string) => void; /** Remove the widget from the grid and the layout (emits update:layout and widget-remove). */ requestRemove: (id: string) => void; /** Report the widget's edit intent (emits widget-edit). */ notifyEdit: (id: string) => void; } export declare const CuiDashboardContextKey: InjectionKey;