fix types for plugin openapi#1174
Conversation
|
Visit the preview URL for this PR (updated for commit 7b7bed4): https://docusaurus-openapi-36b86--pr1174-q9v0lwqw.web.app (expires Sun, 27 Jul 2025 18:07:31 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: bf293780ee827f578864d92193b8c2866acd459f |
|
The latest commit adjusts the plugin’s TypeScript type declarations: It imports the VersionBanner type from @docusaurus/plugin-content-docs, allowing PropApiMetadata to specify its banner field accurately rather than leaving a TODO comment. This ensures banner matches Docusaurus’s defined version banner options. It imports TOCItem from @docusaurus/mdx-loader and updates the toc field in ApiItem props from an untyped “array” to the explicit readonly TOCItem[] | undefined. This means the TOC entries in API pages now have precise typing, improving IDE support and compile-time checking. Key code lines showing these improvements: |
Summary
Testing
yarn lintyarn testhttps://chatgpt.com/codex/tasks/task_e_685ed9d95e9883239d8ac3ccf0459f59