import * as vue from 'vue'; import { Component, InjectionKey, Ref } from 'vue'; import { UseDarkOptions } from '@vueuse/core'; import { App, Ref as Ref$1, Component as Component$1 } from 'vue-demi'; // types shared between server and client type Awaitable = T | PromiseLike interface PageData { relativePath: string /** * differs from relativePath in case of path rewrites * empty string if the page is virtual (e.g. 404 page) */ filePath: string title: string titleTemplate?: string | boolean description: string headers: Header[] frontmatter: Record params?: Record isNotFound?: boolean lastUpdated?: number } interface Header { /** * The level of the header * * `1` to `6` for `

` to `

` */ level: number /** * The title of the header */ title: string /** * The slug of the header * * Typically the `id` attr of the header anchor */ slug: string /** * Link of the header * * Typically using `#${slug}` as the anchor hash */ link: string /** * The children of the header */ children: Header[] } interface SiteData { base: string cleanUrls?: boolean lang: string dir: string title: string titleTemplate?: string | boolean description: string head: HeadConfig[] appearance: | boolean | 'dark' | 'force-dark' | 'force-auto' | (Omit & { initialValue?: 'dark' }) themeConfig: ThemeConfig scrollOffset: | number | string | string[] | { selector: string | string[]; padding: number } locales: LocaleConfig localeIndex?: string contentProps?: Record router: { prefetchLinks: boolean } } type HeadConfig = | [string, Record] | [string, Record, string] interface LocaleSpecificConfig { lang?: string dir?: string title?: string titleTemplate?: string | boolean description?: string head?: HeadConfig[] themeConfig?: ThemeConfig } type LocaleConfig = Record< string, LocaleSpecificConfig & { label: string; link?: string } > declare const inBrowser: boolean; /** * @internal */ declare function escapeHtml(str: string): string; interface Route { path: string; data: PageData; component: Component | null; } interface Router { /** * Current route. */ route: Route; /** * Navigate to a new URL. */ go: (to?: string) => Promise; /** * Called before the route changes. Return `false` to cancel the navigation. */ onBeforeRouteChange?: (to: string) => Awaitable; /** * Called before the page component is loaded (after the history state is * updated). Return `false` to cancel the navigation. */ onBeforePageLoad?: (to: string) => Awaitable; /** * Called after the page component is loaded (before the page component is updated). */ onAfterPageLoad?: (to: string) => Awaitable; /** * Called after the route changes. */ onAfterRouteChanged?: (to: string) => Awaitable; } declare function useRouter(): Router; declare function useRoute(): Route; declare const dataSymbol: InjectionKey; interface VitePressData { /** * Site-level metadata */ site: Ref>; /** * themeConfig from .vitepress/config.js */ theme: Ref; /** * Page-level metadata */ page: Ref; /** * page frontmatter data */ frontmatter: Ref; /** * dynamic route params */ params: Ref; title: Ref; description: Ref; lang: Ref; dir: Ref; localeIndex: Ref; isDark: Ref; /** * Current location hash */ hash: Ref; } declare function useData(): VitePressData; interface EnhanceAppContext { app: App; router: Router; siteData: Ref$1; } interface Theme { Layout?: Component$1; enhanceApp?: (ctx: EnhanceAppContext) => Awaitable; extends?: Theme; /** * @deprecated can be replaced by wrapping layout component */ setup?: () => void; /** * @deprecated Render not found page by checking `useData().page.value.isNotFound` in Layout instead. */ NotFound?: Component$1; } /** * Append base to internal (non-relative) urls */ declare function withBase(path: string): string; /** * Register callback that is called every time the markdown content is updated * in the DOM. */ declare function onContentUpdated(fn: () => any): void; type AsyncComponentResolveResult = T | { default: T; }; type AsyncComponentLoader = () => Promise>; declare function defineClientComponent(loader: AsyncComponentLoader, args?: any[], cb?: () => Awaitable): { setup(): () => vue.VNode | null; }; declare function getScrollOffset(): number; declare const Content: vue.DefineComponent<{ as: { type: (ObjectConstructor | StringConstructor)[]; default: string; }; }, () => vue.VNode, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, Readonly>, { as: string | Record; }>; export { Content, type EnhanceAppContext, type HeadConfig, type Header, type PageData, type Route, type Router, type SiteData, type Theme, type VitePressData, escapeHtml as _escapeHtml, dataSymbol, defineClientComponent, getScrollOffset, inBrowser, onContentUpdated, useData, useRoute, useRouter, withBase };