@142vip/vuepress
Version:
VuePress使用的最佳实践,基于vuepress-theme-hope的封装
46 lines (42 loc) • 1.66 kB
text/typescript
import { UserConfig } from '@vuepress/cli';
import { NavbarOptions, SidebarOptions, ThemePluginsOptions, ThemeOptions } from 'vuepress-theme-hope';
/**
* 用户配置
*/
type VipVuepressUserConfig = UserConfig;
/**
* 在原 config 上补全默认项后返回(lang / bundler / head / shouldPrefetch)。
*/
declare function defineVipVuepressConfig(config: VipVuepressUserConfig): VipVuepressUserConfig;
/**
* 导航栏
*/
declare function defineVipNavbarConfig(options: NavbarOptions): NavbarOptions;
/**
* 侧边栏
*/
declare function defineVipSidebarConfig(options: SidebarOptions): SidebarOptions;
/**
* 默认的文档目录
* - docs
*/
declare const VUEPRESS_DEFAULT_DOCS_DIR: string;
/**
* 主题中插件的一些配置
*/
declare const baseThemePluginOptions: ThemePluginsOptions;
/**
* 主题相关配置
* 参考:https://theme-hope.vuejs.press/zh/config/intro.html
*/
declare function getVipHopeTheme(userConfig: ThemeOptions): ThemeFunction;
/**
* 引入代码文件时的路径替换
* https://vuejs.press/zh/guide/markdown.html#%E5%AF%BC%E5%85%A5%E4%BB%A3%E7%A0%81%E5%9D%97
* - 例如:引入的路径中包含@code,会替换为当前目录下的code目录
* @param pathArray 路径规则,旧路径,新路径
* @param cwd 文件目录,默认当前目录
* @returns 新路径
*/
declare function handleImportCodePath(pathArray: Array<[oldPath: string, newPath: string]>, cwd?: string): (str: string) => string;
export { VUEPRESS_DEFAULT_DOCS_DIR, type VipVuepressUserConfig, baseThemePluginOptions, defineVipNavbarConfig, defineVipSidebarConfig, defineVipVuepressConfig, getVipHopeTheme, handleImportCodePath };