Skip to content

Commit

Permalink
fix: optimize ts types
Browse files Browse the repository at this point in the history
ISSUES CLOSED: #302
  • Loading branch information
recoluan committed Sep 19, 2024
1 parent be2faba commit 5122a86
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
3 changes: 2 additions & 1 deletion docs/.vuepress/config/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import * as zhConfig from './zh'
import * as enConfig from './en'
import { RecoThemeData } from 'vuepress-theme-reco/lib/types'

export const themeConfig = {
export const themeConfig: RecoThemeData = {
locales: {
'/': {
selectLanguageText: '语言',
Expand Down
27 changes: 26 additions & 1 deletion packages/vuepress-theme-reco/src/types/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import type { LocaleData } from 'vuepress/shared'
import type { ThemeData } from '@vuepress/plugin-theme-data'
import type { NavbarConfig, SeriesConfig } from './nav.js'
import { PageOptions } from '../../../@vuepress-reco/plugin-page/src/types/index.js'
import { ViteBundlerOptions } from '@vuepress/bundler-vite'
import { WebpackBundlerOptions } from '@vuepress/bundler-webpack'

export type RecoThemeData = ThemeData<RecoThemeLocaleData>

Expand Down Expand Up @@ -180,13 +182,36 @@ export interface RecoThemeLocaleData extends LocaleData {
pages?: Array<PageOptions>

commentConfig?: {
type: 'valine' | 'waline' | 'giscus'
type: string
options: Record<string, any>
},

categoriesText?: string

tagsText?: string

viteBundlerOptions?: ViteBundlerOptions

webpackBundlerOptions?: WebpackBundlerOptions

bulletin?: {
title?: string
width?: string
body?: Array<{
type: string
[key: string]: any
}>
}

tip?: string
info?: string
warning?: string
danger?: string
details?: string
notFound?: string
backToHome?: string

algolia?: Record<string, any>
}

export type AutoAddCategoryToNavbarOptions = {
Expand Down

0 comments on commit 5122a86

Please sign in to comment.