docs/.vitepress/theme/types.ts

bc0f94b64cf0ecff495c9e69562b955bfb5652b0
wotaku/docs/.vitepress/theme/types.ts history · blame · raw

132 lines · 2784 bytes

  1import type { LayoutMode, SpotlightStyle } from './constants'
  2
  3/**
  4 * Options
  5 */
  6export interface Options {
  7  /**
  8   * Internationalization configuration
  9   *
 10   * When configuring, please configure according to the language code configured in
 11   * VitePress internationalization configuration. In the following configuration, 'en'
 12   * and 'zh-CN' are the language codes configured in VitePress internationalization
 13   * configuration.
 14   *
 15   * @default undefined
 16   * @example
 17   * ```ts
 18   * {
 19   *  locales: {
 20   *    'en': {
 21   *      title: {
 22   *       title: 'Reading Mode',
 23   *      titleAriaLabel: 'Reading Mode',
 24   *    },
 25   *    'zh-CN': {
 26   *       title: {
 27   *         title: '阅读模式',
 28   *         titleAriaLabel: '阅读模式',
 29   *     },
 30   *   }
 31   * }
 32   * ```
 33   */
 34  /**
 35   * Layout switch configuration
 36   */
 37  layoutSwitch?: {
 38    /**
 39     * Disable layout switch help tooltip
 40     *
 41     * @default false
 42     */
 43    disableHelp?: boolean
 44    /**
 45     * Default mode for layout switch
 46     *
 47     * @default LayoutMode.Original (3)
 48     */
 49    defaultMode?: LayoutMode
 50    /**
 51     * Disable Layout Switch animation
 52     */
 53    disableAnimation?: boolean
 54    /**
 55     * Content layout max width slider configuration
 56     */
 57    contentLayoutMaxWidth?: {
 58      /**
 59       * Disable content layout max width help tooltip
 60       *
 61       * @default false
 62       */
 63      disableHelp?: boolean
 64      /**
 65       * Default percentage of content layout max width
 66       *
 67       * @default 80 (80%)
 68       */
 69      defaultMaxWidth?: number
 70      /**
 71       * Disable Layout Max Width animation
 72       */
 73      disableAnimation?: boolean
 74    }
 75    /**
 76     * Page layout max width slider configuration
 77     */
 78    pageLayoutMaxWidth?: {
 79      /**
 80       * Disable page layout max width help tooltip
 81       *
 82       * @default false
 83       */
 84      disableHelp?: boolean
 85      /**
 86       * Default percentage of page layout max width
 87       *
 88       * @default 100 (100%)
 89       */
 90      defaultMaxWidth?: number
 91      /**
 92       * Disable Layout Max Width animation
 93       */
 94      disableAnimation?: boolean
 95    }
 96  }
 97  /**
 98   * Spotlight configuration
 99   */
100  spotlight?: {
101    /**
102     * Disable spotlight
103     *
104     * @default false
105     */
106    disabled?: boolean
107    /**
108     * Disable spotlight help tooltip
109     *
110     * @default false
111     */
112    disableHelp?: boolean
113    /**
114     * Spotlight hover block color
115     *
116     * @default 'rgb(240 197 52 / 10%)'
117     */
118    hoverBlockColor?: string
119    /**
120     * Default toggle for spotlight
121     *
122     * @default false
123     */
124    defaultToggle?: boolean
125    /**
126     * Default style for spotlight
127     *
128     * @default SpotlightStyle.Aside (2)
129     */
130    defaultStyle?: SpotlightStyle
131  }
132}