From 35e85c5fb4e0fb62b10968eb7b9a15f24cab1271 Mon Sep 17 00:00:00 2001 From: pengzhanbo Date: Tue, 15 Oct 2024 03:42:21 +0800 Subject: [PATCH] chore: improve types --- theme/src/node/config/resolveSearchOptions.ts | 6 +++--- theme/src/node/locales/index.ts | 4 ++-- theme/src/node/locales/zh.ts | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/theme/src/node/config/resolveSearchOptions.ts b/theme/src/node/config/resolveSearchOptions.ts index a7e4c14f..4d1cdb28 100644 --- a/theme/src/node/config/resolveSearchOptions.ts +++ b/theme/src/node/config/resolveSearchOptions.ts @@ -1,4 +1,4 @@ -import type { DocsearchPluginOptions } from '@vuepress/plugin-docsearch' +import type { DocSearchPluginOptions } from '@vuepress/plugin-docsearch' import type { SearchPluginOptions } from '@vuepress-plume/plugin-search' import type { App } from 'vuepress' import { getLocaleConfig } from '@vuepress/helper' @@ -20,8 +20,8 @@ export function resolveSearchOptions( export function resolveDocsearchOptions( app: App, - { locales, ...options }: DocsearchPluginOptions = {}, -): DocsearchPluginOptions { + { locales, ...options }: DocSearchPluginOptions = {}, +): DocSearchPluginOptions { return { ...options, locales: getLocaleConfig({ diff --git a/theme/src/node/locales/index.ts b/theme/src/node/locales/index.ts index cde8c102..8ab2cfa3 100644 --- a/theme/src/node/locales/index.ts +++ b/theme/src/node/locales/index.ts @@ -1,4 +1,4 @@ -import type { DocsearchLocaleOptions } from '@vuepress/plugin-docsearch' +import type { DocSearchLocaleOptions } from '@vuepress/plugin-docsearch' import type { SearchLocaleOptions } from '@vuepress-plume/plugin-search' import type { PlumeThemeLocaleData, PresetLocale } from '../../shared/index.js' import { enLocale, enPresetLocale, enSearchLocale } from './en.js' @@ -14,7 +14,7 @@ export const PRESET_LOCALES: Record = { '/en/': enPresetLocale, } -export const DOCSEARCH_LOCALES: Record = { +export const DOCSEARCH_LOCALES: Record = { '/zh/': zhDocsearchLocale, } diff --git a/theme/src/node/locales/zh.ts b/theme/src/node/locales/zh.ts index 908699c0..0fd03575 100644 --- a/theme/src/node/locales/zh.ts +++ b/theme/src/node/locales/zh.ts @@ -1,4 +1,4 @@ -import type { DocsearchLocaleOptions } from '@vuepress/plugin-docsearch' +import type { DocSearchLocaleOptions } from '@vuepress/plugin-docsearch' import type { SearchLocaleOptions } from '@vuepress-plume/plugin-search' import type { PlumeThemeLocaleData, PresetLocale } from '../../shared/index.js' @@ -47,7 +47,7 @@ export const zhPresetLocale: PresetLocale = { category: '分类', } -export const zhDocsearchLocale: DocsearchLocaleOptions = { +export const zhDocsearchLocale: DocSearchLocaleOptions = { placeholder: '搜索文档', translations: { button: {