import { App, CSSProperties, ComputedRef, InjectionKey, MaybeRef, MaybeRefOrGetter, Ref, ShallowRef, } from 'vue' import { PageDataRef, PageFrontmatterRef, PageLangRef, SiteLocaleDataRef, useRoute, useRouter, } from 'vuepress/client' import { BulletinOptions, CopyrightFrontmatter, GitContributor, LinkPreviewOptions, NavItemWithLink, PresetLocale, ReaderAidMode, ReaderPreferences, ResolvedNavItem, ResolvedReaderOptions, ResolvedSidebarItem, ThemeBaseCollection, ThemeCollectionItem, ThemeData, ThemeDocCollection, ThemeFriendsFrontmatter, ThemeHomeFrontmatter, ThemeInjectedLocaleData, ThemeLinkPreviewItem, ThemeOutline, ThemePageData, ThemePageFrontmatter, ThemePostCollection, ThemePostFrontmatter, ThemePosts, ThemePostsItem, ThemeRelatedPostItem, ThemeSeries, ThemeSeriesChapter, ThemeSeriesData, ThemeSidebar, TransitionOptions, } from '../../shared/index.js' import {RouteParamValueRaw} from 'vue-router' interface Breadcrumb { text: string link?: string current?: boolean } export declare function useBreadcrumb(): { hasBreadcrumb: ComputedRef breadcrumbList: ComputedRef } export declare function useBulletin< T extends Record = Record, >(): ComputedRef export declare function useBulletinControl = Record>(): { bulletin: ComputedRef<(BulletinOptions & T) | undefined> enableBulletin: ComputedRef showBulletin: Ref close: () => void } /** * Reference type for collections data. * Maps locale paths to arrays of collection items. * * 集合数据的引用类型。 * 将语言环境路径映射到集合项数组。 */ export type CollectionsRef = Ref> /** * Reference type for a single collection item. * * 单个集合项的引用类型。 */ export type CollectionItemRef = Ref /** * Global reference to all collections data. * * 所有集合数据的全局引用。 */ export declare const collectionsRef: CollectionsRef /** * Global reference to the current collection item. * * 当前集合项的全局引用。 */ export declare const collectionItemRef: CollectionItemRef /** * Use collections data. * Returns the global collections reference. * * 获取集合数据。 * 返回全局集合引用。 * * @returns Collections data reference / 集合数据引用 */ export declare const useCollections: () => CollectionsRef /** * Use current collection item. * Returns the current collection based on the page context. * * 获取当前集合项。 * 根据页面上下文返回当前集合。 * * @template T - Collection type / 集合类型 * @returns Current collection item reference / 当前集合项引用 */ export declare const useCollection: < T extends ThemeBaseCollection = ThemeDocCollection, >() => CollectionItemRef /** * Force update the current collection. * Used to programmatically switch the active collection. * * 强制更新当前集合。 * 用于以编程方式切换活动集合。 * * @param dir - Collection directory or true for first posts collection / 集合目录或 true 表示第一个文章集合 */ export declare function forceUpdateCollection(dir?: string | true): void /** * Setup collection tracking. * Automatically determines the current collection based on route and page path. * * 设置集合跟踪。 * 根据路由和页面路径自动确定当前集合。 */ export declare function setupCollection(): void interface useContributorsResult { mode: ComputedRef<'inline' | 'block'> contributors: ComputedRef hasContributors: ComputedRef } export declare function useContributors(): useContributorsResult interface useCopyrightResult { license: ComputedRef author: ComputedRef> hasCopyright: ComputedRef creation: ComputedRef creationText: ComputedRef sourceUrl: ComputedRef } export declare function useCopyright( copyright: ComputedRef, ): useCopyrightResult interface License { name: string url?: string icons?: string[] } /** * Get css variable * @param prop css variable name * @param initialValue */ export declare function useCssVar( prop: MaybeRefOrGetter, initialValue?: string, ): ComputedRef /** * Dark mode reference type * * 暗黑模式引用类型 */ type DarkModeRef = Ref /** * Injection key for dark mode * * 暗黑模式的注入键 */ export declare const darkModeSymbol: InjectionKey /** * Check if view transitions are enabled and supported * Considers prefers-reduced-motion preference * * 检查视图过渡是否启用且受支持 * 考虑 prefers-reduced-motion 偏好设置 * * @returns Whether transitions are enabled / 过渡是否启用 */ export declare function enableTransitions(): boolean /** * Setup dark mode for the Vue application * Configures dark mode based on theme settings and user preferences * * 为 Vue 应用设置暗黑模式 * 根据主题设置和用户偏好配置暗黑模式 * * @param app - Vue application instance / Vue 应用实例 */ export declare function setupDarkMode(app: App): void /** * Use dark mode * Returns the dark mode reactive reference * * 获取暗黑模式状态 * * @returns Dark mode reference / 暗黑模式引用 * @throws Error if called without provider / 如果没有提供者则抛出错误 */ export declare function useDarkMode(): DarkModeRef /** * Theme data reference type * * 主题数据引用类型 */ export type ThemeDataRef = Ref /** * Theme locale data reference type * * 主题本地化数据引用类型 */ export type ThemeLocaleDataRef = ComputedRef /** * Injection key for theme locale data * * 主题本地化数据的注入键 */ export declare const themeLocaleDataSymbol: InjectionKey /** * Theme data ref * Global reference to the theme configuration data * * 主题数据引用 * 主题配置数据的全局引用 */ export declare const themeData: ThemeDataRef /** * Use theme data * Returns the global theme data reference * * 获取主题数据 * 返回全局主题数据引用 * * @returns Theme data reference / 主题数据引用 */ export declare function useThemeData(): ThemeDataRef /** * Use theme locale data * Returns the theme data for the current route's locale * * 获取当前路由对应的语言环境的主题数据 * * @returns Theme locale data computed reference / 主题本地化数据计算引用 * @throws Error if called without provider / 如果没有提供者则抛出错误 */ export declare function useThemeLocaleData< T extends ThemeInjectedLocaleData = ThemeInjectedLocaleData, >(): ThemeLocaleDataRef /** * Setup theme data for the Vue app * Provides theme data and theme locale data to the application * * 为 Vue 应用设置主题数据 * 向应用程序提供主题数据和主题本地化数据 * * @param app - Vue application instance / Vue 应用实例 */ export declare function setupThemeData(app: App): void type FrontmatterType = 'home' | 'post' | 'friends' | 'page' type FrontmatterCollectionType = 'post' | 'doc' type Frontmatter = T extends 'home' ? ThemeHomeFrontmatter : T extends 'post' ? ThemePostFrontmatter : T extends 'friends' ? ThemeFriendsFrontmatter : ThemePageFrontmatter export interface Data< T extends FrontmatterType = 'page', C extends FrontmatterCollectionType = 'doc', > { theme: ThemeLocaleDataRef page: PageDataRef frontmatter: PageFrontmatterRef & Record> lang: PageLangRef site: SiteLocaleDataRef isDark: Ref collection: CollectionItemRef } /** * Use data * * 获取页面数据,包括主题配置、页面数据、frontmatter、语言、站点信息、暗黑模式和集合信息 */ export declare function useData< T extends FrontmatterType = 'page', C extends FrontmatterCollectionType = 'doc', >(): Data export declare function useEditLink(): ComputedRef /** * Encrypt configuration tuple type * Contains keys, rules, global flag, and admin passwords * * 加密配置元组类型 * 包含密钥、规则、全局标志和管理员密码 */ export type EncryptConfig = readonly [keys: string, rules: string, global: number, admin: string] /** * Encrypt data rule interface * Defines a single encryption rule with matching pattern and passwords * * 加密数据规则接口 * 定义单个加密规则,包含匹配模式和密码 */ export interface EncryptDataRule { /** Unique key for the rule / 规则的唯一键 */ key: string /** Match pattern for the rule / 规则的匹配模式 */ match: string /** Array of valid passwords / 有效密码数组 */ rules: string[] } /** * Encrypt data interface * Contains all encryption configuration and rules * * 加密数据接口 * 包含所有加密配置和规则 */ export interface EncryptData { /** Whether global encryption is enabled / 是否启用全局加密 */ global: boolean /** Array of admin password hashes / 管理员密码哈希数组 */ admins: string[] /** Array of match patterns / 匹配模式数组 */ matches: string[] /** Array of encryption rules / 加密规则数组 */ ruleList: EncryptDataRule[] } /** * Encrypt data reference type * * 加密数据引用类型 */ export type EncryptRef = Ref /** * Global encrypt data reference * * 全局加密数据引用 */ export declare const encrypt: EncryptRef /** * Use encrypt data * Returns the global encrypt data reference * * 获取加密数据 * 返回全局加密数据引用 * * @returns Encrypt data reference / 加密数据引用 */ export declare function useEncryptData(): EncryptRef /** * Encrypt interface * Provides encryption-related reactive states and properties * * 加密接口 * 提供加密相关的响应式状态和属性 */ export interface Encrypt { /** Whether the current page has encryption / 当前页面是否有加密 */ hasPageEncrypt: Ref /** Whether global encryption is decrypted / 全局加密是否已解密 */ isGlobalDecrypted: Ref /** Whether page encryption is decrypted / 页面加密是否已解密 */ isPageDecrypted: Ref /** List of encryption rules for the current page / 当前页面的加密规则列表 */ hashList: Ref } /** * Injection key for encrypt functionality * * 加密功能的注入键 */ export declare const EncryptSymbol: InjectionKey /** * Setup encrypt functionality for the application * Initializes encryption state and provides it to child components * * 为应用程序设置加密功能 * 初始化加密状态并提供给子组件 */ export declare function setupEncrypt(): void /** * Use encrypt * Returns the encryption state and properties * * 获取加密功能的状态和方法,包括全局解密、页面解密、密码验证等 * * @returns Encrypt state and properties / 加密状态和属性 * @throws Error if called without setup / 如果没有设置则抛出错误 */ export declare function useEncrypt(): Encrypt /** * Use encrypt compare * Provides password verification functions for global and page encryption * * 密码比较功能,提供全局密码和页面密码的验证方法 * * @returns Object with compareGlobal and comparePage functions / 包含 compareGlobal 和 comparePage 函数的对象 */ export declare function useEncryptCompare(): { compareGlobal: (password: string) => Promise comparePage: (password: string) => Promise } /** * Options for useFlyout composable. * * useFlyout 组合式函数的选项。 */ interface UseFlyoutOptions { /** Element to track focus for / 要跟踪焦点的元素 */ el: Ref /** Callback when element gains focus / 元素获得焦点时的回调 */ onFocus?: () => void /** Callback when element loses focus / 元素失去焦点时的回调 */ onBlur?: () => void } /** * Currently focused element reference. * Shared across all flyout instances. * * 当前聚焦元素的引用。 * 在所有弹出框实例之间共享。 */ export declare const focusedElement: Ref /** * Use flyout focus tracking. * Tracks focus state for dropdown menus and flyout components. * * 弹出框焦点跟踪。 * 跟踪下拉菜单和弹出框组件的焦点状态。 * * @param options - Flyout options / 弹出框选项 * @returns Readonly reference to focus state / 焦点状态的只读引用 */ export declare function useFlyout(options: UseFlyoutOptions): Readonly> /** * Raw icons data structure from internal data. * * 来自内部数据的原始图标数据结构。 */ interface IconsRawData { /** Collection names / 集合名称 */ co: string[] /** Background icons by collection index / 按集合索引的背景图标 */ bg: Record /** Mask icons by collection index / 按集合索引的遮罩图标 */ mask: Record } /** * Processed icons data structure. * * 处理后的图标数据结构。 */ interface IconsData { /** List of background icons / 背景图标列表 */ bg: string[] /** List of mask icons / 遮罩图标列表 */ mask: string[] } type IconsDataRef = Ref /** * Use icons data. * Returns the processed icons data reference. * * 获取图标数据。 * 返回处理后的图标数据引用。 * * @returns Icons data reference / 图标数据引用 */ export declare const useIconsData: () => IconsDataRef /** * Fallback mappings for old icon aliases. * Maps legacy icon names to their current equivalents. * * 旧版本内置图标别名的后备映射。 * 将旧图标名称映射到当前等效名称。 */ export declare const socialFallbacks: Record /** * Resolve raw icons data to processed format. * Converts indexed data to flat icon lists. * * 将原始图标数据解析为处理后的格式。 * 将索引数据转换为平面图标列表。 * * @param data - Raw icons data / 原始图标数据 * @param data.co - Collection names / 集合名称 * @param data.bg - Background icons by collection index / 按集合索引的背景图标 * @param data.mask - Mask icons by collection index / 按集合索引的遮罩图标 * @returns Processed icons data / 处理后的图标数据 */ export declare function resolveIconsData({co, bg, mask}: IconsRawData): IconsData /** * Normalize icon to CSS class name. * Returns the appropriate class name based on icon type. * * 将图标规范化为 CSS 类名。 * 根据图标类型返回适当的类名。 * * @param icon - Icon name in format "collection:name" / 格式为 "collection:name" 的图标名称 * @returns CSS class name or empty string if not found / CSS 类名,如果未找到则返回空字符串 */ export declare function normalizeIconClassname(icon: string): string export interface InternalLink { text: string link: string } export declare function useInternalLink(): { home: ComputedRef posts: ComputedRef tags: ComputedRef archive: ComputedRef categories: ComputedRef } interface Lang { text: string link: string } interface UseLangOptions { removeCurrent?: boolean } interface UseLangResult { localeLinks: ComputedRef currentLang: ComputedRef } export declare function useLangs({removeCurrent}?: UseLangOptions): UseLangResult export declare function useLastUpdated(): { datetime: Ref isoDatetime: ComputedRef lastUpdatedText: ComputedRef } /** * Use layout * * 获取当前页面布局相关信息,包括是否首页、是否有侧边栏、是否显示目录等 */ export declare function useLayout(): { isHome: import('vue').ComputedRef hasAside: import('vue').ComputedRef hasSidebar: import('vue').ComputedRef leftAside: import('vue').ComputedRef hasLocalNav: import('vue').ComputedRef isSidebarEnabled: import('vue').ComputedRef isAsideEnabled: import('vue').ComputedRef is960: import('vue').ShallowRef is1280: import('vue').ShallowRef } export declare function registerWatchers(): void /** * Bounding rect of a trigger element. * * 触发元素的包围盒。 */ interface PreviewRect { top: number left: number right: number bottom: number width: number height: number } /** * Size of an element or of the viewport. * * 元素或视口尺寸。 */ interface PreviewSize { width: number height: number } /** 当前可见的内链预览状态 */ export interface LinkPreviewActive { /** * Normalized route path of the target page * * 目标页路由 */ key: string /** * Item written at build time * * 构建期写入的预览项 */ item: ThemeLinkPreviewItem /** * Bounding rect of the trigger * * 触发链接的包围盒 */ rect: PreviewRect } /** * Result of `useLinkPreview()`. * * `useLinkPreview()` 的返回值。 */ export interface UseLinkPreviewResult { /** * Whether the feature is enabled * * 功能是否启用 */ enabled: ComputedRef /** * Current active preview, `null` when hidden * * 当前预览,隐藏时为 `null` */ active: ShallowRef /** * Raw options with `true` normalized to `{}` * * 原始配置(`true` 归一为 `{}`) */ options: ComputedRef /** * Current viewport size, only tracked while the feature is enabled * * 当前视口尺寸,仅在功能开启时跟踪 */ viewport: ShallowRef } /** * Hide the preview immediately and reset the hover state. * * 立即隐藏预览并重置悬停状态。 */ export declare function hideLinkPreview(): void /** * Use link preview * * 读取内链预览状态。 */ export declare function useLinkPreview(): UseLinkPreviewResult /** * Show the preview of a given anchor manually * * 手动展示某条链接的预览 * * @param anchor - Trigger anchor / 触发链接 */ export declare function showLinkPreview(anchor: HTMLAnchorElement): void /** * Bind the global listeners, called once from the client config `setup()` * * 绑定全局监听,在客户端配置的 `setup()` 中调用一次。 */ export declare function setupLinkPreview(): void /** * Link resolution result interface * Provides information about the resolved link * * 链接解析结果接口 * 提供有关解析后链接的信息 */ interface UseLinkResult { /** * Whether the link is external * 是否为外部链接 */ isExternal: ComputedRef /** * Whether the link uses an external protocol * Does not include target="_blank" cases * 是否使用外部链接协议 * 此项不包含 target="_blank" 的情况 */ isExternalProtocol: ComputedRef /** * The resolved link URL * 解析后的链接 URL */ link: ComputedRef } /** * Use link * Resolves and processes a link URL with smart handling of internal/external links * * 使用链接 * 解析并处理链接 URL,智能处理内部/外部链接 * * @param href - Link URL or reference / 链接 URL 或引用 * @param target - Link target or reference / 链接目标或引用 * @returns Link resolution result / 链接解析结果 */ export declare function useLink( href: MaybeRefOrGetter, target?: MaybeRefOrGetter, ): UseLinkResult /** * Use navbar data * Returns the resolved navbar items based on theme configuration * * 获取导航栏数据 * 根据主题配置返回解析后的导航栏项目 * * @returns Reactive reference to resolved navbar items / 解析后的导航栏项目的响应式引用 */ export declare function useNavbarData(): Ref /** * Navigation control return type * Provides state and methods for mobile navigation menu * * 导航控制返回类型 * 提供移动端导航菜单的状态和方法 */ export interface UseNavReturn { /** Whether the mobile screen menu is open / 移动端屏幕菜单是否打开 */ isScreenOpen: Ref /** Open the mobile screen menu / 打开移动端屏幕菜单 */ openScreen: () => void /** Close the mobile screen menu / 关闭移动端屏幕菜单 */ closeScreen: () => void /** Toggle the mobile screen menu / 切换移动端屏幕菜单 */ toggleScreen: () => void } /** * Use nav * Provides mobile navigation menu control functionality * * 导航栏状态控制,提供移动端导航菜单的打开、关闭和切换功能 * * @returns Navigation control state and methods / 导航控制状态和方法 */ export declare function useNav(): UseNavReturn /** * Header interface representing a page heading * * Header 接口表示页面标题 */ export interface Header { /** * The level of the header * `1` to `6` for `

` to `

` * * 标题级别 * `1` 到 `6` 对应 `

` 到 `

` */ level: number /** * The title of the header * * 标题文本 */ title: string /** * The slug of the header * Typically the `id` attr of the header anchor * * 标题的 slug * 通常是标题锚点的 `id` 属性 */ slug: string /** * Link of the header * Typically using `#${slug}` as the anchor hash * * 标题链接 * 通常使用 `#${slug}` 作为锚点哈希 */ link: string /** * The children of the header * * 子标题 */ children: Header[] } /** A resolved header and its cached document-relative top position. */ interface HeaderTop { link: string top: number } /** * Measure and cache the absolute top of every resolved header. * * 测量并缓存所有已解析标题的绝对顶部位置。 */ export declare function measureHeaderTops(): void /** * Invalidate the cached header tops so they are re-measured on next use. * * 使缓存的标题位置失效,下次读取时重新测量。 */ export declare function invalidateHeaderTops(): void /** * Get the cached header tops, re-measuring only when the cache is invalid or the * page height changed (which may indicate images / fonts finished loading or the * layout otherwise reflowed). * * 获取缓存的标题位置。仅在缓存失效或页面高度发生变化(可能意味着图片/字体加载完成 * 或发生过重排)时重新测量。 * * @param bodyHeight - Already-read `document.body.offsetHeight`, to avoid a second layout read / 已读取的页面高度,避免二次布局读取 */ export declare function getHeaderTops(bodyHeight?: number): HeaderTop[] /** * Menu item type for outline navigation * Extends Header with element reference and additional properties * * 目录导航的菜单项类型 * 扩展 Header 并添加元素引用和额外属性 */ export type MenuItem = Omit & { /** Reference to the DOM element / DOM 元素引用 */ element: HTMLHeadElement /** Child menu items / 子菜单项 */ children?: MenuItem[] /** Lowest level for outline display / 目录显示的最低级别 */ lowLevel?: number } /** * Setup headers for the current page * Initializes header extraction based on frontmatter and theme configuration * * 为当前页面设置标题 * 根据 frontmatter 和主题配置初始化标题提取 * * @returns Reference to the headers array / 标题数组的引用 */ export declare function setupHeaders(): Ref /** * Use headers * Returns the reactive headers reference for the current page * * 获取当前页面的标题列表 * * @returns Reactive reference to menu items / 菜单项的响应式引用 */ export declare function useHeaders(): Ref /** * Get headers from the page content * Extracts and filters headings based on the outline configuration * * 从页面内容获取标题 * 根据目录配置提取和过滤标题 * * @param range - Outline configuration for header levels / 标题级别的目录配置 * @returns Array of menu items representing headers / 表示标题的菜单项数组 */ export declare function getHeaders(range?: ThemeOutline): MenuItem[] /** * Resolve headers into a hierarchical structure * Organizes flat headers into nested menu items based on levels * * 将标题解析为层次结构 * 根据级别将平面标题组织为嵌套菜单项 * * @param headers - Flat array of menu items / 平面菜单项数组 * @param high - Minimum header level to include / 要包含的最小标题级别 * @returns Hierarchical array of menu items / 层次化的菜单项数组 */ export declare function resolveHeaders(headers: MenuItem[], high: number): MenuItem[] /** * Use active anchor * Tracks scroll position and updates the active outline item * * 活跃锚点处理,监听滚动并更新目录中高亮的锚点 * * @param container - Reference to the outline container / 目录容器的引用 * @param marker - Reference to the active marker element / 活动标记元素的引用 */ export declare function useActiveAnchor( container: Ref, marker: Ref, ): void /** * Use posts page data * * 获取文章页面数据,判断当前页面是否为文章类型或文章列表布局 */ export declare function usePostsPageData(): { isPosts: ComputedRef isPostsLayout: ComputedRef } export type ShortPostsItem = Pick interface ArchiveItem { title: string label: string list: ShortPostsItem[] } export declare function useArchives(): { archives: ComputedRef } export interface CategoryItemWithPost { type: 'post' title: string path: string } export interface CategoryItem { id: string type: 'category' sort: number title: string items: (CategoryItem | CategoryItemWithPost)[] } export type PostsCategory = (CategoryItem | CategoryItemWithPost)[] export declare function usePostsCategory(): { categories: ComputedRef } export type PostsDataRef = Ref> /** * Posts data ref * * 文章数据引用,包含所有语言环境的文章列表 */ export declare const postsData: PostsDataRef /** * Use posts data * * 获取文章数据 */ export declare function usePostsData(): PostsDataRef /** * Use locale post list * * 获取当前语言环境的文章列表 */ export declare function useLocalePostList(): ComputedRef interface PostsExtractLink { link?: string text?: string total: number } export declare function usePostsExtract(): { hasPostsExtract: ComputedRef tags: ComputedRef archives: ComputedRef categories: ComputedRef } /** * Use post list control result * * 文章列表控制结果类型,包含分页相关的数据和方法 */ interface UsePostListControlResult { postList: ComputedRef page: Ref totalPage: ComputedRef pageRange: ComputedRef< { value: number | string more?: true }[] > isLastPage: ComputedRef isFirstPage: ComputedRef isPaginationEnabled: ComputedRef changePage: (page: number) => void } /** * Use post list control * * 文章列表控制,管理分页逻辑和文章列表数据 */ export declare function usePostListControl(homePage: Ref): UsePostListControlResult type ShortPostItem = Pick /** * Posts tag item * * 标签项,包含名称、数量和样式类名 */ interface PostsTagItem { name: string count: string | number className: string } /** * Use tags result * * 标签结果类型 */ interface UseTagsResult { tags: ComputedRef currentTag: Ref postList: ComputedRef handleTagClick: (tag: string) => void } /** * Use tags * * 获取标签列表和当前选中的标签,处理标签相关逻辑 */ export declare function useTags(): UseTagsResult interface PresetLocales { [locale: string]: PresetLocale } export declare const presetLocales: PresetLocales export declare function getPresetLocaleData(locale: string, name: keyof PresetLocale): string /** * Use prev next result * * 上一页/下一页结果类型 */ interface UsePrevNextResult { prev: ComputedRef next: ComputedRef } /** * Use prev next * * 获取上一页和下一页链接 */ export declare function usePrevNext(): UsePrevNextResult export declare function useReadAid(): { isOutside: import('vue').ComputedRef style: import('vue').ComputedRef readAid: import('vue').ComputedRef } export declare function useReaderReadAid(): { aidConfig: ComputedRef<{ modes: ReaderAidMode[] default: ReaderAidMode | null } | null> aid: ComputedRef } interface ReaderPreferencesResult { /** Resolved options of the current locale / 当前语言生效的配置 */ options: ComputedRef /** Current preferences / 当前偏好 */ prefs: Ref /** Reading aid configuration of the current page, `null` when disabled / 阅读辅助线配置 */ aidConfig: ComputedRef<{ modes: ReaderAidMode[] default: ReaderAidMode | null } | null> /** Reading aid modes offered by the configuration / 可选形态 */ aidModes: ComputedRef /** Reading aid mode that actually applies, `null` means off / 真正生效的形态 */ aid: ComputedRef /** Whether the viewport is too small for the desktop-only controls / 是否为小屏 */ mobile: ComputedRef /** Whether the panel has anything to offer on this viewport / 面板是否有可操作项 */ hasControls: ComputedRef /** Update one preference, `undefined` removes the key / 更新单项偏好 */ setPreference: ( key: K, value: ReaderPreferences[K] | undefined, ) => void /** Remove all keys, never write defaults / 恢复默认,直接删除键 */ reset: () => void } /** * Use reader preferences. * * 获取阅读偏好。 * * @returns Resolved options, the current preferences and their mutators * 当前生效的配置、当前偏好及其修改方法 */ export declare function useReaderPreferences(): ReaderPreferencesResult /** * Use the "continue reading" prompt. * * 获取「继续阅读」提示。 */ export declare function useResumeReading(): { /** Saved progress in `0`–`1`, `null` when nothing to offer / 保存的进度 */ saved: Readonly> /** Whether the prompt is visible / 提示是否可见 */ visible: Ref /** Scroll to the saved position / 滚动到记录的位置 */ resume: () => void /** Dismiss and mark as "restart" for this session / 关闭并标记本次从头读 */ restart: () => void } /** * Setup the reader preferences: apply them, keep them in sync, track the reading * position and offer the resume prompt. * * The whole thing is a no-op when the feature is disabled for the current locale. * * 初始化阅读偏好:应用、同步、记录阅读位置并提供继续阅读提示。 * * 当前语言关闭该功能时,整个流程不产生任何副作用。 */ export declare function setupReaderPreferences(): void /** * 检查是否应该使用降级动画方案 */ export declare function useReducedMotion(): ComputedRef /** * Related posts result * * 相关文章 composable 的返回值 */ export interface UseRelatedPostsResult { /** * Whether the block should render * * 是否渲染相关文章区块 */ enabled: ComputedRef /** * Related posts resolved at build time * * 构建期计算出的相关文章 */ relatedPosts: ComputedRef /** * Title of the block * * 区块标题 */ title: ComputedRef /** * Accessible name of the block * * 区块的无障碍名称 */ label: ComputedRef } /** * Use related posts * * 读取构建期计算的相关文章数据。 * */ export declare function useRelatedPosts(): UseRelatedPostsResult export type RouteQueryValueRaw = RouteParamValueRaw | string[] export interface ReactiveRouteOptions { /** * Mode to update the router query, ref is also acceptable * * @default 'replace' */ mode?: MaybeRef<'replace' | 'push'> /** * Route instance, use `useRoute()` if not given */ route?: ReturnType /** * Router instance, use `useRouter()` if not given */ router?: ReturnType } export interface ReactiveRouteOptionsWithTransform extends ReactiveRouteOptions { /** * Function to transform data before return */ transform?: (val: V) => R } export declare function useRouteQuery(name: string): Ref export declare function useRouteQuery( name: string, defaultValue?: MaybeRefOrGetter, options?: ReactiveRouteOptionsWithTransform, ): Ref export interface ScrollPromise { wait: () => Promise | null pending: () => void resolve: () => void } export declare const useScrollPromise: () => ScrollPromise /** * Setup the scroll restoration of the theme. * * Must be called in a `setup()` of the root component. * * 初始化主题的滚动恢复。 * * 必须在根组件的 `setup()` 中调用。 */ export declare function setupScrollRestoration(): void /** * Series index reference, shared by every consumer. * * 系列索引引用,所有消费者共用。 */ export declare const seriesData: Ref /** * Series composable result * * 系列 composable 的返回值 */ export interface UseSeriesResult { /** * Series of the current page, `null` when the page belongs to no series * * 当前页所属的系列,不属于任何系列时为 `null` */ series: ComputedRef /** * Chapter matching the current route * * 与当前路由匹配的章节 */ chapter: ComputedRef /** * Whether the in-page links should render * * 是否渲染页内互链(文首 + 文末) */ enabled: ComputedRef /** * Next chapter, `null` on the last chapter * * 下一篇,末篇为 `null` */ next: ComputedRef /** Series name with the locale quotes / 带书名号的系列名 */ name: ComputedRef /** `3 of 12` / 第 3 / 共 12 篇 */ chapterText: ComputedRef /** Label of the head hint / 文首提示的前缀 */ includedLabel: ComputedRef /** Label of the next chapter / 「下一篇」标签 */ nextLabel: ComputedRef /** Label of the last chapter / 「已完结」标签 */ finishedLabel: ComputedRef /** Accessible name of the tail block / 文末区块的无障碍名称 */ navLabel: ComputedRef } /** * Use series * * 读取构建期生成的系列索引,得到当前页所属的系列、章节与下一篇。 */ export declare function useSeries(): UseSeriesResult /** * Use the series list of the current locale, used by the overview page. * * 获取当前语言下的全部系列,供系列总览页使用。 * * @returns Series of the current locale / 当前语言的系列列表 */ export declare function useSeriesList(): ComputedRef /** * Use the series of the current landing page. * * 获取当前系列落地页对应的系列 * * @returns Series of the landing page, `null` when it cannot be resolved * 落地页对应的系列,无法解析时为 `null` */ export declare function useSeriesPage(): ComputedRef /** * Sidebar data type - maps locale paths to sidebar configurations. * * 侧边栏数据类型 - 将语言环境路径映射到侧边栏配置。 */ export type SidebarData = Record /** * Reference type for sidebar data. * * 侧边栏数据的引用类型。 */ export type SidebarDataRef = Ref /** * Reference type for auto-generated directory sidebar. * * 自动生成目录侧边栏的引用类型。 */ export type AutoDirSidebarRef = Ref> /** * Reference type for auto-generated home data. * * 自动生成首页数据的引用类型。 */ export type AutoHomeDataRef = Ref> /** * Global sidebar data reference. * * 全局侧边栏数据引用。 */ export declare const sidebarData: SidebarDataRef /** * Auto-generated directory sidebar reference. * * 自动生成目录侧边栏引用。 */ export declare const autoDirSidebar: AutoDirSidebarRef /** * Setup sidebar tracking. * Automatically updates sidebar based on route and frontmatter changes. * * 设置侧边栏跟踪。 * 根据路由和 frontmatter 变化自动更新侧边栏。 */ export declare function setupSidebar(): void /** * Use sidebar data. * Returns the resolved sidebar items for the current page. * * 获取侧边栏数据。 * 返回当前页面的解析侧边栏项目。 * * @returns Resolved sidebar items reference / 解析侧边栏项目引用 */ export declare function useSidebarData(): Ref /** * Get the sidebar configuration from sidebar options. * Ensures correct sidebar config from MultiSideBarConfig with various path combinations. * Returns empty array if no matching config is found. * * 从侧边栏选项获取侧边栏配置。 * 确保从 MultiSideBarConfig 获取正确的侧边栏配置,支持各种路径组合。 * 如果未找到匹配的配置,则返回空数组。 * * @param routePath - Current route path / 当前路由路径 * @param routeLocal - Current route locale / 当前路由语言环境 * @returns Resolved sidebar items / 解析的侧边栏项目 */ export declare function getSidebar(routePath: string, routeLocal: string): ResolvedSidebarItem[] /** * Get or generate sidebar groups from the given sidebar items. * Groups consecutive items without children into a single group. * * 从给定的侧边栏项目获取或生成侧边栏分组。 * 将没有子项目的连续项目分组到单个组中。 * * @param sidebar - Flat array of sidebar items / 平面侧边栏项目数组 * @returns Grouped sidebar items / 分组的侧边栏项目 */ export declare function getSidebarGroups(sidebar: ResolvedSidebarItem[]): ResolvedSidebarItem[] /** * Get the first link from sidebar items. * Recursively searches through nested items to find the first link. * * 从侧边栏项目获取第一个链接。 * 递归搜索嵌套项目以找到第一个链接。 * * @param sidebar - Sidebar items to search / 要搜索的侧边栏项目 * @returns First link found or empty string / 找到的第一个链接或空字符串 */ export declare function getSidebarFirstLink(sidebar: ResolvedSidebarItem[]): string /** * Check if the given sidebar item contains any active link. * * 检查给定的侧边栏项是否包含活动链接 */ export declare function hasActiveLink( path: string, items: ResolvedSidebarItem | ResolvedSidebarItem[], ): boolean /** * Use sidebar control * * 侧边栏控制,提供启用/禁用侧边栏和折叠/展开的控制函数 */ export declare function useSidebarControl(): { isSidebarEnabled: Ref enableSidebar: () => void disableSidebar: () => void toggleSidebarEnabled: () => void isSidebarCollapsed: Ref toggleSidebarCollapse: (collapse?: boolean) => void } /** * Use sidebar * * 侧边栏数据,获取当前路由的侧边栏项目和分组 */ export declare function useSidebar(): { sidebar: Ref sidebarKey: ComputedRef sidebarGroups: ComputedRef } /** * Use close sidebar on escape * * a11y: 缓存打开侧边栏的元素(菜单按钮),当使用 Escape 关闭菜单时重新聚焦该按钮 */ export declare function useCloseSidebarOnEscape(): void /** * Use sidebar item control * * 侧边栏项目控制,管理单个侧边栏项目的折叠状态、激活状态等 */ export declare function useSidebarItemControl( item: ComputedRef, ): SidebarItemControl export interface SidebarItemControl { collapsed: Ref collapsible: ComputedRef isLink: ComputedRef isActiveLink: Ref hasActiveLink: ComputedRef hasChildren: ComputedRef toggle: () => void } export type TagColors = Record export type TagColorsRef = Ref export declare const useTagColors: () => TagColorsRef type TransitionMode = Exclude export declare function resolveTransitionKeyframes( x: number, y: number, mode: TransitionMode, isDark: boolean, ): { keyframes: PropertyIndexedKeyframes duration: number } export declare function setupWatermark(): void export {}