import { NavigationGuard, Location, RouteConfig } from 'vue-router'; interface Interceptor { /** * Vue-Router compatible navigation guard interceptor function. * * @see https://router.vuejs.org/guide/advanced/navigation-guards.html#global-before-guards */ intercept: NavigationGuard; } /** * Common properties of menu items (container or node). */ interface MenuItemCommon { title: string; icon?: string; iconColor?: string; /** * The priority value defines the sort order of main menu items. * Menu items are ordered by their priority (increasing, i.e. lowest priority first). * Defaults to `50` if left undefined. * * Menu items that share the same priority are sorted by `title` (in locale-dependent, increasing order). */ priority?: number; } /** * Container items are rendered in the main menu and can have child items. */ interface MenuItemContainer extends MenuItemCommon { readonly type: "container"; children: MenuItem[]; } /** * Nodes are rendered as links in the main menu (with an optional icon) and * point to a location target (i.e. a route) that will be navigated to on click. */ interface MenuItemNode extends MenuItemCommon { readonly type: "node"; location: Location; } type MenuItem = MenuItemContainer | MenuItemNode; /** * Route items contain a vue-router compatible route object. This route object * will be registered with the application's router. */ interface RouteItem { readonly type: "route"; /** * Vue-Router compatible route object * * A route *must* have a globally unique name, all other properties * have no restrictions. */ route: RouteConfig; } type ContentItem = RouteItem | MenuItem; interface ContentPlugin { /** * Unique plugin identifier */ readonly id: string; /** * Returns a list of menu items. These will be either registered as routes * or rendered in the main menu, depending on their type. */ readonly contentItems: ContentItem[]; } /** * Expected properties that should be set on an authenticated user instance. */ interface UserProperties { /** Username (required). */ name: string; /** User's full name (optional). */ fullName?: string; /** Link to the user's profile page (optional). */ profileLink?: string; /** User email (optional). */ email?: string; /** Can be an image URL or a Base64 encoded data url. */ thumbnailUrl?: string; } export { ContentItem, ContentPlugin, Interceptor, MenuItem, MenuItemCommon, MenuItemContainer, MenuItemNode, RouteItem, UserProperties };