Skip to content

Configuration

The Starlight TypeDoc plugin can be configured inside the astro.config.mjs configuration file of your project:

astro.config.mjs
import starlight from '@astrojs/starlight'
import { defineConfig } from 'astro/config'
import starlightTypeDoc, { typeDocSidebarGroup } from 'starlight-typedoc'
export default defineConfig({
integrations: [
starlight({
plugins: [
starlightTypeDoc({
// Configuration options go here.
}),
],
title: 'My Docs',
}),
],
})

You can pass the following options to the Starlight TypeDoc plugin.

Type: string[]

The path(s) to the entry point(s) to document.

This option can also be specified in a TypeDoc options file located at the root of the project (e.g. typedoc.json or typedoc.mjs).

Type: string

The path to the tsconfig.json file to use for the documentation generation.

This option can also be specified in a TypeDoc options file located at the root of the project (e.g. typedoc.json or typedoc.mjs).

Type: string
Default: 'api'

The output directory containing the generated documentation markdown files relative to the src/content/docs/ directory.

Type: boolean
Default: false

Whether the footer should include previous and next page links for the generated documentation.

Type: StarlightTypeDocSidebarOptions

The generated documentation sidebar configuration.

Type: TypeDocConfig

Additional TypeDoc or typedoc-plugin-markdown configuration to override the default settings used by the plugin.

These options can also be specified in a TypeDoc options file located at the root of the project (e.g. typedoc.json or typedoc.mjs).

Type: boolean
Default: false

Whether to watch the entry point(s) for changes and regenerate the documentation when needed.

Type: boolean
Default: true

Whether the plugin should error when no TypeDoc documentation is generated.

By default, the plugin will error when no TypeDoc documentation is generated. Setting this option to false will prevent the plugin from erroring in this case. This can be useful when generating documentation for multiple entry points and only some of them contain documented code at a given time.

The sidebar configuration is an object with the following properties:

Type: boolean
Default: false

Whether the generated documentation sidebar group should be collapsed by default. Note that nested sidebar groups are always collapsed.

Type: string
Default: 'API'

The generated documentation sidebar group label.

Type: string
Default: 'Overview'

The label used for generated readme links in the sidebar when the TypeDoc readme option is configured.