import type { InjectionKey, Ref } from 'vue';

/**
 * Value shared between `UiSidebarGroup` and its children via provide/inject.
 */
export interface UiSidebarGroupContextValue {
  /** Current expanded state of the group. */
  open: Ref<boolean>;
  /** Toggles the group's expanded state. */
  toggle: () => void;
}

export const uiSidebarGroupContextKey: InjectionKey<UiSidebarGroupContextValue> =
  Symbol('ui-sidebar-group');
