55 lines
907 B
TypeScript
55 lines
907 B
TypeScript
import type { ThemeIcon } from './base.js'
|
|
|
|
export type Sidebar = 'auto' | (string | SidebarItem)[] | SidebarMulti
|
|
|
|
export type SidebarMulti = Record<
|
|
string,
|
|
| 'auto'
|
|
| (string | SidebarItem)[]
|
|
| { items: 'auto' | (string | SidebarItem)[], prefix?: string }
|
|
>
|
|
|
|
export interface SidebarItem {
|
|
/**
|
|
* 侧边栏文本
|
|
*/
|
|
text?: string
|
|
|
|
/**
|
|
* 侧边栏链接
|
|
*/
|
|
link?: string
|
|
|
|
/**
|
|
* 侧边栏图标
|
|
*/
|
|
icon?: ThemeIcon
|
|
|
|
/**
|
|
* 次级侧边栏分组
|
|
*/
|
|
items?: 'auto' | (string | SidebarItem)[]
|
|
|
|
/**
|
|
* 如果未指定,组不可折叠。
|
|
*
|
|
* 如果为`true`,组可折叠,并默认折叠。
|
|
*
|
|
* 如果为`false`,组可折叠,但默认展开。
|
|
*/
|
|
collapsed?: boolean
|
|
|
|
/**
|
|
* 当前分组的链接前缀
|
|
*/
|
|
prefix?: string
|
|
|
|
/**
|
|
* @deprecated 使用 `prefix` 替代
|
|
*/
|
|
dir?: string
|
|
|
|
rel?: string
|
|
target?: string
|
|
}
|