import { ComputedRef } from 'vue'; import { PageSelectorItem, PillNavItem } from '../types'; import { PluginWorkspaceViewEmit, PluginWorkspaceViewProps } from '../components/PluginWorkspaceView.props'; import { PluginWorkspaceControlsModel, PluginWorkspaceShellModel, PluginWorkspaceSidebarModel } from './pluginWorkspaceModel'; /** * Loosely-typed view of a component's `useSlots()` result: only slot presence and names are * read here, so this accepts any `defineSlots()` shape without fighting Vue's `Slot` render * function type. Mirrors the `SlotKeyMap` helper type in PluginWorkspaceView.shell.ts. */ export type PluginWorkspaceSlotsLike = Readonly>; export interface UsePluginWorkspaceOptions { /** PluginWorkspaceView's own reactive props object (from `defineProps`). */ props: PluginWorkspaceViewProps; /** PluginWorkspaceView's own slots (from `useSlots()`), used to detect provided passthrough slots. */ slots: PluginWorkspaceSlotsLike; /** PluginWorkspaceView's own typed `emit` function (from `defineEmits()`). */ emit: PluginWorkspaceViewEmit; } export interface UsePluginWorkspaceReturn { /** Model consumed by WorkspaceShellInternal's `shell` prop. */ shell: ComputedRef; /** Model consumed by WorkspaceSidebarInternal's `sidebar` prop. */ sidebar: ComputedRef; /** Model consumed by WorkspaceControlsInternal's `controls` prop, and by the raw `default` slot. */ controls: ComputedRef; /** Whether AppLayout should render a sidebar surface at all. */ hasSidebarSurface: ComputedRef; /** Applies an AppSidebar `update:model-value` payload to the shared control values and emits `update:modelValue`/`update:values`. */ handleControlValuesUpdate: (values: Record) => void; /** Resolves an AppTopBar `page-selector-select` payload into the active view and emits `page-selector-select`. */ handlePageSelectorSelect: (page: PageSelectorItem) => void; /** Resolves an AppTopBar `pill-select` payload into the active view and emits `pill-select`. */ handlePillSelect: (item: PillNavItem) => void; } /** * Maps PluginWorkspaceView's flat 72-prop surface into the three typed model objects * (`shell`, `sidebar`, `controls`) rendered by its internal pieces * (WorkspaceShellInternal, WorkspaceSidebarInternal, WorkspaceControlsInternal). Reuses the * existing `usePluginWorkspaceControls` / `usePluginWorkspaceNavigation` composables and the * PluginWorkspaceView.shell slot-detection helpers, so it changes only how that state is * assembled and exposed, not the underlying behavior. * * @example Recommended * ```ts * const props = withDefaults(defineProps(), { ... }) * const emit = defineEmits() * const slots = useSlots() * const { shell, sidebar, controls } = usePluginWorkspace({ props, slots, emit }) * ``` */ export declare function usePluginWorkspace(options: UsePluginWorkspaceOptions): UsePluginWorkspaceReturn;