@neosjs/vitepress-theme
Version:
NeosJS VitePress theme
25 lines (24 loc) • 990 B
TypeScript
import type { DefaultTheme } from 'vitepress/theme';
export interface SidebarLink {
text: string;
link: string;
docFooterText?: string;
}
type SidebarItem = DefaultTheme.SidebarItem;
/**
* Get the `Sidebar` from sidebar option. This method will ensure to get correct
* sidebar config from `MultiSideBarConfig` with various path combinations such
* as matching `guide/` and `/guide/`. If no matching config was found, it will
* return empty array.
*/
export declare function getSidebar(_sidebar: DefaultTheme.Sidebar | undefined, path: string): SidebarItem[];
/**
* Get or generate sidebar group from the given sidebar items.
*/
export declare function getSidebarGroups(sidebar: SidebarItem[]): SidebarItem[];
export declare function getFlatSideBarLinks(sidebar: SidebarItem[]): SidebarLink[];
/**
* Check if the given sidebar item contains any active link.
*/
export declare function hasActiveLink(path: string, items: SidebarItem | SidebarItem[]): boolean;
export {};