Multiple Instances
By default, the Starlight TypeDoc plugin generates documentation for one or multiple entry points using the same plugin or TypeDoc configuration.
Sometimes, you may want to generate documentation for different entry points using different configurations.
To achieve this, the Starlight TypeDoc plugin exposes a createStarlightTypeDocPlugin()
function that allows you to create multiple instances of the plugin.
createStarlightTypeDocPlugin()
Calling the createStarlightTypeDocPlugin()
function returns an array with exactly two values:
- A new Starlight TypeDoc plugin instance that you can add to your Starlight configuration.
- A reference to the generated sidebar group for that instance that you can add to your sidebar.
The following example creates two Starlight TypeDoc plugin instances for two different entry points: one for a public API and another for an admin API. The associated sidebar groups are then added to the sidebar: