diff --git a/docs/plugins/blog/comment/waline/config.md b/docs/plugins/blog/comment/waline/config.md index bfdb89ff5f..3bdeb087f0 100644 --- a/docs/plugins/blog/comment/waline/config.md +++ b/docs/plugins/blog/comment/waline/config.md @@ -265,7 +265,7 @@ ```ts interface WalineLocales { - [localePath: string]: WalineLocale + [localePath: string]: Partial } ``` diff --git a/docs/plugins/development/reading-time.md b/docs/plugins/development/reading-time.md index 712f41f69d..62cd631fdb 100644 --- a/docs/plugins/development/reading-time.md +++ b/docs/plugins/development/reading-time.md @@ -100,7 +100,7 @@ const readingTimeLocale = useReadingTimeLocale() // { time: "1 minute", words: " } interface ReadingTimePluginLocaleConfig { - [localePath: string]: ReadingTimePluginLocaleData + [localePath: string]: Partial } ``` diff --git a/docs/plugins/features/catalog.md b/docs/plugins/features/catalog.md index ef9a1970a4..b277e42753 100644 --- a/docs/plugins/features/catalog.md +++ b/docs/plugins/features/catalog.md @@ -154,7 +154,7 @@ Project with order -1 } interface CatalogPluginLocaleConfig { - [localePath: string]: CatalogPluginLocaleData + [localePath: string]: Partial } ``` diff --git a/docs/plugins/features/copy-code.md b/docs/plugins/features/copy-code.md index c632b1ec1c..e49e531e13 100644 --- a/docs/plugins/features/copy-code.md +++ b/docs/plugins/features/copy-code.md @@ -115,7 +115,7 @@ export default { } interface CopyCodePluginLocaleConfig { - [localePath: string]: CopyCodePluginLocaleData + [localePath: string]: Partial } ``` diff --git a/docs/plugins/features/copyright.md b/docs/plugins/features/copyright.md index e952d54bd5..ba0a2a4bfb 100644 --- a/docs/plugins/features/copyright.md +++ b/docs/plugins/features/copyright.md @@ -146,7 +146,7 @@ So copyright message triggered on another site also points to your preferred sit } interface CopyrightPluginLocaleConfig { - [localePath: string]: CopyrightPluginLocaleData + [localePath: string]: Partial } ``` diff --git a/docs/plugins/features/photo-swipe.md b/docs/plugins/features/photo-swipe.md index d116e6310a..ae8444fc19 100644 --- a/docs/plugins/features/photo-swipe.md +++ b/docs/plugins/features/photo-swipe.md @@ -107,7 +107,7 @@ In preview mode, you can: } interface PhotoSwipePluginLocaleConfig { - [localePath: string]: PhotoSwipePluginLocaleData + [localePath: string]: Partial } ``` diff --git a/docs/plugins/markdown/markdown-hint.md b/docs/plugins/markdown/markdown-hint.md index f8544f66e5..8cc84fa4c4 100644 --- a/docs/plugins/markdown/markdown-hint.md +++ b/docs/plugins/markdown/markdown-hint.md @@ -118,11 +118,11 @@ The plugin also provides an `alert` option to support gfm alerts: ### locales -- Type: `MarkdownHintPluginLocaleOptions` +- Type: `MarkdownHintPluginLocaleConfig` ```ts - interface MarkdownHintPluginLocaleOptions { - [localePath: string]: MarkdownHintPluginLocaleData + interface MarkdownHintPluginLocaleConfig { + [localePath: string]: Partial } interface MarkdownHintPluginLocaleData { diff --git a/docs/plugins/pwa/pwa/config.md b/docs/plugins/pwa/pwa/config.md index e5900fa34a..37166f90ff 100644 --- a/docs/plugins/pwa/pwa/config.md +++ b/docs/plugins/pwa/pwa/config.md @@ -243,7 +243,7 @@ Special settings for better supporting Safari, ignoring these options are safe. } interface PwaPluginLocaleConfig { - [localePath: string]: PwaPluginLocaleData + [localePath: string]: Partial } ``` diff --git a/docs/plugins/tools/redirect.md b/docs/plugins/tools/redirect.md index 3d266c4eed..a682aebe2d 100644 --- a/docs/plugins/tools/redirect.md +++ b/docs/plugins/tools/redirect.md @@ -254,7 +254,7 @@ By default, the plugin will output to `.vuepress/redirect` directory under sourc } interface RedirectPluginLocaleConfig { - [localePath: string]: RedirectPluginLocaleData + [localePath: string]: Partial } ``` diff --git a/docs/zh/plugins/blog/comment/waline/config.md b/docs/zh/plugins/blog/comment/waline/config.md index da795ff1ab..7297595d91 100644 --- a/docs/zh/plugins/blog/comment/waline/config.md +++ b/docs/zh/plugins/blog/comment/waline/config.md @@ -257,7 +257,7 @@ ```ts interface WalineLocales { - [localePath: string]: WalineLocale + [localePath: string]: Partial } ``` diff --git a/docs/zh/plugins/development/reading-time.md b/docs/zh/plugins/development/reading-time.md index 793f084961..ab52570307 100644 --- a/docs/zh/plugins/development/reading-time.md +++ b/docs/zh/plugins/development/reading-time.md @@ -100,7 +100,7 @@ const readingTimeLocale = useReadingTimeLocale() // { time: "1 分钟", words: " } interface ReadingTimePluginLocaleConfig { - [localePath: string]: ReadingTimePluginLocaleData + [localePath: string]: Partial } ``` diff --git a/docs/zh/plugins/features/catalog.md b/docs/zh/plugins/features/catalog.md index 988b2f7b3d..f425752b2e 100644 --- a/docs/zh/plugins/features/catalog.md +++ b/docs/zh/plugins/features/catalog.md @@ -152,7 +152,7 @@ order -1 的项目 } interface CatalogPluginLocaleConfig { - [localePath: string]: CatalogPluginLocaleData + [localePath: string]: Partial } ``` diff --git a/docs/zh/plugins/features/copy-code.md b/docs/zh/plugins/features/copy-code.md index bed721cb08..436ffb092f 100644 --- a/docs/zh/plugins/features/copy-code.md +++ b/docs/zh/plugins/features/copy-code.md @@ -114,7 +114,7 @@ export default { } interface CopyCodePluginLocaleConfig { - [localePath: string]: CopyCodePluginLocaleData + [localePath: string]: Partial } ``` diff --git a/docs/zh/plugins/features/copyright.md b/docs/zh/plugins/features/copyright.md index e9c11ca105..b064a36e68 100644 --- a/docs/zh/plugins/features/copyright.md +++ b/docs/zh/plugins/features/copyright.md @@ -148,7 +148,7 @@ export default { } interface CopyrightPluginLocaleConfig { - [localePath: string]: CopyrightPluginLocaleData + [localePath: string]: Partial } ``` diff --git a/docs/zh/plugins/features/photo-swipe.md b/docs/zh/plugins/features/photo-swipe.md index aafe5ab591..999ac4c151 100644 --- a/docs/zh/plugins/features/photo-swipe.md +++ b/docs/zh/plugins/features/photo-swipe.md @@ -107,7 +107,7 @@ export default { } interface PhotoSwipePluginLocaleConfig { - [localePath: string]: PhotoSwipePluginLocaleData + [localePath: string]: Partial } ``` diff --git a/docs/zh/plugins/markdown/markdown-hint.md b/docs/zh/plugins/markdown/markdown-hint.md index 83a5606118..0c84405b7b 100644 --- a/docs/zh/plugins/markdown/markdown-hint.md +++ b/docs/zh/plugins/markdown/markdown-hint.md @@ -118,11 +118,11 @@ const a = 1 ### locales -- 类型:`MarkdownHintPluginLocaleOptions` +- 类型:`MarkdownHintPluginLocaleConfig` ```ts - interface MarkdownHintPluginLocaleOptions { - [localePath: string]: MarkdownHintPluginLocaleData + interface MarkdownHintPluginLocaleConfig { + [localePath: string]: Partial } interface MarkdownHintPluginLocaleData { diff --git a/docs/zh/plugins/pwa/pwa/config.md b/docs/zh/plugins/pwa/pwa/config.md index a9caad660b..5c9ee7f7fa 100644 --- a/docs/zh/plugins/pwa/pwa/config.md +++ b/docs/zh/plugins/pwa/pwa/config.md @@ -241,7 +241,7 @@ } interface PwaPluginLocaleConfig { - [localePath: string]: PwaPluginLocaleData + [localePath: string]: Partial } ``` diff --git a/docs/zh/plugins/search/slimsearch.md b/docs/zh/plugins/search/slimsearch.md index b7db2ce75d..89bcdc0ee2 100644 --- a/docs/zh/plugins/search/slimsearch.md +++ b/docs/zh/plugins/search/slimsearch.md @@ -386,7 +386,7 @@ export default defineUserConfig({ } interface SlimSearchLocaleConfig { - [localePath: string]: SlimSearchLocaleData + [localePath: string]: Partial } ``` diff --git a/docs/zh/plugins/tools/redirect.md b/docs/zh/plugins/tools/redirect.md index 691b1292e0..edad560222 100644 --- a/docs/zh/plugins/tools/redirect.md +++ b/docs/zh/plugins/tools/redirect.md @@ -262,7 +262,7 @@ Options: } interface RedirectPluginLocaleConfig { - [localePath: string]: RedirectPluginLocaleData + [localePath: string]: Partial } ``` diff --git a/plugins/blog/plugin-comment/src/client/components/WalineComment.ts b/plugins/blog/plugin-comment/src/client/components/WalineComment.ts index f8bdb6451f..bcbb1e4edd 100644 --- a/plugins/blog/plugin-comment/src/client/components/WalineComment.ts +++ b/plugins/blog/plugin-comment/src/client/components/WalineComment.ts @@ -1,3 +1,4 @@ +import type { ExactLocaleConfig } from '@vuepress/helper/client' import { LoadingIcon, useLocaleConfig, wait } from '@vuepress/helper/client' import { watchImmediate } from '@vueuse/core' import { pageviewCount } from '@waline/client/pageview' @@ -13,7 +14,7 @@ import { import { usePageFrontmatter, usePageLang } from 'vuepress/client' import type { CommentPluginFrontmatter, - WalineLocaleConfig, + WalineLocaleData, } from '../../shared/index.js' import { useWalineOptions } from '../helpers/index.js' @@ -21,7 +22,7 @@ import '@waline/client/waline.css' import '../styles/waline.css' declare const WALINE_META: boolean -declare const WALINE_LOCALES: WalineLocaleConfig +declare const WALINE_LOCALES: ExactLocaleConfig const walineLocales = WALINE_LOCALES diff --git a/plugins/blog/plugin-comment/src/shared/options/waline.ts b/plugins/blog/plugin-comment/src/shared/options/waline.ts index c2c8d28137..3144a64d3c 100644 --- a/plugins/blog/plugin-comment/src/shared/options/waline.ts +++ b/plugins/blog/plugin-comment/src/shared/options/waline.ts @@ -1,11 +1,8 @@ -import type { ExactLocaleConfig } from '@vuepress/helper' import type { WalineInitOptions, WalineLocale } from '@waline/client' import type { BaseCommentPluginOptions } from './base.js' export type WalineLocaleData = Partial -export type WalineLocaleConfig = ExactLocaleConfig - export interface WalineOptions extends BaseCommentPluginOptions, Omit { diff --git a/plugins/development/plugin-reading-time/src/client/composables/useReadingTimeLocale.ts b/plugins/development/plugin-reading-time/src/client/composables/useReadingTimeLocale.ts index 6d0414e163..65e3153ca8 100644 --- a/plugins/development/plugin-reading-time/src/client/composables/useReadingTimeLocale.ts +++ b/plugins/development/plugin-reading-time/src/client/composables/useReadingTimeLocale.ts @@ -1,15 +1,13 @@ +import type { ExactLocaleConfig } from '@vuepress/helper/client' import { useLocaleConfig } from '@vuepress/helper/client' import type { ComputedRef } from 'vue' import { computed } from 'vue' -import type { - ReadingTimePluginLocaleConfig, - ReadingTimePluginLocaleData, -} from '../../shared/index.js' +import type { ReadingTimePluginLocaleData } from '../../shared/index.js' import { getReadingTimeLocale } from '../utils/index.js' import { useReadingTimeData } from './useReadingTimeData.js' declare const __READING_TIME_LOCALES__: - | ReadingTimePluginLocaleConfig + | ExactLocaleConfig | undefined const DEFAULT_LOCALE = { words: '', time: '' } diff --git a/plugins/development/plugin-reading-time/src/shared/locales.ts b/plugins/development/plugin-reading-time/src/shared/locales.ts index 932eaf94d7..b3f8085946 100644 --- a/plugins/development/plugin-reading-time/src/shared/locales.ts +++ b/plugins/development/plugin-reading-time/src/shared/locales.ts @@ -1,5 +1,3 @@ -import type { ExactLocaleConfig } from '@vuepress/helper/shared' - /** * Multi language config for `@vuepress/plugin-reading-time` plugin * @@ -27,6 +25,3 @@ export interface ReadingTimePluginLocaleData { */ time: string } - -export type ReadingTimePluginLocaleConfig = - ExactLocaleConfig diff --git a/plugins/features/plugin-back-to-top/src/client/components/BackToTop.ts b/plugins/features/plugin-back-to-top/src/client/components/BackToTop.ts index 6efffe20be..a8637cd0e2 100644 --- a/plugins/features/plugin-back-to-top/src/client/components/BackToTop.ts +++ b/plugins/features/plugin-back-to-top/src/client/components/BackToTop.ts @@ -1,3 +1,4 @@ +import type { ExactLocaleConfig } from '@vuepress/helper/client' import { useLocaleConfig } from '@vuepress/helper/client' import { useElementSize, useWindowScroll, useWindowSize } from '@vueuse/core' import { @@ -9,11 +10,11 @@ import { shallowRef, } from 'vue' import { usePageFrontmatter } from 'vuepress/client' -import type { BackToTopPluginLocaleConfig } from '../../shared/index.js' +import type { BackToTopPluginLocaleData } from '../../shared/index.js' import '../styles/back-to-top.css' -declare const __BACK_TO_TOP_LOCALES__: BackToTopPluginLocaleConfig +declare const __BACK_TO_TOP_LOCALES__: ExactLocaleConfig declare const __BACK_TO_TOP_PROGRESS__: boolean declare const __BACK_TO_TOP_THRESHOLD__: number diff --git a/plugins/features/plugin-back-to-top/src/shared/locales.ts b/plugins/features/plugin-back-to-top/src/shared/locales.ts index 1483498f1f..d5d323a979 100644 --- a/plugins/features/plugin-back-to-top/src/shared/locales.ts +++ b/plugins/features/plugin-back-to-top/src/shared/locales.ts @@ -1,5 +1,3 @@ -import type { ExactLocaleConfig } from '@vuepress/helper/shared' - export interface BackToTopPluginLocaleData { /** * Back to top button label text @@ -8,6 +6,3 @@ export interface BackToTopPluginLocaleData { */ backToTop: string } - -export type BackToTopPluginLocaleConfig = - ExactLocaleConfig diff --git a/plugins/features/plugin-catalog/src/client/components/Catalog.ts b/plugins/features/plugin-catalog/src/client/components/Catalog.ts index 89f8e530e5..5479e8429d 100644 --- a/plugins/features/plugin-catalog/src/client/components/Catalog.ts +++ b/plugins/features/plugin-catalog/src/client/components/Catalog.ts @@ -1,4 +1,5 @@ /* eslint-disable @typescript-eslint/no-shadow */ +import type { ExactLocaleConfig } from '@vuepress/helper/client' import { endsWith, ensureEndingSlash, @@ -14,13 +15,13 @@ import { import type { VNode } from 'vue' import { computed, defineComponent, h, shallowRef } from 'vue' import { RouteLink, usePageData, useRoutes, useSiteData } from 'vuepress/client' -import type { CatalogPluginLocaleConfig } from '../../shared/index.js' +import type { CatalogPluginLocaleData } from '../../shared/index.js' import type { CatalogInfo } from '../helpers/index.js' import { useCatalogInfoGetter } from '../helpers/index.js' import '../styles/catalog.css' -declare const __CATALOG_LOCALES__: CatalogPluginLocaleConfig +declare const __CATALOG_LOCALES__: ExactLocaleConfig export interface CatalogProps { base?: string diff --git a/plugins/features/plugin-catalog/src/shared/locales.ts b/plugins/features/plugin-catalog/src/shared/locales.ts index 208ece015f..6a74c5fc0f 100644 --- a/plugins/features/plugin-catalog/src/shared/locales.ts +++ b/plugins/features/plugin-catalog/src/shared/locales.ts @@ -1,5 +1,3 @@ -import type { ExactLocaleConfig } from '@vuepress/helper' - export interface CatalogPluginLocaleData { /** * Catalog title text @@ -15,6 +13,3 @@ export interface CatalogPluginLocaleData { */ empty: string } - -export type CatalogPluginLocaleConfig = - ExactLocaleConfig diff --git a/plugins/features/plugin-copy-code/src/client/composables/useCopyCode.ts b/plugins/features/plugin-copy-code/src/client/composables/useCopyCode.ts index 9415f8abf3..49034dad70 100644 --- a/plugins/features/plugin-copy-code/src/client/composables/useCopyCode.ts +++ b/plugins/features/plugin-copy-code/src/client/composables/useCopyCode.ts @@ -7,7 +7,7 @@ import { } from '@vueuse/core' import { computed, nextTick } from 'vue' import { usePageData } from 'vuepress/client' -import type { CopyCodePluginLocaleConfig } from '../../shared/index.js' +import type { CopyCodePluginLocaleConfig } from '../types.js' import '../styles/copy-code.css' import '../styles/vars.css' diff --git a/plugins/features/plugin-copy-code/src/client/config.ts b/plugins/features/plugin-copy-code/src/client/config.ts index f078e6876c..c7189b1b5c 100644 --- a/plugins/features/plugin-copy-code/src/client/config.ts +++ b/plugins/features/plugin-copy-code/src/client/config.ts @@ -1,6 +1,6 @@ import { defineClientConfig } from 'vuepress/client' -import type { CopyCodePluginLocaleConfig } from '../shared/index.js' import { useCopyCode } from './composables/index.js' +import type { CopyCodePluginLocaleConfig } from './types.js' declare const __CC_DELAY__: number declare const __CC_DURATION__: number diff --git a/plugins/features/plugin-copy-code/src/client/types.ts b/plugins/features/plugin-copy-code/src/client/types.ts new file mode 100644 index 0000000000..25469a6d35 --- /dev/null +++ b/plugins/features/plugin-copy-code/src/client/types.ts @@ -0,0 +1,5 @@ +import type { ExactLocaleConfig } from '@vuepress/helper/client' +import type { CopyCodePluginLocaleData } from '../shared/index.js' + +export type CopyCodePluginLocaleConfig = + ExactLocaleConfig diff --git a/plugins/features/plugin-copy-code/src/shared/locales.ts b/plugins/features/plugin-copy-code/src/shared/locales.ts index 11b02038dd..4ebff5e892 100644 --- a/plugins/features/plugin-copy-code/src/shared/locales.ts +++ b/plugins/features/plugin-copy-code/src/shared/locales.ts @@ -1,5 +1,3 @@ -import type { ExactLocaleConfig } from '@vuepress/helper/shared' - export interface CopyCodePluginLocaleData { /** * Copy text @@ -15,6 +13,3 @@ export interface CopyCodePluginLocaleData { */ copied: string } - -export type CopyCodePluginLocaleConfig = - ExactLocaleConfig diff --git a/plugins/features/plugin-copyright/src/shared/locales.ts b/plugins/features/plugin-copyright/src/shared/locales.ts index 652f086bbf..99ee3107b3 100644 --- a/plugins/features/plugin-copyright/src/shared/locales.ts +++ b/plugins/features/plugin-copyright/src/shared/locales.ts @@ -1,5 +1,3 @@ -import type { ExactLocaleConfig } from '@vuepress/helper' - export interface CopyrightPluginLocaleData { /** * Author text @@ -34,6 +32,3 @@ export interface CopyrightPluginLocaleData { */ link: string } - -export type CopyrightPluginLocaleConfig = - ExactLocaleConfig diff --git a/plugins/features/plugin-photo-swipe/src/shared/locales.ts b/plugins/features/plugin-photo-swipe/src/shared/locales.ts index 5ee6363cc1..0269b791e2 100644 --- a/plugins/features/plugin-photo-swipe/src/shared/locales.ts +++ b/plugins/features/plugin-photo-swipe/src/shared/locales.ts @@ -1,5 +1,3 @@ -import type { ExactLocaleConfig } from '@vuepress/helper' - export interface PhotoSwipePluginLocaleData { /** * Close button label text @@ -43,6 +41,3 @@ export interface PhotoSwipePluginLocaleData { */ arrowNext: string } - -export type PhotoSwipePluginLocaleConfig = - ExactLocaleConfig diff --git a/plugins/markdown/plugin-markdown-hint/src/node/hint.ts b/plugins/markdown/plugin-markdown-hint/src/node/hint.ts index dc0c638ced..a2509ee72b 100644 --- a/plugins/markdown/plugin-markdown-hint/src/node/hint.ts +++ b/plugins/markdown/plugin-markdown-hint/src/node/hint.ts @@ -13,20 +13,20 @@ export type MarkdownItHintOptions = export type MarkdownHintContainerName = keyof MarkdownHintPluginLocaleData +const CONTAINERS: MarkdownHintContainerName[] = [ + 'info', + 'note', + 'tip', + 'warning', + 'caution', + 'important', +] + export const hint: PluginWithOptions = ( md, options = {}, ) => { - const containers: MarkdownHintContainerName[] = [ - 'info', - 'note', - 'tip', - 'warning', - 'caution', - 'important', - ] - - containers.forEach((name) => { + CONTAINERS.forEach((name) => { md.use(container, { name, openRender: (tokens, index, _options, env: MarkdownEnv) => { diff --git a/plugins/pwa/plugin-pwa/src/client/components/PwaFoundPopup.ts b/plugins/pwa/plugin-pwa/src/client/components/PwaFoundPopup.ts index 972b5e8160..91118831e2 100644 --- a/plugins/pwa/plugin-pwa/src/client/components/PwaFoundPopup.ts +++ b/plugins/pwa/plugin-pwa/src/client/components/PwaFoundPopup.ts @@ -1,8 +1,8 @@ import { useLocaleConfig } from '@vuepress/helper/client' import type { PropType, SlotsType, VNode } from 'vue' import { Transition, defineComponent, h, onMounted, ref } from 'vue' -import type { PwaPluginLocaleConfig } from '../../shared/index.js' import { usePwaEvent } from '../composables/index.js' +import type { PwaPluginLocaleConfig } from '../types.js' import { UpdateIcon } from './icons.js' import '../styles/popup.css' diff --git a/plugins/pwa/plugin-pwa/src/client/components/PwaInstall.ts b/plugins/pwa/plugin-pwa/src/client/components/PwaInstall.ts index 511df4fc28..054af39ec0 100644 --- a/plugins/pwa/plugin-pwa/src/client/components/PwaInstall.ts +++ b/plugins/pwa/plugin-pwa/src/client/components/PwaInstall.ts @@ -2,10 +2,8 @@ import { useLocaleConfig } from '@vuepress/helper/client' import { useToggle } from '@vueuse/core' import type { PropType, VNode } from 'vue' import { computed, defineComponent, h, onMounted, ref } from 'vue' -import type { - ManifestExternalApplicationResource, - PwaPluginLocaleConfig, -} from '../../shared/index.js' +import type { ManifestExternalApplicationResource } from '../../shared/index.js' +import type { PwaPluginLocaleConfig } from '../types.js' import { PwaInstallModal } from './PwaInstallModal.js' import '../styles/modal.css' diff --git a/plugins/pwa/plugin-pwa/src/client/components/PwaInstallModal.ts b/plugins/pwa/plugin-pwa/src/client/components/PwaInstallModal.ts index 2b8f0511a6..2502cbad7b 100644 --- a/plugins/pwa/plugin-pwa/src/client/components/PwaInstallModal.ts +++ b/plugins/pwa/plugin-pwa/src/client/components/PwaInstallModal.ts @@ -4,7 +4,8 @@ import { useEventListener } from '@vueuse/core' import type { PropType, VNode } from 'vue' import { defineComponent, h, onMounted, shallowRef } from 'vue' import { withBase } from 'vuepress/client' -import type { AppManifest, PwaPluginLocaleConfig } from '../../shared/index.js' +import type { AppManifest } from '../../shared/index.js' +import type { PwaPluginLocaleConfig } from '../types.js' import { ArrowLeftIcon, ArrowRightIcon, CloseIcon } from './icons.js' interface InstallPromptEvent extends Event { diff --git a/plugins/pwa/plugin-pwa/src/client/components/PwaReadyPopup.ts b/plugins/pwa/plugin-pwa/src/client/components/PwaReadyPopup.ts index e0973c0ea0..bc94bba7c5 100644 --- a/plugins/pwa/plugin-pwa/src/client/components/PwaReadyPopup.ts +++ b/plugins/pwa/plugin-pwa/src/client/components/PwaReadyPopup.ts @@ -8,8 +8,8 @@ import { onMounted, shallowRef, } from 'vue' -import type { PwaPluginLocaleConfig } from '../../shared/index.js' import { usePwaEvent } from '../composables/index.js' +import type { PwaPluginLocaleConfig } from '../types.js' import { skipWaiting } from '../utils/index.js' import { UpdateIcon } from './icons.js' diff --git a/plugins/pwa/plugin-pwa/src/client/types.ts b/plugins/pwa/plugin-pwa/src/client/types.ts new file mode 100644 index 0000000000..a7cec47b81 --- /dev/null +++ b/plugins/pwa/plugin-pwa/src/client/types.ts @@ -0,0 +1,4 @@ +import type { ExactLocaleConfig } from '@vuepress/helper/client' +import type { PwaPluginLocaleData } from '../shared/index.js' + +export type PwaPluginLocaleConfig = ExactLocaleConfig diff --git a/plugins/pwa/plugin-pwa/src/shared/locales.ts b/plugins/pwa/plugin-pwa/src/shared/locales.ts index 10de44d476..4e03d196fd 100644 --- a/plugins/pwa/plugin-pwa/src/shared/locales.ts +++ b/plugins/pwa/plugin-pwa/src/shared/locales.ts @@ -1,5 +1,3 @@ -import type { ExactLocaleConfig } from '@vuepress/helper' - export interface PwaPluginLocaleData { /** * Install button text @@ -78,5 +76,3 @@ export interface PwaPluginLocaleData { */ update: string } - -export type PwaPluginLocaleConfig = ExactLocaleConfig diff --git a/plugins/search/plugin-slimsearch/src/client/define.ts b/plugins/search/plugin-slimsearch/src/client/define.ts index 02becd69d2..896cabbc8a 100644 --- a/plugins/search/plugin-slimsearch/src/client/define.ts +++ b/plugins/search/plugin-slimsearch/src/client/define.ts @@ -1,7 +1,8 @@ +import type { ExactLocaleConfig } from '@vuepress/helper/client' import type { SlimSearchCustomFieldFormatter, SlimSearchKeyOptions, - SlimSearchLocaleConfig, + SlimSearchLocaleData, } from '../shared/index.js' type SlimSearchClientCustomFiledConfig = Record< @@ -18,7 +19,7 @@ declare const __SLIMSEARCH_OPTIONS__: { hotKeys: SlimSearchKeyOptions[] worker: string } -declare const __SLIMSEARCH_LOCALES__: SlimSearchLocaleConfig +declare const __SLIMSEARCH_LOCALES__: ExactLocaleConfig export const customFieldConfig = __SLIMSEARCH_CUSTOM_FIELDS__ export const options = __SLIMSEARCH_OPTIONS__ diff --git a/plugins/search/plugin-slimsearch/src/shared/locales.ts b/plugins/search/plugin-slimsearch/src/shared/locales.ts index 244f48432a..831465da3f 100644 --- a/plugins/search/plugin-slimsearch/src/shared/locales.ts +++ b/plugins/search/plugin-slimsearch/src/shared/locales.ts @@ -1,5 +1,3 @@ -import type { ExactLocaleConfig } from '@vuepress/helper' - /** * Multi language config for `@vuepress/plugin-slimsearch` * @@ -104,5 +102,3 @@ export interface SlimSearchLocaleData { */ emptyResult: string } - -export type SlimSearchLocaleConfig = ExactLocaleConfig diff --git a/plugins/tools/plugin-redirect/src/client/components/RedirectModal.ts b/plugins/tools/plugin-redirect/src/client/components/RedirectModal.ts index 1c3dfcbdca..367340aac5 100644 --- a/plugins/tools/plugin-redirect/src/client/components/RedirectModal.ts +++ b/plugins/tools/plugin-redirect/src/client/components/RedirectModal.ts @@ -12,11 +12,9 @@ import { watch, } from 'vue' import { useRouteLocale, useRoutePath, useRouter } from 'vuepress/client' -import type { - RedirectBehaviorConfig, - RedirectPluginLocaleConfig, -} from '../../shared/index.js' +import type { RedirectBehaviorConfig } from '../../shared/index.js' import { useRedirectInfo } from '../composables/index.js' +import type { RedirectPluginLocaleConfig } from '../types.js' import { statusLocalStorage, statusSessionStorage } from '../utils/index.js' import '../styles/redirect-modal.css' diff --git a/plugins/tools/plugin-redirect/src/client/config.ts b/plugins/tools/plugin-redirect/src/client/config.ts index 1f85a16fc9..993ddc9ee3 100644 --- a/plugins/tools/plugin-redirect/src/client/config.ts +++ b/plugins/tools/plugin-redirect/src/client/config.ts @@ -1,11 +1,9 @@ import RedirectModal from '@vuepress/plugin-redirect/modal' import { h } from 'vue' import { defineClientConfig } from 'vuepress/client' -import type { - RedirectBehaviorConfig, - RedirectPluginLocaleConfig, -} from '../shared/index.js' +import type { RedirectBehaviorConfig } from '../shared/index.js' import { setupDevServerRedirect, setupRedirect } from './composables/index.js' +import type { RedirectPluginLocaleConfig } from './types.js' import './styles/vars.css' diff --git a/plugins/tools/plugin-redirect/src/client/types.ts b/plugins/tools/plugin-redirect/src/client/types.ts new file mode 100644 index 0000000000..7b43a7342c --- /dev/null +++ b/plugins/tools/plugin-redirect/src/client/types.ts @@ -0,0 +1,5 @@ +import type { ExactLocaleConfig } from '@vuepress/helper/client' +import type { RedirectPluginLocaleData } from '../shared/index.js' + +export type RedirectPluginLocaleConfig = + ExactLocaleConfig diff --git a/plugins/tools/plugin-redirect/src/shared/locales.ts b/plugins/tools/plugin-redirect/src/shared/locales.ts index 3f538e6119..bf17bc6473 100644 --- a/plugins/tools/plugin-redirect/src/shared/locales.ts +++ b/plugins/tools/plugin-redirect/src/shared/locales.ts @@ -1,5 +1,3 @@ -import type { ExactLocaleConfig } from '@vuepress/helper/shared' - export interface RedirectPluginLocaleData { /** * Language name @@ -36,6 +34,3 @@ export interface RedirectPluginLocaleData { */ remember: string } - -export type RedirectPluginLocaleConfig = - ExactLocaleConfig