import * as vue from 'vue'; import { Component, 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 { route: Route; go: (href?: string) => Promise; onBeforeRouteChange?: (to: string) => Awaitable; onAfterRouteChanged?: (to: string) => Awaitable; } declare function useRouter(): Router; declare function useRoute(): Route; 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; isDark: Ref; dir: Ref; localeIndex: 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; } 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 const Content: vue.DefineComponent<{ as: { type: (ObjectConstructor | StringConstructor)[]; default: string; }; }, () => vue.VNode, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly>, { as: string | Record; }, {}>; export { Content, EnhanceAppContext, Route, Router, Theme, VitePressData, defineClientComponent, inBrowser, onContentUpdated, useData, useRoute, useRouter, withBase };