import { Category, Contact, Customer, GraphQLClient } from '@propeller-commerce/propeller-sdk-v2'; import { MenuCategory } from '../composables/vue/useMenu'; /** Every style with a built-in renderer — the source of truth for the union. */ declare const RENDERED_STYLES: readonly ["dropdown-vertical", "jumbotron", "accordion"]; export type MenuStyle = (typeof RENDERED_STYLES)[number]; export interface MenuProps { /** * Initialised Propeller SDK GraphQL client. * Used internally to fetch the category hierarchy. * Resolved from PropellerProvider when omitted. */ graphqlClient?: GraphQLClient; /** * Base category ID for fetching all categories. * This is the root of the menu tree. */ categoryId: number; /** * Language code for fetching localised category names and slugs. * Resolved from PropellerProvider when omitted. */ language?: string; /** * Maximum nesting depth of the menu hierarchy. * Defaults to 3. */ depth?: number; /** * CSS class applied to the menu container element. */ menuClass?: string; /** * Main menu display type. * - 'dropdown-vertical': nested flyout panels on hover (default). Lays each * level out as another 256px column, so it caps at 5 levels. * - 'jumbotron': full-width mega-menu panel showing all subcategories. * - 'accordion': inline vertical nesting at every breakpoint. The only style * with no depth ceiling — use it for trees deeper than a flyout can show. * (Also the mobile presentation of the other styles.) * * Typed as `MenuStyle | (string & {})` so the built-ins autocomplete while * any other value still type-checks — pair a custom value with the `menu` * slot to render it. Without that slot, an unrecognised value falls back to * 'accordion' and warns in development. */ menuStyle?: MenuStyle | (string & {}); /** * URL pattern for category links. * Use `{categoryId}` and `{slug}` as placeholders. * Defaults to 'category/{categoryId}/{slug}'. */ menuLinkFormat?: string; /** * Custom URL builder for category links. Overrides `menuLinkFormat` / * `configuration.urls.getCategoryUrl`. Lets hosts inject dynamic query strings * (e.g. `?contract=…`) that a static format string cannot express. * Mirrors the `getUrl` prop on Breadcrumbs. */ getUrl?: (category: Category) => string; /** * Called when a menu item is clicked. * Use for SPA-style routing instead of full-page navigation. */ onMenuItemClick: (category: Category) => void; /** * Override any UI string. * Available keys: loading, error, empty */ labels?: Record; /** * Authenticated user object. When user changes (login/logout), * the menu cache is cleared and the menu is re-fetched. */ user?: Contact | Customer | null; /** Extra CSS class applied to the root element. */ className?: string; /** Configuration object passed to the component */ configuration?: any; /** * Pre-fetched menu tree. When provided, the component skips its internal * `useMenu` fetch entirely and renders the tree directly — following the * same opt-in pattern as `ProductGrid.products`. Lets host apps fetch the * category tree server-side (e.g. in `entry-server.ts`'s always-on prefetch) * and have * the menu HTML land in the initial response, with no client-side * roundtrip after hydration. * * Omitting the prop preserves the legacy client-side fetch behaviour — * no breaking change for consumers that haven't migrated. */ tree?: MenuCategory[]; } declare function getCategoryName(cat: MenuCategory): string; declare function getCategoryUrl(cat: MenuCategory): string; declare function getSubCategories(cat: MenuCategory): MenuCategory[]; declare function handleItemClick(cat: MenuCategory, e: any): void; /** Open `categoryId` at `level` (0-based), discarding any deeper open branch. */ declare function openAt(level: number, categoryId: number | null): void; /** Accordion variant — re-selecting the open item collapses it. */ declare function toggleAt(level: number, categoryId: number): void; /** True when `categoryId` is the open branch at `level`. */ declare function isOpenAt(level: number, categoryId: number): boolean; declare function __VLS_template(): { attrs: Partial<{}>; slots: { menu?(_: { categories: MenuCategory[]; isLoading: boolean; hasError: boolean; maxDepth: number; getSubCategories: typeof getSubCategories; getCategoryName: typeof getCategoryName; getCategoryUrl: typeof getCategoryUrl; handleItemClick: typeof handleItemClick; openPath: number[]; isOpenAt: typeof isOpenAt; openAt: typeof openAt; toggleAt: typeof toggleAt; }): any; }; refs: {}; rootEl: HTMLDivElement; }; type __VLS_TemplateResult = ReturnType; declare const __VLS_component: import('vue').DefineComponent & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>; declare const _default: __VLS_WithTemplateSlots; export default _default; type __VLS_WithTemplateSlots = T & { new (): { $slots: S; }; };