import "./AppMenu.css"; import type { DataObject } from "@olenbetong/appframe-data"; import type { AppMenuUser } from "./AppMenuUserMenu.js"; import { type AppMenuArticle } from "./menuEntries.js"; import type { AppMenuCategory, AppMenuLink } from "./types.js"; export type { AppMenuArticle } from "./menuEntries.js"; export type AppMenuProps = { /** Data object returning the articles to list. See `AppMenuArticle` for the required fields. */ dataObject: DataObject; /** Whether the menu is open. The menu is a controlled component. */ open: boolean; /** Called when the menu requests to be closed (backdrop click, Escape, app selected). */ onClose: () => void; /** * Extra categories listed below the app categories in the rail, showing a * fixed set of links instead of apps. See `createDeveloperCategories`. */ categories?: AppMenuCategory[]; /** Data object over `aviw_General_SidebarUserInfo`. Enables the user menu in the header. */ userDataObject?: DataObject; /** Overrides the default user menu entries. */ userMenuItems?: AppMenuLink[]; /** * Called when the favorite toggle next to an app is activated. Without this * handler no favorite toggles are rendered. * * `id` is the version-less ArticleId. The menu updates its own state * optimistically and rolls back if the promise rejects. */ onToggleFavorite?: (id: string, favorite: boolean) => void | Promise; /** * Link shown at the start of the content header, e.g. the portal/front page, * which isn't part of the app list. Omit it when already on that page. */ homeLink?: AppMenuLink; /** Shown below the user's name. Defaults to `af.userSession.domain`. */ userSubtitle?: string; /** * Shows a highlighted "install update" button in the menu header. Pair with * `useServiceWorkerUpdate()`. */ hasUpdate?: boolean; /** Called when the install update button is pressed. */ onInstallUpdate?: () => void; id?: string; className?: string; }; /** * Two pane application menu. The left rail holds a local search field and the * list of app categories (`MenuGroup`); the right pane lists the apps in the * selected category, or every app when no category is selected. * * On narrow viewports only one pane is visible at a time, defaulting to the app * list, with a button to switch to the category list. */ export declare function AppMenu({ dataObject, open, onClose, categories, userDataObject, userMenuItems, userSubtitle, onToggleFavorite, homeLink, hasUpdate, onInstallUpdate, id, className, }: AppMenuProps): import("react").JSX.Element;