Check out the [Config Reference](/config/basics) for a full list of options.
Check out the [Config Reference](/config/basics) for a full list of options.
## Config Intellisense
## Config Intellisense
Since VitePress ships with TypeScript typings, you can leverage your IDE's intellisense with jsdoc type hints:
Since VitePress ships with TypeScript typings, you can leverage your IDE's intellisense with jsdoc type hints:
@ -52,12 +51,11 @@ export default defineConfig({
VitePress also directly supports TS config files. You can use `.vitepress/config.ts` with the `defineConfig` helper as well.
VitePress also directly supports TS config files. You can use `.vitepress/config.ts` with the `defineConfig` helper as well.
## Typed Theme Config
## Typed Theme Config
By default, `defineConfig` helper leverages the theme config type from default theme:
By default, `defineConfig` helper leverages the theme config type from default theme:
```js
```ts
import { defineConfig } from 'vitepress'
import { defineConfig } from 'vitepress'
export default defineConfig({
export default defineConfig({
@ -67,15 +65,15 @@ export default defineConfig({
})
})
```
```
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:
If you use a custom theme and want type checks for the theme config, you'll need to use `defineConfigWithTheme` instead, and pass the config type for your custom theme via a generic argument: