Integration of Twoslash's Rspress Plugin for automatically generating rich code blocks with type information.
Use special comments within TypeScript code blocks to enable Twoslash features.
For more detailed usage, please refer to the Twoslash documentation.
The plugin accepts an object with the following type:
explicitTrigger is used to configure whether to explicitly trigger the Twoslash feature. Default is true.
false, all TypeScript code blocks will be processed by default.true, only code blocks with the twoslash tag will be processed.cache is used to cache the TypeScript language servers based on compiler options when calling createTwoslasher. Default is true.
twoslashOptions is used to pass options to Twoslash.
This allows you to customize the Twoslash behavior, including TypeScript compiler options and other settings.