// types shared between server and client import type { MarkdownItHeader } from '@mdit-vue/types' export type { DefaultTheme } from './default-theme.js' export interface PageData { relativePath: string title: string titleTemplate?: string | boolean description: string headers: Header[] frontmatter: Record lastUpdated?: number } export type Header = MarkdownItHeader export type CleanUrlsMode = | 'disabled' | 'without-subfolders' | 'with-subfolders' export interface SiteData { base: string cleanUrls?: CleanUrlsMode /** * Language of the site as it should be set on the `html` element. * * @example `en-US`, `zh-CN` */ lang: string title: string titleTemplate?: string | boolean description: string head: HeadConfig[] appearance: boolean themeConfig: ThemeConfig scrollOffset: number | string locales: Record /** * Available locales for the site when it has defined `locales` in its * `themeConfig`. This object is otherwise empty. Keys are paths like `/` or * `/zh/`. */ langs: Record< string, { /** * Lang attribute as set on the `` element. * @example `en-US`, `zh-CN` */ lang: string /** * Label to display in the language menu. * @example `English`, `简体中文` */ label: string } > } export type HeadConfig = | [string, Record] | [string, Record, string] export interface LocaleConfig { lang: string title?: string titleTemplate?: string | boolean description?: string head?: HeadConfig[] label?: string selectText?: string } export interface PageDataPayload { path: string pageData: PageData }