import * as vue from 'vue'; import { Component, InjectionKey, Ref, App, AsyncComponentLoader } from 'vue'; import { PageData, Awaitable, SiteData } from '../../types/shared.js'; export { HeadConfig, Header, PageData, SiteData } from '../../types/shared.js'; declare const inBrowser: boolean; 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 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; } declare function useData(): VitePressData; interface EnhanceAppContext { app: App; router: Router; siteData: Ref; } interface Theme { Layout?: Component; 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; } /** * 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; 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, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly>, { as: string | Record; }, {}>; export { Content, type EnhanceAppContext, type Route, type Router, type Theme, type VitePressData, dataSymbol, defineClientComponent, getScrollOffset, inBrowser, onContentUpdated, useData, useRoute, useRouter, withBase };