You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But we need to improve the support for theme config:
By default, defineConfig helper leverages the theme config type from default theme:
import{defineConfig}from'vitepress'exportdefaultdefineConfig({themeConfig: {// Type is `DefaultTheme.Config` }})
If you use a custom theme, you'll be able to pass the generics type for your custom theme, and you need overload it with the second parameter of defineConfig helper:
import{defineConfig}from'vitepress'import{ThemeConfig}from'your-theme'exportdefaultdefineConfig<ThemeConfig>({themeConfig: {// Type is `ThemeConfig` }},true);// declare `usingCustomTheme` and discard usage of the default theme.
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
The text was updated successfully, but these errors were encountered:
ulivz
changed the title
[Feature Request] TypeScript support for config file.
[Feature Request] Improve TypeScript support for config file.
Dec 11, 2021
Is your feature request related to a problem? Please describe.
Make configuration easier.
Describe the solution you'd like
Same as vite :
But we need to improve the support for theme config:
By default,
defineConfig
helper leverages the theme config type from default theme:If you use a custom theme, you'll be able to pass the generics type for your custom theme, and you need overload it with the second parameter of
defineConfig
helper:Describe alternatives you've considered
No response
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: