// types shared between server and client import type { UseDarkOptions } from '@vueuse/core' import type { Component, Ref } from 'vue' import type { SSRContext } from 'vue/server-renderer' export type { DefaultTheme } from './default-theme.js' /** * A value of type `T`, or a promise resolving to it. */ export type Awaitable = T | PromiseLike /** * Recursively makes all properties of `T` optional, leaving non-plain * objects (dates, regexps, functions, collections) as-is. */ export type DeepPartial = T extends Record ? T extends | Date | RegExp | Function | ReadonlyMap | ReadonlySet | ReadonlyArray ? T : { [P in keyof T]?: DeepPartial } : T /** * The data of a page, available on both server and client. */ export interface PageData { /** * The path of the page relative to the source directory, with rewrites * applied. Determines the URL of the page. */ relativePath: string /** * The path of the actual source file relative to the source directory. * Differs from `relativePath` when path rewrites are in use, points to * the route template for dynamic routes, and is an empty string if the * page is virtual (e.g. the 404 page). */ filePath: string /** * The title of the page, from its frontmatter or its first level-1 * heading. */ title: string /** * The suffix appended to the title (`title | suffix`), or a template * containing the `:title` token. Set to `false` to use the title as-is. */ titleTemplate?: string | boolean /** * The description of the page, from its frontmatter. */ description: string /** * The section headers extracted from the page. */ headers: Header[] /** * The frontmatter of the page. */ frontmatter: Record /** * The route params of the page, if it belongs to a dynamic route. */ params?: Record /** * Whether the page is the not-found (404) page. */ isNotFound?: boolean /** * The timestamp (in milliseconds) of the last update, from the page's * frontmatter or its last git commit. */ lastUpdated?: number } /** * A block of the Vue SFC generated from a markdown source file. */ export interface SfcBlock { /** * The type of the block. */ type: string /** * The content of the block, including its open and close tags. */ content: string /** * The content of the block, with its open and close tags stripped. */ contentStripped: string /** * The open tag of the block. */ tagOpen: string /** * The close tag of the block. */ tagClose: string } /** * The SFC blocks extracted from a markdown source file. */ export interface MarkdownSfcBlocks { /** * The `